Skip to content

Commit f544fc1

Browse files
committed
MenuPath: support alternative path separators
1 parent 9b7c6bb commit f544fc1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/org/scijava/MenuPath.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ public MenuPath(final Collection<? extends MenuEntry> menuEntries) {
6666
* @see #PATH_SEPARATOR
6767
*/
6868
public MenuPath(final String path) {
69+
this(path, PATH_SEPARATOR);
70+
}
71+
72+
/**
73+
* Creates a menu path with entries parsed from the given string, splitting on
74+
* the specified separator.
75+
*/
76+
public MenuPath(final String path, final String separator) {
6977
if (path != null && !path.isEmpty()) {
70-
final String[] tokens = path.split(PATH_SEPARATOR);
78+
final String[] tokens = path.split(separator);
7179
for (final String token : tokens) {
7280
add(new MenuEntry(token.trim()));
7381
}

0 commit comments

Comments
 (0)