1   package com.stateofflow.eclipse.metrics.preferences.builder;
2   
3   import java.util.Collection;
4   
5   import org.eclipse.jface.preference.FieldEditor;
6   import org.eclipse.jface.preference.IPreferenceStore;
7   import org.eclipse.swt.widgets.Composite;
8   import org.eclipse.swt.widgets.Group;
9   import org.eclipse.swt.widgets.TabFolder;
10  
11  import com.stateofflow.eclipse.metrics.calculators.EfferentCouplingsCalculator;
12  import com.stateofflow.eclipse.metrics.calculators.NumberOfFieldsCalculator;
13  import com.stateofflow.eclipse.metrics.calculators.levels.NumberOfLevelsCalculator;
14  import com.stateofflow.eclipse.metrics.calculators.localsinscope.NumberOfLocalsInScopeCalculator;
15  import com.stateofflow.eclipse.metrics.calculators.statements.NumberOfStatementsCalculator;
16  
17  public final class MiscellaneousTabBuilder extends TabBuilder {
18      public MiscellaneousTabBuilder(final Collection<FieldEditor> fieldEditors, final IPreferenceStore preferenceStore) {
19          super(fieldEditors, preferenceStore);
20      }
21  
22      @Override
23      public void create(final TabFolder folder) {
24          final Composite root = createCompositeForTabItem(folder, "Miscellaneous", "Simple Metrics");
25          final Group group = createGroupForPreferredUpperBounds(root);
26  
27          addEnableMetricFields(group, EfferentCouplingsCalculator.METRIC_ID, "Efferent Coupling");
28          addEnableMetricFields(group, NumberOfFieldsCalculator.METRIC_ID, "Number Of Fields");
29          addEnableMetricFields(group, NumberOfLevelsCalculator.METRIC_ID, "Number Of Levels");
30          addEnableMetricFields(group, NumberOfLocalsInScopeCalculator.METRIC_ID, "Number Of Locals In Scope");
31          addEnableMetricFields(group, NumberOfStatementsCalculator.METRIC_ID, "Number Of Statements");
32      }
33  }
34