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.NumberOfParametersCalculator;
12
13 public class NumberOfParametersTabBuilder extends TabBuilder {
14 public NumberOfParametersTabBuilder(final Collection<FieldEditor> fieldEditors, final IPreferenceStore preferenceStore) {
15 super(fieldEditors, preferenceStore);
16 }
17
18 private void addOptionsGroup(final Composite root) {
19 final Group group = createGroup(root, "Options", 1);
20 addBooleanEditor(group, NumberOfParametersCalculator.INCLUDE_METHODS_DECLARED_IN_SUPERTYPE_KEY, "Include methods declared in supertype");
21 }
22
23 private void addUpperBoundsGroup(final Composite root) {
24 final Group group = createGroupForPreferredUpperBounds(root);
25 addEnableMetricFields(group, NumberOfParametersCalculator.METRIC_ID, "Number of Parameters");
26 }
27
28 @Override
29 public void create(final TabFolder folder) {
30 final Composite root = createCompositeForTabItem(folder, "NoP", "Number of Parameters Metrics");
31 addUpperBoundsGroup(root);
32 addOptionsGroup(root);
33 }
34 }
35