List of usage examples for org.eclipse.jface.dialogs ControlEnableState disable
public static ControlEnableState disable(Control w)
From source file:ca.ecliptical.pde.internal.ds.DSAnnotationPropertyPage.java
License:Open Source License
private void enablePreferenceContent(boolean enable) { if (enable) { if (configBlockEnableState != null) { configBlockEnableState.restore(); configBlockEnableState = null; }//from ww w.jav a2 s . c o m } else { if (configBlockEnableState == null) { configBlockEnableState = ControlEnableState.disable(configBlockControl); } } }
From source file:com.aptana.formatter.ui.preferences.PropertyAndPreferencePage.java
License:Open Source License
protected void enablePreferenceContent(boolean enable) { if (enable) { if (fBlockEnableState != null) { fBlockEnableState.restore(); fBlockEnableState = null;/*from w ww . j a v a2 s .com*/ } } else { if (fBlockEnableState == null) { fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl); } } }
From source file:com.aptana.ide.ui.editors.preferences.formatter.PropertyAndPreferencePage.java
License:Open Source License
/** * @param enable// ww w . j a v a 2 s. c o m */ protected void enablePreferenceContent(boolean enable) { if (enable) { if (fBlockEnableState != null) { fBlockEnableState.restore(); fBlockEnableState = null; } } else { if (fBlockEnableState == null) { fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl); } } }
From source file:com.codesourcery.internal.installer.ui.WizardDialog.java
License:Open Source License
/** * Captures and returns the enabled/disabled state of the wizard dialog's * buttons and the tree of controls for the currently showing page. All * these controls are disabled in the process, with the possible exception * of the Cancel button.//from ww w . j a v a2 s . c o m * * @param keepCancelEnabled * <code>true</code> if the Cancel button should remain * enabled, and <code>false</code> if it should be disabled * @return a map containing the saved state suitable for restoring later * with <code>restoreUIState</code> * @see #restoreUIState */ private Map saveUIState(boolean keepCancelEnabled) { Map savedState = new HashMap(10); saveEnableStateAndSet(backButton, savedState, "back", false); //$NON-NLS-1$ saveEnableStateAndSet(nextButton, savedState, "next", false); //$NON-NLS-1$ saveEnableStateAndSet(finishButton, savedState, "finish", false); //$NON-NLS-1$ saveEnableStateAndSet(cancelButton, savedState, "cancel", keepCancelEnabled); //$NON-NLS-1$ saveEnableStateAndSet(helpButton, savedState, "help", false); //$NON-NLS-1$ if (currentPage != null) { savedState.put("page", ControlEnableState.disable(currentPage.getControl())); //$NON-NLS-1$ } return savedState; }
From source file:com.fiorano.services.feeder.cps.ConfigPage.java
License:Open Source License
private void doSelection(Button button) { if (button.getSelection()) { if (Messages_Feeder.ConfigPage_11.equals(button.getText())) { setDescription(Messages_Feeder.ConfigPage_3); if (!(Messages_Feeder.ConfigPage_11.equals(lastSelection))) { lastSelection = Messages_Feeder.ConfigPage_11; if (enableState != null) enableState.restore(); }//from ww w.j a va 2 s . c o m configuration.setMessageFormat(FeederPM.XML); ESBRecordDefinition recDef = controller.getSchemaDefinition(); if (recDef != null) { configuration.setSchema(recDef); } } else if (Messages_Feeder.ConfigPage_12.equals(button.getText())) { setDescription(null); if (!(Messages_Feeder.ConfigPage_12).equals(lastSelection)) { lastSelection = Messages_Feeder.ConfigPage_12; if (schemaControl != null) enableState = ControlEnableState.disable(schemaControl); } configuration.setMessageFormat(FeederPM.TEXT); } } }
From source file:com.google.dart.tools.search.internal.ui.util.ExtendedDialogWindow.java
License:Open Source License
private HashMap<Object, Object> saveUIState(boolean keepCancelEnabled) { HashMap<Object, Object> savedState = new HashMap<Object, Object>(10); saveEnableStateAndSet(fCancelButton, savedState, keepCancelEnabled); for (Iterator<Button> actionButtons = fActionButtons.iterator(); actionButtons.hasNext();) { Button button = actionButtons.next(); saveEnableStateAndSet(button, savedState, false); }/*ww w. java 2s. c o m*/ savedState.put("tabForm", ControlEnableState.disable(fContents)); //$NON-NLS-1$ return savedState; }
From source file:com.google.dart.tools.ui.internal.text.editor.saveparticipant.AbstractSaveParticipantPreferenceConfiguration.java
License:Open Source License
/** * {@inheritDoc}/*from w w w. j a v a 2 s . c o m*/ */ @Override public void initialize(final IScopeContext context, IAdaptable element) { boolean enabled = isEnabled(context); fEnableField.setSelection(enabled); if (fConfigControl != null && !enabled) { fConfigControlEnabledState = ControlEnableState.disable(fConfigControl); } fEnableField.setDialogFieldListener(new IDialogFieldListener() { @Override public void dialogFieldChanged(DialogField field) { enableConfigControl(fEnableField.isSelected()); } }); fContext = context; }
From source file:com.google.dart.tools.ui.internal.text.editor.saveparticipant.AbstractSaveParticipantPreferenceConfiguration.java
License:Open Source License
protected void enableConfigControl(boolean isEnabled) { fContext.getNode(DartUI.ID_PLUGIN).putBoolean(getPreferenceKey(), isEnabled); if (fConfigControl != null) { if (fConfigControlEnabledState != null) { fConfigControlEnabledState.restore(); fConfigControlEnabledState = null; } else {/*from ww w. j ava2 s. c o m*/ fConfigControlEnabledState = ControlEnableState.disable(fConfigControl); } } }
From source file:com.google.dart.tools.ui.internal.text.editor.saveparticipant.CleanUpSaveParticipantPreferenceConfiguration.java
License:Open Source License
/** * {@inheritDoc}/*from w ww.java2 s .c o m*/ */ @Override protected void enabled(boolean isEnabled) { if (isEnabled) { if (fControlEnableState == null) { return; } fControlEnableState.restore(); fControlEnableState = null; } else { if (fControlEnableState != null) { return; } fControlEnableState = ControlEnableState.disable(fCleanUpOptionsComposite); } }
From source file:com.liferay.ide.project.ui.pref.PropertyPreferencePage.java
License:Open Source License
/** * Controls the enablement of the common content region * of a property or preference page/*w w w . ja va2 s. c o m*/ * * @param enable the enabled state of the common content * area */ protected void enablePreferenceContent(boolean enable) { if (enable) { if (Enablements != null) { Enablements.restore(); Enablements = null; } } else { if (Enablements == null) Enablements = ControlEnableState.disable(Common); } }