diff --git a/src/gr/uom/java/jdeodorant/preferences/PreferenceConstants.java b/src/gr/uom/java/jdeodorant/preferences/PreferenceConstants.java index 6c112836..2d022e6e 100644 --- a/src/gr/uom/java/jdeodorant/preferences/PreferenceConstants.java +++ b/src/gr/uom/java/jdeodorant/preferences/PreferenceConstants.java @@ -17,6 +17,8 @@ public class PreferenceConstants { public static final String P_MAXIMUM_CALL_GRAPH_ANALYSIS_DEPTH = "maximumCallGraphAnalysisDepthPreference"; + public static final String P_ENABLE_CALL_GRAPH_ANALYSIS = "enableCallGraphAnalysisPreference"; + public static final String P_ENABLE_ALIAS_ANALYSIS = "enableAliasAnalysisPreference"; public static final String P_PROJECT_COMPILATION_UNIT_CACHE_SIZE = "projectCompilationUnitCacheSize"; diff --git a/src/gr/uom/java/jdeodorant/preferences/PreferenceInitializer.java b/src/gr/uom/java/jdeodorant/preferences/PreferenceInitializer.java index 58b5d288..60dd6563 100644 --- a/src/gr/uom/java/jdeodorant/preferences/PreferenceInitializer.java +++ b/src/gr/uom/java/jdeodorant/preferences/PreferenceInitializer.java @@ -23,6 +23,7 @@ public void initializeDefaultPreferences() { store.setDefault(PreferenceConstants.P_MAXIMUM_RATIO_OF_DUPLICATED_TO_EXTRACTED, 1.0); store.setDefault(PreferenceConstants.P_MINIMUM_METHOD_SIZE, 0); store.setDefault(PreferenceConstants.P_MAXIMUM_CALL_GRAPH_ANALYSIS_DEPTH, 3); + store.setDefault(PreferenceConstants.P_ENABLE_CALL_GRAPH_ANALYSIS, true); store.setDefault(PreferenceConstants.P_ENABLE_ALIAS_ANALYSIS, true); store.setDefault(PreferenceConstants.P_PROJECT_COMPILATION_UNIT_CACHE_SIZE, 20); store.setDefault(PreferenceConstants.P_LIBRARY_COMPILATION_UNIT_CACHE_SIZE, 50); diff --git a/src/gr/uom/java/jdeodorant/preferences/PropertyManagerPreferencePage.java b/src/gr/uom/java/jdeodorant/preferences/PropertyManagerPreferencePage.java index 77a0ccc2..1949322a 100644 --- a/src/gr/uom/java/jdeodorant/preferences/PropertyManagerPreferencePage.java +++ b/src/gr/uom/java/jdeodorant/preferences/PropertyManagerPreferencePage.java @@ -34,6 +34,7 @@ public class PropertyManagerPreferencePage private StringFieldEditor maximumRatioOfDuplicatedToExtractedFieldEditor; private IntegerFieldEditor minimumMethodSizeFieldEditor; private IntegerFieldEditor maximumCallGraphAnalysisDepthFieldEditor; + private BooleanFieldEditor enableCallGraphAnalysisFieldEditor; private BooleanFieldEditor enableAliasAnalysisFieldEditor; private IntegerFieldEditor projectCompilationUnitCacheSizeFieldEditor; private IntegerFieldEditor libraryCompilationUnitCacheSizeFieldEditor; @@ -89,26 +90,39 @@ public void createFieldEditors() { minimumMethodSizeFieldEditor.setEmptyStringAllowed(false); addField(minimumMethodSizeFieldEditor); + Group callGraphAnalysisPreferenceGroup = new Group(composite, SWT.SHADOW_ETCHED_IN); + callGraphAnalysisPreferenceGroup.setLayout(new GridLayout(1, false)); + callGraphAnalysisPreferenceGroup.setText("Call Graph Analysis Preferences"); + + enableCallGraphAnalysisFieldEditor = new BooleanFieldEditor( + PreferenceConstants.P_ENABLE_CALL_GRAPH_ANALYSIS, + "&Enable Call Graph Analysis", callGraphAnalysisPreferenceGroup); + addField(enableCallGraphAnalysisFieldEditor); + + enableAliasAnalysisFieldEditor = new BooleanFieldEditor( + PreferenceConstants.P_ENABLE_ALIAS_ANALYSIS, + "&Enable Alias Analysis", callGraphAnalysisPreferenceGroup); + addField(enableAliasAnalysisFieldEditor); + maximumCallGraphAnalysisDepthFieldEditor = new IntegerFieldEditor( PreferenceConstants.P_MAXIMUM_CALL_GRAPH_ANALYSIS_DEPTH, - "&Maximum depth of method call graph analysis:", sliceExtractionPreferenceGroup); + "&Maximum depth of method call graph analysis:", callGraphAnalysisPreferenceGroup); maximumCallGraphAnalysisDepthFieldEditor.setEmptyStringAllowed(false); addField(maximumCallGraphAnalysisDepthFieldEditor); - enableAliasAnalysisFieldEditor = new BooleanFieldEditor( - PreferenceConstants.P_ENABLE_ALIAS_ANALYSIS, - "&Enable Alias Analysis", sliceExtractionPreferenceGroup); - addField(enableAliasAnalysisFieldEditor); + Group compilationUnitCachePreferenceGroup = new Group(composite, SWT.SHADOW_ETCHED_IN); + compilationUnitCachePreferenceGroup.setLayout(new GridLayout(1, false)); + compilationUnitCachePreferenceGroup.setText("CompilationUnit Cache Preferences"); projectCompilationUnitCacheSizeFieldEditor = new IntegerFieldEditor( PreferenceConstants.P_PROJECT_COMPILATION_UNIT_CACHE_SIZE, - "&Project CompilationUnit cache size:", sliceExtractionPreferenceGroup); + "&Project CompilationUnit cache size:", compilationUnitCachePreferenceGroup); projectCompilationUnitCacheSizeFieldEditor.setEmptyStringAllowed(false); addField(projectCompilationUnitCacheSizeFieldEditor); libraryCompilationUnitCacheSizeFieldEditor = new IntegerFieldEditor( PreferenceConstants.P_LIBRARY_COMPILATION_UNIT_CACHE_SIZE, - "&Library CompilationUnit cache size:", sliceExtractionPreferenceGroup); + "&Library CompilationUnit cache size:", compilationUnitCachePreferenceGroup); libraryCompilationUnitCacheSizeFieldEditor.setEmptyStringAllowed(false); addField(libraryCompilationUnitCacheSizeFieldEditor);