private Composite createCodeMiningContent(Composite parent) { // Create filtered tree which contains code minings fFilteredPrefTree= new PreferenceTree(this, parent, PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_common_description, false); final ScrolledPageContent sc1= fFilteredPrefTree.getScrolledPageContent(); int nColumns= 1; Composite composite= sc1.getBody(); GridLayout layout= new GridLayout(nColumns, false); layout.marginHeight= 0; layout.marginWidth= 0; composite.setLayout(layout); // --- General createGeneralSection(nColumns, composite); IDialogSettings settingsSection= JavaPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME); restoreSectionExpansionStates(settingsSection); return sc1; }
public PreferenceTreeNode<Text> addTextField(Composite parentComposite, String label, Key key, int indent, int widthHint, PreferenceTreeNode<?> parentNode) { Text textField= fConfigBlock.addTextField(parentComposite, label, key, indent, widthHint); PreferenceTreeNode<Text> node= addChild(parentNode, new PreferenceTreeNode<>(label, textField, true, TEXT_VALUE_MATCHER)); addChild(node, new PreferenceTreeNode<>(label, fConfigBlock.fLabels.get(textField), true)); return node; }
fFilteredPrefTree.setEnabled(codeMiningEnabledCheckBox.getSelection()); validateSettings(null, null, null); return mainComp;
fFilteredPrefTree= new PreferenceTree(this, folder, PreferencesMessages.ProblemSeveritiesConfigurationBlock_common_description); final ScrolledPageContent sc1= fFilteredPrefTree.getScrolledPageContent(); section= fFilteredPrefTree.addExpandableComposite(composite, label, nColumns, twistieKey, null, false); excomposite= getExpandableComposite(twistieKey); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_STATIC_ACCESS_RECEIVER, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_INDIRECT_STATIC_ACCESS, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_UNQUALIFIED_FIELD_ACCESS, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_PARAMETER_ASSIGNMENT, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_UNDOCUMENTED_EMPTY_BLOCK, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_MISSING_STATIC_ON_METHOD, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); fFilteredPrefTree.addComboBox(inner, label, PREF_PB_POTENTIALLY_MISSING_STATIC_ON_METHOD, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, defaultIndent, section); section= fFilteredPrefTree.addExpandableComposite(composite, label, nColumns, twistieKey, null, false);
String label = MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_general; Key twistieKey = OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_general"); //$NON-NLS-1$ PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey, null, false); ExpandableComposite excomposite = getExpandableComposite(twistieKey); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_label, PREF_SHOW_REFERENCES, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferencesClass_label, PREF_SHOW_CLASS_REFERENCES, TRUE_FALSE, extraIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferencesMethod_label, PREF_SHOW_METHOD_REFERENCES, TRUE_FALSE, extraIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_atLeastOne_label, PREF_SHOW_REFERENCES_AT_LEAST_ONE, TRUE_FALSE, extraIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showImplementations_label, PREF_SHOW_IMPLEMENTATIONS, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showImplementations_atLeastOne_label, PREF_SHOW_IMPLEMENTATIONS_AT_LEAST_ONE, TRUE_FALSE, extraIndent, section);
Key twistieKey = OptionsConfigurationBlock .getLocalKey("JavaEditorCodeMiningPreferencePage_section_methodParameter"); //$NON-NLS-1$ PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey, null, false); ExpandableComposite excomposite = getExpandableComposite(twistieKey); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showMethodParameterNames_label, PREF_SHOW_METHOD_PARAMETER_NAMES, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showMethodParameterTypes_label, PREF_SHOW_METHOD_PARAMETER_TYPES, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showMethodParameterOnlyForLiteral_label, PREF_SHOW_METHOD_PARAMETER_ONLY_FOR_LITERAL, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showMethodParameterByUsingFilters_label, PREF_SHOW_METHOD_PARAMETER_BY_USING_FILTERS, TRUE_FALSE, defaultIndent, section);
private void createGeneralSection(int nColumns, Composite parent) { int defaultIndent= 0; int extraIndent= LayoutUtil.getIndent(); String label= PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_general; Key twistieKey= OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_general"); //$NON-NLS-1$ PreferenceTreeNode<?> section= fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey, null, false); ExpandableComposite excomposite= getExpandableComposite(twistieKey); Composite inner= createInnerComposite(excomposite, nColumns, parent.getFont()); // - Show references PreferenceTreeNode<Button> showReferences= fFilteredPrefTree.addCheckBox(inner, PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_label, PREF_SHOW_REFERENCES, TRUE_FALSE, defaultIndent, section); // - Show references (On types) fFilteredPrefTree.addCheckBox(inner, PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_onTypes_label, PREF_SHOW_REFERENCES_ON_TYPES, TRUE_FALSE, extraIndent, showReferences); // - Show references (On fields) fFilteredPrefTree.addCheckBox(inner, PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_onFields_label, PREF_SHOW_REFERENCES_ON_FIELDS, TRUE_FALSE, extraIndent, showReferences); // - Show references (On methods) fFilteredPrefTree.addCheckBox(inner, PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showReferences_onMethods_label, PREF_SHOW_REFERENCES_ON_METHODS, TRUE_FALSE, extraIndent, showReferences); // - Show implementations fFilteredPrefTree.addCheckBox(inner, PreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showImplementations_label, PREF_SHOW_IMPLEMENTATIONS, TRUE_FALSE, defaultIndent, section); }
String label = MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_scsm; Key twistieKey = OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_sccm"); //$NON-NLS-1$ PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey, null, false); ExpandableComposite excomposite = getExpandableComposite(twistieKey); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionRecentChange, PREF_SHOW_REVISION_RECENT_CHANGE, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionRecentChangeWithAvatar, PREF_SHOW_REVISION_RECENT_CHANGE_WITH_AVATAR, TRUE_FALSE, extraIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionRecentChangeWithDate, PREF_SHOW_REVISION_RECENT_CHANGE_WITH_DATE, TRUE_FALSE, extraIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showRevisionAuthors, PREF_SHOW_REVISION_AUTHORS, TRUE_FALSE, defaultIndent, section);
private void createJUnitSection(int nColumns, Composite parent) { final int defaultIndent = 0; String label = MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_junit; Key twistieKey = OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_junit"); //$NON-NLS-1$ PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey, null, false); ExpandableComposite excomposite = getExpandableComposite(twistieKey); Composite inner = createInnerComposite(excomposite, nColumns, parent.getFont()); // - Show JUnit status fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showJUnitStatus_label, PREF_SHOW_JUNIT_STATUS, TRUE_FALSE, defaultIndent, section); // - Show JUnit run fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showJUnitRun_label, PREF_SHOW_JUNIT_RUN, TRUE_FALSE, defaultIndent, section); // - Show JUnit debug fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showJUnitDebug_label, PREF_SHOW_JUNIT_DEBUG, TRUE_FALSE, defaultIndent, section); }
private void createDebuggingSection(int nColumns, Composite parent) { final int defaultIndent = 0; String label = MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_section_debugging; Key twistieKey = OptionsConfigurationBlock.getLocalKey("JavaEditorCodeMiningPreferencePage_section_debugging"); //$NON-NLS-1$ PreferenceTreeNode<?> section = fFilteredPrefTree.addExpandableComposite(parent, label, nColumns, twistieKey, null, false); ExpandableComposite excomposite = getExpandableComposite(twistieKey); Composite inner = createInnerComposite(excomposite, nColumns, parent.getFont()); // - Show main run/debug fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showMainRun_label, PREF_SHOW_MAIN_RUN, TRUE_FALSE, defaultIndent, section); fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showMainDebug_label, PREF_SHOW_MAIN_DEBUG, TRUE_FALSE, defaultIndent, section); // - Show variable value while debugging fFilteredPrefTree.addCheckBox(inner, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_showVariableValueWhileDebugging_label, PREF_SHOW_VARIABLE_VALUE_WHILE_DEBUGGING, TRUE_FALSE, defaultIndent, section); }
private Composite createStyleTabContent(Composite folder) { fFilteredPrefTree = new PreferenceTree(this, folder, MyPreferencesMessages.JavaEditorCodeMiningConfigurationBlock_common_description); final ScrolledPageContent sc1 = fFilteredPrefTree.getScrolledPageContent(); int nColumns = 3; Composite composite = sc1.getBody(); GridLayout layout = new GridLayout(nColumns, false); layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); // --- General createGeneralSection(nColumns, composite); // --- Method parameter createMethodParameterSection(nColumns, composite); // --- JUnit createJUnitSection(nColumns, composite); // --- Debugging createDebuggingSection(nColumns, composite); // --- Git createGitSection(nColumns, composite); IDialogSettings settingsSection = JavaPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME); restoreSectionExpansionStates(settingsSection); return sc1; }
private void updateEnableStates() { boolean enabledCodeMining= getCheckBox(PREF_CODEMINING_ENABLED).getSelection(); if (enabledCodeMining) { // Show references checkboxes boolean showReferences= getCheckBox(PREF_SHOW_REFERENCES).getSelection(); getCheckBox(PREF_SHOW_REFERENCES_ON_TYPES).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_FIELDS).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_METHODS).setEnabled(showReferences); // Show implementations checkboxes getCheckBox(PREF_SHOW_IMPLEMENTATIONS).getSelection(); } else { atLeastOneCheckBox.setEnabled(false); fFilteredPrefTree.setEnabled(false); } }
public PreferenceTreeNode<ExpandableComposite> addExpandableComposite(Composite parentComposite, String label, int nColumns, Key key, PreferenceTreeNode<?> parentNode, boolean showAllChildren) { ExpandableComposite expandableComposite= fConfigBlock.createStyleSection(parentComposite, label, nColumns, key); return addChild(parentNode, new PreferenceTreeNode<>(label, expandableComposite, showAllChildren)); }
public PreferenceTreeNode<Button> addCheckBox(Composite parentComposite, String label, Key key, String[] values, int indent, PreferenceTreeNode<?> parentNode) { Button checkBox= fConfigBlock.addCheckBox(parentComposite, label, key, values, indent); return addChild(parentNode, new PreferenceTreeNode<>(label, checkBox, true, CHECK_BOX_MATCHER)); }
public PreferenceTreeNode<Link> addLink(Composite parentComposite, String label, Key key, SelectionListener linkListener, int indent, int widthHint, PreferenceTreeNode<?> parentNode) { Link link= fConfigBlock.addLink(parentComposite, label, key, linkListener, indent, widthHint); return addChild(parentNode, new PreferenceTreeNode<>(label, link, false)); } }
public PreferenceTreeNode<Button> addCheckBoxWithLink(Composite parentComposite, String label, Key key, String[] values, int indent, PreferenceTreeNode<?> parentNode, int widthHint, SelectionListener listener) { Button checkBox= fConfigBlock.addCheckBoxWithLink(parentComposite, label, key, values, indent, widthHint, listener); PreferenceTreeNode<Button> node= addChild(parentNode, new PreferenceTreeNode<>(label, checkBox, true, CHECK_BOX_MATCHER)); addChild(node, new PreferenceTreeNode<>(label, fConfigBlock.getLink(key), true)); return node; }
public PreferenceTreeNode<Combo> addComboBox(Composite parentComposite, String label, Key key, String[] values, String[] valueLabels, int indent, PreferenceTreeNode<?> parentNode) { Combo comboBox= fConfigBlock.addComboBox(parentComposite, label, key, values, valueLabels, indent); PreferenceTreeNode<Combo> node= addChild(parentNode, new PreferenceTreeNode<>(label, comboBox, true, COMBO_VALUE_MATCHER)); addChild(node, new PreferenceTreeNode<>(label, fConfigBlock.fLabels.get(comboBox), true)); return node; }
@Override public void widgetSelected(SelectionEvent e) { atLeastOneCheckBox.setEnabled(codeMiningEnabledCheckBox.getSelection()); fFilteredPrefTree.setEnabled(codeMiningEnabledCheckBox.getSelection()); updateEnableStates(); } });