more cleanup

This commit is contained in:
honfika@gmail.com
2015-07-05 21:54:30 +02:00
parent bf2c6cb822
commit dcb20d84f0
20 changed files with 23 additions and 35 deletions

View File

@@ -60,7 +60,7 @@ public class MainFrameClassicMenu extends MainFrameMenu {
}
String parentPath = "";
if (path.contains("/")) {
parentPath = path.substring(0, path.lastIndexOf("/"));
parentPath = path.substring(0, path.lastIndexOf('/'));
}
MenuElement parentMenu = menuElements.get(parentPath);
if (parentMenu == null) {
@@ -110,7 +110,7 @@ public class MainFrameClassicMenu extends MainFrameMenu {
}
String parentPath = "";
if (path.contains("/")) {
parentPath = path.substring(0, path.lastIndexOf("/"));
parentPath = path.substring(0, path.lastIndexOf('/'));
}
MenuElement parentMenu = menuElements.get(parentPath);
if (parentMenu == null) {
@@ -136,7 +136,7 @@ public class MainFrameClassicMenu extends MainFrameMenu {
path = mapping(path);
String parentPath = "";
if (path.contains("/")) {
parentPath = path.substring(0, path.lastIndexOf("/"));
parentPath = path.substring(0, path.lastIndexOf('/'));
}
MenuElement parentMenu = menuElements.get(parentPath);
if (parentMenu == null) {
@@ -287,7 +287,7 @@ public class MainFrameClassicMenu extends MainFrameMenu {
if (me instanceof JMenu) {
JMenu jm = (JMenu) me;
if (jm.getMenuComponentCount() == 1) {
String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf("/")) : "";
String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf('/')) : "";
MenuElement parMe = menuElements.get(parentPath);
JMenuItem mi = (JMenuItem) jm.getMenuComponent(0);
jm.remove(mi);