File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/java/org/scijava Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,20 @@ public MenuPath(final String path) {
7474 * the specified separator.
7575 */
7676 public MenuPath (final String path , final String separator ) {
77+ this (path , separator , true );
78+ }
79+
80+ /**
81+ * Creates a menu path with entries parsed from the given string, splitting on
82+ * the specified separator, and trimming whitespace if indicated.
83+ */
84+ public MenuPath (final String path , final String separator ,
85+ final boolean trim )
86+ {
7787 if (path != null && !path .isEmpty ()) {
7888 final String [] tokens = path .split (separator );
7989 for (final String token : tokens ) {
80- add (new MenuEntry (token .trim ()));
90+ add (new MenuEntry (trim ? token .trim () : token ));
8191 }
8292 }
8393 }
You can’t perform that action at this time.
0 commit comments