Java源码示例:org.eclipse.jface.dialogs.ControlEnableState
示例1
protected void enablePreferenceContent(boolean enable)
{
if (enable)
{
if (fBlockEnableState != null)
{
fBlockEnableState.restore();
fBlockEnableState = null;
}
}
else
{
if (fBlockEnableState == null)
{
fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl);
}
}
}
示例2
protected void enablePreferenceContent(boolean enable)
{
if (enable)
{
if (fBlockEnableState != null)
{
fBlockEnableState.restore();
fBlockEnableState = null;
}
}
else
{
if (fBlockEnableState == null)
{
fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl);
}
}
}
示例3
/**
* {@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);
}
}
示例4
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 );
}
}
}
示例5
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 );
}
}
}
示例6
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 );
}
}
}
示例7
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 );
}
}
}
示例8
protected void enablePreferenceContent( boolean enable )
{
if ( enable )
{
if ( fBlockEnableState != null )
{
fBlockEnableState.restore( );
fBlockEnableState = null;
}
}
else
{
if ( fBlockEnableState == null )
{
fBlockEnableState = ControlEnableState.disable( fConfigurationBlockControl );
}
}
}
示例9
/** 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);
}
}
}
示例10
protected void enablePreferenceContent(boolean enable) {
if (enable) {
if (blockEnableState != null) {
blockEnableState.restore();
blockEnableState = null;
}
} else {
if (blockEnableState == null) {
blockEnableState = ControlEnableState.disable(configurationBlockControl);
}
}
}
示例11
protected void enablePreferenceContent(boolean enable) {
if (enable) {
if (fBlockEnableState != null) {
fBlockEnableState.restore();
fBlockEnableState = null;
}
} else {
if (fBlockEnableState == null) {
fBlockEnableState = ControlEnableState.disable(fConfigurationBlockControl);
}
}
}
示例12
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);
}
}
}
}
示例13
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);
}
}
}
}
示例14
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);
}
}
}
}
示例15
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);
}
}
}
}
示例16
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);
}
}
}
}
示例17
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);
}
}
}
}
示例18
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);
}
}
}
}
示例19
@Override
protected void reconcileControls() {
if (saveActionsButton.getSelection()) {
if (saveActionsContainerEnableState != null) {
saveActionsContainerEnableState.restore();
saveActionsContainerEnableState = null;
}
} else {
if (saveActionsContainerEnableState == null) {
saveActionsContainerEnableState = ControlEnableState.disable(saveActionsContainer);
}
}
}
示例20
protected void enableTslintContent(boolean enable) {
if (enable) {
if (fBlockEnableState != null) {
fBlockEnableState.restore();
fBlockEnableState = null;
}
} else {
if (fBlockEnableState == null) {
fBlockEnableState = ControlEnableState.disable(controlsComposite);
}
}
}
示例21
protected void enableConfigControls(boolean enable) {
if (enable) {
if (fBlockEnableState != null) {
fBlockEnableState.restore();
fBlockEnableState= null;
}
} else {
if (fBlockEnableState == null) {
fBlockEnableState= ControlEnableState.disable(fJavadocComposite);
}
}
}
示例22
protected void enablePreferenceContent(boolean enable) {
if (enable) {
if (fBlockEnableState != null) {
fBlockEnableState.restore();
fBlockEnableState= null;
}
} else {
if (fBlockEnableState == null) {
fBlockEnableState= ControlEnableState.disable(fConfigurationBlockControl);
}
}
}
示例23
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);
}
}
}
}
示例24
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);
}
示例25
/**
* 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();
}
}
示例26
/**
* 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;
}
示例27
/**
* 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();
}
}
示例28
/**
* 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;
}