import javax.inject.Inject;
-import org.apache.commons.lang3.StringUtils;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
final Button checkBox = new Button(parent, SWT.CHECK);
// if(configurator.getClass().equals(Abcd206ImportConfigurator.class)){
- String[] r = methodName.split("set")[1].split("(?=\\p{Upper})");
- checkBox.setText(getLabel(StringUtils.join(r," ")));
-// }
-// else{
-// checkBox.setText(getLabel(methodName));
-// }
+ checkBox.setText(getLabel(splitMethodName(methodName)));
// retrieve the default values and set the checkbox accordingly
boolean defaultSelection = executeBooleanGetMethod(configurator, "is"
+ methodName.substring(3));
return booleanMethods;
}
+
+ private String splitMethodName(String s) {
+ s = s.replace("set", "");
+ return s.replaceAll(
+ String.format("%s|%s|%s",
+ "(?<=[A-Z])(?=[A-Z][a-z])",
+ "(?<=[^A-Z])(?=[A-Z])",
+ "(?<=[A-Za-z])(?=[^A-Za-z])"
+ ),
+ " "
+ );
+ }
}