String[][] whenAnalyze = new String[][] {
{ "Only on save", String.valueOf(IAnalysisPreferences.ANALYZE_ON_SAVE) },
{ "On any successful parse", String.valueOf(IAnalysisPreferences.ANALYZE_ON_SUCCESFUL_PARSE) } };
addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_CODE_ANALYSIS, "Do code analysis?",
BooleanFieldEditor.DEFAULT, p));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.WHEN_ANALYZE, "When do we analyze?", 2,
whenAnalyze, p, true));
String[][] values = new String[][] { { "Error", String.valueOf(IMarker.SEVERITY_ERROR) },
{ "Warning", String.valueOf(IMarker.SEVERITY_WARNING) },
{ "Ignore", String.valueOf(IMarker.SEVERITY_INFO) } };
p = createTab(tabFolder, "Unused");
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_IMPORT, "Unused import", 3,
values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_WILD_IMPORT,
"Unused wild import", 3, values, p, true));
addField(new StringFieldEditor(AnalysisPreferenceInitializer.NAMES_TO_IGNORE_UNUSED_IMPORT,
"Don't report unused imports in modules named: (comma separated)", p));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_PARAMETER, "Unused parameter",
3, values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_VARIABLE, "Unused variable",
3, values, p, true));
addField(new StringFieldEditor(AnalysisPreferenceInitializer.NAMES_TO_IGNORE_UNUSED_VARIABLE,
"Don't report unused variable if name starts with: (comma separated)", p) {
@Override
public int getNumberOfControls() {
return 1;
}
});
p = createTab(tabFolder, "Undefined");
addField(new StringFieldEditor(AnalysisPreferenceInitializer.NAMES_TO_CONSIDER_GLOBALS,
"Consider the following names as globals: (comma separated)", p));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNDEFINED_VARIABLE,
"Undefined variable", 3, values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNDEFINED_IMPORT_VARIABLE,
"Undefined variable from import", 3, values, p, true));
p = createTab(tabFolder, "Imports");
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_REIMPORT, "Import redefinition", 3,
values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNRESOLVED_IMPORT,
"Import not found", 3, values, p, true));
p = createTab(tabFolder, "Others");
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_DUPLICATED_SIGNATURE,
"Duplicated signature", 3, values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_NO_SELF,
"'self' not specified in class method", 3, values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_NO_EFFECT_STMT,
"Statement has no effect", 3, values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_INDENTATION_PROBLEM,
"Indentation problems and mixing of tabs/spaces", 3, values, p, true));
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_ASSIGNMENT_TO_BUILT_IN_SYMBOL,
"Redefinition of builtin symbols", 3, values, p, true));
//TODO: Add ARGUMENTS_MISMATCH again later on
//addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_ARGUMENTS_MISMATCH, "Arguments mismatch", 3,values,p, true));
p = createTab(tabFolder, "pep8.py");
String[][] pep8values = new String[][] { { "Error", String.valueOf(IMarker.SEVERITY_ERROR) },
{ "Warning", String.valueOf(IMarker.SEVERITY_WARNING) },
{ "Don't run", String.valueOf(IMarker.SEVERITY_INFO) } };
addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_PEP8, "Pep8", 3, pep8values, p, true) {
protected void doFillIntoGrid(Composite parent, int numColumns) {
super.doFillIntoGrid(parent, 3);
adjustForNumColumns(3);
}
});