*
* @see com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.ListEditor#getEditedInput(java.lang.String)
*/
@Override
protected String getEditedInput(String input) {
PromptDialog dialog = new PromptDialog(getShell(), SWT.SHEET) {
@Override
protected boolean isValid(String text) {
boolean result = true;
if(text.contains(":")) {
result = false;
setErrorMessage("Colon ':' is not allowed");
}
else if(text.contains("//")) {
result = false;
setErrorMessage("Empty segment '//' not allowed");
}
return result;
}
};
String[] value = new String[] { input };
int[] allSubdirs = new int[] { input.endsWith("/*")
? 1
: 0 };
int[] okCancel = new int[] { 1 };
dialog.prompt(
"Edit Path Segement", "Edit relative path", "Search all subdirectories", value, allSubdirs, okCancel);
if(okCancel[0] == 0)
return input;
String result = value[0].trim();
if(allSubdirs[0] == 0) {