|
|
@ -202,10 +202,11 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
return INSTANCE; |
|
|
|
return INSTANCE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static FILEChooserPane getInstanceWithDesignatePath(String path, FILEFilter filter) { |
|
|
|
public static FILEChooserPane getInstanceWithDesignatePath(String path, FILEFilter filter, String topPath) { |
|
|
|
INSTANCE.showLoc = false; |
|
|
|
INSTANCE.showLoc = false; |
|
|
|
INSTANCE.showEnv = false; |
|
|
|
INSTANCE.showEnv = false; |
|
|
|
INSTANCE.showWebReport = false; |
|
|
|
INSTANCE.showWebReport = false; |
|
|
|
|
|
|
|
INSTANCE.setTopPath(topPath); |
|
|
|
INSTANCE.setDesignateModel(path); |
|
|
|
INSTANCE.setDesignateModel(path); |
|
|
|
INSTANCE.removeAllFilter(); |
|
|
|
INSTANCE.removeAllFilter(); |
|
|
|
INSTANCE.addChooseFILEFilter(filter, 0); |
|
|
|
INSTANCE.addChooseFILEFilter(filter, 0); |
|
|
@ -633,6 +634,9 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
this.filterList.clear(); |
|
|
|
this.filterList.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void removeTopPath() { |
|
|
|
|
|
|
|
this.setTopPath(StringUtils.EMPTY); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置filter,刷新右侧subFileList中的items |
|
|
|
* 设置filter,刷新右侧subFileList中的items |
|
|
@ -1045,9 +1049,14 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
if (placesList == null) { |
|
|
|
if (placesList == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setPlaceListModel(new DesignateRemotePlaceListModel(path)); |
|
|
|
setPlaceListModel(new DesignateRemotePlaceListModel(path)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setTopPath(String path) { |
|
|
|
|
|
|
|
this.locationBtnPane.setTopPath(path); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setMultiPlaceListModel() { |
|
|
|
private void setMultiPlaceListModel() { |
|
|
|
if (placesList == null) { |
|
|
|
if (placesList == null) { |
|
|
@ -1385,6 +1394,8 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
private List<UIButton> buttonList = new ArrayList<>(); |
|
|
|
private List<UIButton> buttonList = new ArrayList<>(); |
|
|
|
private int pathIndex = 0; |
|
|
|
private int pathIndex = 0; |
|
|
|
private int maxPathIndex = 0; |
|
|
|
private int maxPathIndex = 0; |
|
|
|
|
|
|
|
// 对顶层目录进行的限制
|
|
|
|
|
|
|
|
private String topPath; |
|
|
|
|
|
|
|
|
|
|
|
public LocationButtonPane() { |
|
|
|
public LocationButtonPane() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); |
|
|
@ -1430,6 +1441,10 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setTopPath(String path) { |
|
|
|
|
|
|
|
this.topPath = path; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void highLightButton(FILE dir) { |
|
|
|
public void highLightButton(FILE dir) { |
|
|
|
for (int i = 0; i < this.buttonList.size(); i++) { |
|
|
|
for (int i = 0; i < this.buttonList.size(); i++) { |
|
|
|
this.buttonList.get(i).setForeground(null); |
|
|
|
this.buttonList.get(i).setForeground(null); |
|
|
@ -1471,6 +1486,7 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
Matcher matcher = SEPARATOR_PATTERN.matcher(path); |
|
|
|
Matcher matcher = SEPARATOR_PATTERN.matcher(path); |
|
|
|
int node_start = 0; |
|
|
|
int node_start = 0; |
|
|
|
|
|
|
|
boolean needTopPath = !StringUtils.isEmpty(topPath); |
|
|
|
while (matcher.find()) { |
|
|
|
while (matcher.find()) { |
|
|
|
int start = matcher.start(); |
|
|
|
int start = matcher.start(); |
|
|
|
String btn_text = path.substring(node_start, start); |
|
|
|
String btn_text = path.substring(node_start, start); |
|
|
@ -1478,11 +1494,18 @@ public class FILEChooserPane extends BasicPane { |
|
|
|
if (StringUtils.isBlank(btn_text) && isWebAppNamePath) { |
|
|
|
if (StringUtils.isBlank(btn_text) && isWebAppNamePath) { |
|
|
|
btn_text = webAppName; |
|
|
|
btn_text = webAppName; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
node_start = matcher.end(); |
|
|
|
|
|
|
|
if (needTopPath) { |
|
|
|
|
|
|
|
if (topPath.equals(btn_text)) { |
|
|
|
|
|
|
|
needTopPath = false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/', |
|
|
|
this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/', |
|
|
|
// alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux
|
|
|
|
// alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux
|
|
|
|
// OS中意义很不一样
|
|
|
|
// OS中意义很不一样
|
|
|
|
FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")))))); |
|
|
|
FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")))))); |
|
|
|
node_start = matcher.end(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
maxPathIndex = calculateMaxPathIndex(); |
|
|
|
maxPathIndex = calculateMaxPathIndex(); |
|
|
|
|
|
|
|
|
|
|
|