editor_Language = new RadioGroupFieldEditor(Preference.lang, "Select your language.", 2,
labelAndValues, parent);
addField(editor_Language);
// output file encoding
addField(new StringFieldEditor(Preference.Common.outputFileEncoding, props
.get(Preference.Common.outputFileEncoding), parent));
// src/main/java
addField(new StringFieldEditor(Preference.Common.srcMainPath, props
.get(Preference.Common.srcMainPath), parent));
// src/test/java
addField(new StringFieldEditor(Preference.Common.srcTestPath, props
.get(Preference.Common.srcTestPath), parent));
// line break policy
{
String forceCRLF = Preference.LineBreakPolicy.forceCRLF;
String forceLF = Preference.LineBreakPolicy.forceLF;
String forceNewFileCRLF = Preference.LineBreakPolicy.forceNewFileCRLF;
String forceNewFileLF = Preference.LineBreakPolicy.forceNewFileLF;
String[][] lbpLabelAndValues = new String[][] { { props.get(forceCRLF), forceCRLF },
{ props.get(forceLF), forceLF }, { props.get(forceNewFileCRLF), forceNewFileCRLF },
{ props.get(forceNewFileLF), forceNewFileLF } };
editor_lineBreakPolicy = new RadioGroupFieldEditor(Preference.Common.lineBreakPolicy, props
.get(Preference.LineBreakPolicy.description), 5, lbpLabelAndValues, parent);
addField(editor_lineBreakPolicy);
}
// Soft tabs
{
editor_useSoftTabs = new BooleanFieldEditor(Preference.Common.useSoftTabs, props
.get(Preference.Common.useSoftTabs), parent);
addField(editor_useSoftTabs);
editor_softTabSize = new StringFieldEditor(Preference.Common.softTabSize, props
.get(Preference.Common.softTabSize), parent);
addField(editor_softTabSize);
}
// JUnit version(3 or 4)
String ver3 = Preference.TestClassGen.junitVersion3;
String ver4 = Preference.TestClassGen.junitVersion4;
String[][] junitVersionsLabelAndValues = new String[][] { { props.get(ver3), ver3 },
{ props.get(ver4), ver4 }, };
editor_JUnitVersion = new RadioGroupFieldEditor(Preference.TestClassGen.junitVersion, props
.get(Preference.TestClassGen.description), 2, junitVersionsLabelAndValues, parent) {
@Override
protected void fireValueChanged(String p, Object o, Object n) {
super.fireValueChanged(p, o, n);
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setValue(Preference.TestClassGen.junitVersion, String.valueOf(n));
}
};
addField(editor_JUnitVersion);
// class to extend
editor_ClassToExtend = new StringFieldEditor(Preference.TestClassGen.classToExtend, props
.get(Preference.TestClassGen.classToExtend), parent);
addField(editor_ClassToExtend);
// common delimiter setting
editor_TestMethodNameBasicDelimiter = new StringFieldEditor(Preference.TestMethodGen.delimiter,
props.get(Preference.TestMethodGen.delimiter), 10, parent);
addField(editor_TestMethodNameBasicDelimiter);
editor_isTestMethodNameArgsRequired = new BooleanFieldEditor(Preference.TestMethodGen.enabledArgs,
props.get(Preference.TestMethodGen.enabledArgs), parent);
addField(editor_isTestMethodNameArgsRequired);
editor_TestMethodNameArgsPrefix = new StringFieldEditor(Preference.TestMethodGen.argsPrefix, props
.get(Preference.TestMethodGen.argsPrefix), parent);
addField(editor_TestMethodNameArgsPrefix);
editor_TestMethodNameArgsDelimiter = new StringFieldEditor(Preference.TestMethodGen.argsDelimiter,
props.get(Preference.TestMethodGen.argsDelimiter), parent);
addField(editor_TestMethodNameArgsDelimiter);
editor_isTestMethodNameReturnTypeRequired = new BooleanFieldEditor(
Preference.TestMethodGen.enabledReturn, props.get(Preference.TestMethodGen.enabledReturn),
parent);
addField(editor_isTestMethodNameReturnTypeRequired);
editor_TestMethodNameReturnPrefix = new StringFieldEditor(Preference.TestMethodGen.returnPrefix,
props.get(Preference.TestMethodGen.returnPrefix), parent);
addField(editor_TestMethodNameReturnPrefix);
editor_TestMethodNameRetrnDelimiter = new StringFieldEditor(
Preference.TestMethodGen.returnDelimiter, props
.get(Preference.TestMethodGen.returnDelimiter), parent);
addField(editor_TestMethodNameRetrnDelimiter);
// enable exception thrown
editor_isExceptionThrownRequired = new BooleanFieldEditor(
Preference.TestMethodGen.enabledException, props
.get(Preference.TestMethodGen.enabledException), parent);
addField(editor_isExceptionThrownRequired);
editor_TestMethodNameExceptionPrefix = new StringFieldEditor(
Preference.TestMethodGen.exceptionPrefix, props
.get(Preference.TestMethodGen.exceptionPrefix), parent);
addField(editor_TestMethodNameExceptionPrefix);
editor_TestMethodNameExceptionDelimiter = new StringFieldEditor(
Preference.TestMethodGen.exceptionDelimiter, props
.get(Preference.TestMethodGen.exceptionDelimiter), parent);
addField(editor_TestMethodNameExceptionDelimiter);
// public methods