public void dispose() { for (Iterator it= fImages.values().iterator(); it.hasNext();) { Image image= (Image) it.next(); image.dispose(); } super.dispose(); }
public boolean performApply() { return processChanges(null); // apply directly }
public void performDefaults() { for (int i= 0; i < fAllKeys.length; i++) { Key curr= fAllKeys[i]; String defValue= curr.getStoredValue(fLookupOrder, true, fManager); setValue(curr, defValue); } settingsUpdated(); updateControls(); validateSettings(null, null, null); }
/** * @since 3.1 */ public void performRevert() { revertValues(fAllKeys); settingsUpdated(); updateControls(); validateSettings(null, null, null); }
protected Control findControl(Key key) { Combo comboBox= getComboBox(key); if (comboBox != null) { return comboBox; } Button checkBox= getCheckBox(key); if (checkBox != null) { return checkBox; } Text text= getTextControl(key); if (text != null) { return text; } return null; }
boolean needsBuild= getChanges(currContext, changedOptions); if (changedOptions.isEmpty()) { return true; int count= getRebuildCount(); if (count > fRebuildCount) { needsBuild= false; // build already requested String[] strings= getFullBuildDialogStrings(fProject == null); if (strings != null) { MessageDialog dialog= new MessageDialog(getShell(), strings[0], null, strings[1], MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2); int res= dialog.open(); if (res == 0) { incrementRebuildCount(); container.registerUpdateJob(CoreUtility.getBuildJob(fProject));
protected Control findControl(Key key) { Combo comboBox= getComboBox(key); if (comboBox != null) { return comboBox; } Button checkBox= getCheckBox(key); if (checkBox != null) { return checkBox; } Text text= getTextControl(key); if (text != null) { return text; } Link link= getLink(key); if (link != null) { return link; } return null; }
public void selectOption(Key key) { Control control= findControl(key); if (control != null) { if (!fExpandableComposites.isEmpty()) { ExpandableComposite expandable= getParentExpandableComposite(control); if (expandable != null) { for (int i= 0; i < fExpandableComposites.size(); i++) { ExpandableComposite curr= fExpandableComposites.get(i); curr.setExpanded(curr == expandable); } expandedStateChanged(expandable); } } control.setFocus(); } }
public void useProjectSpecificSettings(boolean enable) { boolean hasProjectSpecificOption= fDisabledProjectSettings == null; if (enable != hasProjectSpecificOption && fProject != null) { if (enable) { for (int i= 0; i < fAllKeys.length; i++) { Key curr= fAllKeys[i]; String val= (String) fDisabledProjectSettings.get(curr); curr.setStoredValue(fLookupOrder[0], val, fManager); } fDisabledProjectSettings= null; updateControls(); validateSettings(null, null, null); } else { fDisabledProjectSettings= new IdentityHashMap(); for (int i= 0; i < fAllKeys.length; i++) { Key curr= fAllKeys[i]; String oldSetting= curr.getStoredValue(fLookupOrder, false, fManager); fDisabledProjectSettings.put(curr, oldSetting); curr.setStoredValue(fLookupOrder[0], null, fManager); // clear project settings } } } }
@Override protected void updateControls() { fJavaMethodFiltersTable.refresh(getValue(PREF_SHOW_METHOD_PARAMETER_FILTERS_ENABLED), getValue(PREF_SHOW_METHOD_PARAMETER_FILTERS_DISABLED)); super.updateControls(); } }
@Override public void widgetSelected(SelectionEvent e) { controlChanged(e.widget); } };
private boolean match(PreferenceTreeNode node, StringMatcher labelMatcher, StringMatcher valueMatcher) { if (node.getKey() == null) { return false; } boolean valueMatched= true; boolean labelMatched= true; if (labelMatcher != null) { labelMatched= labelMatcher.match(node.getLabel()); } if (valueMatcher != null) { if (node.getControlType() == PreferenceTreeNode.COMBO) { valueMatched= valueMatcher.match(fConfigBlock.getComboBox(node.getKey()).getText()); } else if (node.getControlType() == PreferenceTreeNode.CHECKBOX) { boolean checked= fConfigBlock.getCheckBox(node.getKey()).getSelection(); if (checked) { valueMatched= valueMatcher.match(PreferencesMessages.OptionsConfigurationBlock_On) || valueMatcher.match(PreferencesMessages.OptionsConfigurationBlock_Enabled); } else { valueMatched= valueMatcher.match(PreferencesMessages.OptionsConfigurationBlock_Off) || valueMatcher.match(PreferencesMessages.OptionsConfigurationBlock_Disabled); } } } return labelMatched && valueMatched; }
@Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } });
protected void setComboEnabled(Key key, boolean enabled) { Combo combo= getComboBox(key); Label label= fLabels.get(combo); combo.setEnabled(enabled); label.setEnabled(enabled); if (!enabled) { highlight(combo.getParent(), label, combo, HIGHLIGHT_NONE); } }
protected void setComboEnabled(Key key, boolean enabled) { Combo combo= getComboBox(key); Label label= fLabels.get(combo); combo.setEnabled(enabled); label.setEnabled(enabled); }
boolean needsBuild= getChanges(currContext, changedOptions); if (changedOptions.isEmpty()) { return true; int count= getRebuildCount(); if (count > fRebuildCount) { needsBuild= false; // build already requested String[] strings= getFullBuildDialogStrings(fProject == null); if (strings != null) { if (ResourcesPlugin.getWorkspace().getRoot().getProjects().length == 0) { doBuild= true; // don't bother the user } else { MessageDialog dialog= new MessageDialog(getShell(), strings[0], null, strings[1], MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2); int res= dialog.open(); if (res == 0) { incrementRebuildCount(); container.registerUpdateJob(CoreUtility.getBuildJob(fProject));
protected Control findControl(Key key) { Combo comboBox= getComboBox(key); if (comboBox != null) { return comboBox; } Button checkBox= getCheckBox(key); if (checkBox != null) { return checkBox; } Text text= getTextControl(key); if (text != null) { return text; } Link link= getLink(key); if (link != null) { return link; } return null; }
/** * @since 3.1 */ public void performRevert() { revertValues(fAllKeys); settingsUpdated(); updateControls(); validateSettings(null, null, null); }
public void selectOption(Key key) { Control control= findControl(key); if (control != null) { if (!fExpandedComposites.isEmpty()) { ExpandableComposite expandable= getParentExpandableComposite(control); if (expandable != null) { for (int i= 0; i < fExpandedComposites.size(); i++) { ExpandableComposite curr= (ExpandableComposite) fExpandedComposites.get(i); curr.setExpanded(curr == expandable); } expandedStateChanged(expandable); } } control.setFocus(); } }
public void useProjectSpecificSettings(boolean enable) { boolean hasProjectSpecificOption= fDisabledProjectSettings == null; if (enable != hasProjectSpecificOption && fProject != null) { if (enable) { for (int i= 0; i < fAllKeys.length; i++) { Key curr= fAllKeys[i]; String val= fDisabledProjectSettings.get(curr); curr.setStoredValue(fLookupOrder[0], val, fManager); } fDisabledProjectSettings= null; updateControls(); validateSettings(null, null, null); } else { fDisabledProjectSettings= new IdentityHashMap<>(); for (int i= 0; i < fAllKeys.length; i++) { Key curr= fAllKeys[i]; String oldSetting= curr.getStoredValue(fLookupOrder, false, fManager); fDisabledProjectSettings.put(curr, oldSetting); curr.setStoredValue(fLookupOrder[0], null, fManager); // clear project settings } } } }