org.eclipse.jface.dialogs.ControlEnableState Java Examples

The following examples show how to use org.eclipse.jface.dialogs.ControlEnableState. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PropertyAndPreferencePage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void enablePreferenceContent( boolean enable )
{
	if ( enable )
	{
		if ( fBlockEnableState != null )
		{
			fBlockEnableState.restore( );
			fBlockEnableState = null;
		}
	}
	else
	{
		if ( fBlockEnableState == null )
		{
			fBlockEnableState = ControlEnableState.disable( fConfigurationBlockControl );
		}
	}
}
 
Example #2
Source File: OptionsConfigurationBlock.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateText( Text curr )
{
	Key key = (Key) curr.getData( );

	String currValue = getValue( key );
	if ( currValue != null )
	{
		curr.setText( currValue );
	}

	if ( fProject != null )
	{
		if ( ignoreKeys != null
				&& Arrays.asList( ignoreKeys ).contains( key ) )
		{
			ControlEnableState.disable( curr );
			Control label = (Control) fLabels.get( curr );
			if ( label != null )
				ControlEnableState.disable( label );
		}
	}
}
 
Example #3
Source File: OptionsConfigurationBlock.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateRadioComposite( RadioComposite curr )
{
	ControlData data = (ControlData) curr.getData( );

	String currValue = getValue( data.getKey( ) );
	curr.setSelection( data.getSelection( currValue ) );

	if ( fProject != null )
	{
		if ( ignoreKeys != null
				&& Arrays.asList( ignoreKeys ).contains( data.getKey( ) ) )
		{
			ControlEnableState.disable( curr );
		}
	}
}
 
Example #4
Source File: OptionsConfigurationBlock.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateCheckBox( Button curr )
{
	ControlData data = (ControlData) curr.getData( );

	String currValue = getValue( data.getKey( ) );
	curr.setSelection( data.getSelection( currValue ) == 0 );

	if ( fProject != null )
	{
		if ( ignoreKeys != null
				&& Arrays.asList( ignoreKeys ).contains( data.getKey( ) ) )
		{
			ControlEnableState.disable( curr );
		}
	}
}
 
Example #5
Source File: OptionsConfigurationBlock.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateCombo( Combo curr )
{
	ControlData data = (ControlData) curr.getData( );

	String currValue = getValue( data.getKey( ) );
	curr.select( data.getSelection( currValue ) );

	if ( fProject != null )
	{
		if ( ignoreKeys != null
				&& Arrays.asList( ignoreKeys ).contains( data.getKey( ) ) )
		{
			ControlEnableState.disable( curr );
			Control label = (Control) fLabels.get( curr );
			if ( label != null )
				ControlEnableState.disable( label );
		}
	}
}
 
Example #6
Source File: CleanUpSaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@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);
	}
}
 
Example #7
Source File: PropertyAndPreferenceFieldEditorPage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
protected void enablePreferenceContent(boolean enable)
{
	if (enable)
	{
		if (fBlockEnableState != null)
		{
			fBlockEnableState.restore();
			fBlockEnableState = null;
		}
	}
	else
	{
		if (fBlockEnableState == null)
		{
			fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl);
		}
	}
}
 
Example #8
Source File: PropertyAndPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
protected void enablePreferenceContent(boolean enable)
{
	if (enable)
	{
		if (fBlockEnableState != null)
		{
			fBlockEnableState.restore();
			fBlockEnableState = null;
		}
	}
	else
	{
		if (fBlockEnableState == null)
		{
			fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl);
		}
	}
}
 
Example #9
Source File: JavadocProblemsConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void enableConfigControls(boolean enable) {
	if (enable) {
		if (fBlockEnableState != null) {
			fBlockEnableState.restore();
			fBlockEnableState= null;
		}
	} else {
		if (fBlockEnableState == null) {
			fBlockEnableState= ControlEnableState.disable(fJavadocComposite);
		}
	}
}
 
Example #10
Source File: TSWizardDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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.
 * 
 * @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;
}
 
Example #11
Source File: TSWizardDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Restores the enabled/disabled state of the wizard dialog's buttons and
 * the tree of controls for the currently showing page.
 * 
 * @param state
 *            a map containing the saved state as returned by
 *            <code>saveUIState</code>
 * @see #saveUIState
 */
private void restoreUIState(Map state) {
	restoreEnableState(backButton, state, "back"); //$NON-NLS-1$
	restoreEnableState(nextButton, state, "next"); //$NON-NLS-1$
	restoreEnableState(finishButton, state, "finish"); //$NON-NLS-1$
	restoreEnableState(cancelButton, state, "cancel"); //$NON-NLS-1$
	restoreEnableState(helpButton, state, "help"); //$NON-NLS-1$
	Object pageValue = state.get("page"); //$NON-NLS-1$
	if (pageValue != null) {
		((ControlEnableState) pageValue).restore();
	}
}
 
Example #12
Source File: TSWizardDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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.
 * 
 * @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;
}
 
Example #13
Source File: TSWizardDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Restores the enabled/disabled state of the wizard dialog's buttons and
 * the tree of controls for the currently showing page.
 * 
 * @param state
 *            a map containing the saved state as returned by
 *            <code>saveUIState</code>
 * @see #saveUIState
 */
private void restoreUIState(Map state) {
	restoreEnableState(backButton, state, "back"); //$NON-NLS-1$
	restoreEnableState(nextButton, state, "next"); //$NON-NLS-1$
	restoreEnableState(finishButton, state, "finish"); //$NON-NLS-1$
	restoreEnableState(cancelButton, state, "cancel"); //$NON-NLS-1$
	restoreEnableState(helpButton, state, "help"); //$NON-NLS-1$
	Object pageValue = state.get("page"); //$NON-NLS-1$
	if (pageValue != null) {
		((ControlEnableState) pageValue).restore();
	}
}
 
Example #14
Source File: CleanUpRefactoringWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void updateEnableState(boolean isCustom, final ListDialogField<IJavaProject> settingsField, Button configureCustom, BulletListBlock bulletListBlock) {
	settingsField.getListControl(null).setEnabled(!isCustom);
	if (isCustom) {
		fEnableState= ControlEnableState.disable(settingsField.getButtonBox(null));
	} else if (fEnableState != null) {
		fEnableState.restore();
		fEnableState= null;
	}
	bulletListBlock.setEnabled(isCustom);
	configureCustom.setEnabled(isCustom);
}
 
Example #15
Source File: ComplianceConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (fControlsComposite != null && !fControlsComposite.isDisposed()) {
		if (enable) {
			if (fBlockEnableState != null) {
				fBlockEnableState.restore();
				fBlockEnableState= null;
			}
		} else {
			if (fBlockEnableState == null) {
				fBlockEnableState= ControlEnableState.disable(fControlsComposite);
			}
		}
	}
}
 
Example #16
Source File: PropertyAndPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void enablePreferenceContent(boolean enable) {
	if (enable) {
		if (fBlockEnableState != null) {
			fBlockEnableState.restore();
			fBlockEnableState= null;
		}
	} else {
		if (fBlockEnableState == null) {
			fBlockEnableState= ControlEnableState.disable(fConfigurationBlockControl);
		}
	}
}
 
Example #17
Source File: AbstractN4JSPreferencePage.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/** copied from PropertyAndPreferencePage */
protected void enablePreferenceContent(boolean enable) {
	if (enable) {
		if (blockEnableState != null) {
			blockEnableState.restore();
			blockEnableState = null;
		}
	} else {
		if (blockEnableState == null) {
			blockEnableState = ControlEnableState.disable(configurationBlockControl);
		}
	}
}
 
Example #18
Source File: TSLintWizardPage.java    From typescript.java with MIT License 5 votes vote down vote up
protected void enableTslintContent(boolean enable) {
	if (enable) {
		if (fBlockEnableState != null) {
			fBlockEnableState.restore();
			fBlockEnableState = null;
		}
	} else {
		if (fBlockEnableState == null) {
			fBlockEnableState = ControlEnableState.disable(controlsComposite);
		}
	}
}
 
Example #19
Source File: SaveActionsConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
@Override
protected void reconcileControls() {
	if (saveActionsButton.getSelection()) {
		if (saveActionsContainerEnableState != null) {
			saveActionsContainerEnableState.restore();
			saveActionsContainerEnableState = null;
		}
	} else {
		if (saveActionsContainerEnableState == null) {
			saveActionsContainerEnableState = ControlEnableState.disable(saveActionsContainer);
		}
	}
}
 
Example #20
Source File: SaveActionsConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #21
Source File: NodejsConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #22
Source File: FormatterConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #23
Source File: CodeLensConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #24
Source File: TextMateConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #25
Source File: AbstractTypeScriptRepositoryConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #26
Source File: ATAConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
public void enablePreferenceContent(boolean enable) {
	if (controlsComposite != null && !controlsComposite.isDisposed()) {
		if (enable) {
			if (blockEnableState != null) {
				blockEnableState.restore();
				blockEnableState = null;
			}
		} else {
			if (blockEnableState == null) {
				blockEnableState = ControlEnableState.disable(controlsComposite);
			}
		}
	}
}
 
Example #27
Source File: PropertyAndPreferencePage.java    From typescript.java with MIT License 5 votes vote down vote up
protected void enablePreferenceContent(boolean enable) {
	if (enable) {
		if (fBlockEnableState != null) {
			fBlockEnableState.restore();
			fBlockEnableState = null;
		}
	} else {
		if (fBlockEnableState == null) {
			fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl);
		}
	}
}
 
Example #28
Source File: PropertyAndPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected void enablePreferenceContent(boolean enable) {
	if (enable) {
		if (blockEnableState != null) {
			blockEnableState.restore();
			blockEnableState = null;
		}
	} else {
		if (blockEnableState == null) {
			blockEnableState = ControlEnableState.disable(configurationBlockControl);
		}
	}
}