MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getSubmenuName

Method getSubmenuName

ij/src/main/java/ij/Menus.java:970–984  ·  view source on GitHub ↗
(String jarPath)

Source from the content-addressed store, hash-verified

968 }
969
970 String getSubmenuName(String jarPath) {
971 //IJ.log("getSubmenuName: \n"+jarPath+"\n"+pluginsPath);
972 if (pluginsPath == null)
973 return null;
974 if (jarPath.startsWith(pluginsPath))
975 jarPath = jarPath.substring(pluginsPath.length() - 1);
976 int index = jarPath.lastIndexOf(File.separatorChar);
977 if (index<0) return null;
978 String name = jarPath.substring(0, index);
979 index = name.lastIndexOf(File.separatorChar);
980 if (index<0) return null;
981 name = name.substring(index+1);
982 if (name.equals("plugins")) return null;
983 return name;
984 }
985
986 static void addItemSorted(Menu menu, MenuItem item, int startingIndex) {
987 String itemLabel = item.getLabel();

Callers 1

installJarPluginMethod · 0.95

Calls 4

startsWithMethod · 0.80
substringMethod · 0.80
lengthMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected