Example usage for org.eclipse.jface.preference FieldEditor IS_VALID

List of usage examples for org.eclipse.jface.preference FieldEditor IS_VALID

Introduction

In this page you can find the example usage for org.eclipse.jface.preference FieldEditor IS_VALID.

Prototype

String IS_VALID

To view the source code for org.eclipse.jface.preference FieldEditor IS_VALID.

Click Source Link

Document

Property name constant (value "field_editor_is_valid") to signal a change in the validity of the value of this field editor.

Usage

From source file:com.arc.cdt.debug.seecode.internal.ui.SeeCodePreferencePage.java

License:Open Source License

/**
 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
 *///www .ja v a 2s.  co  m
@Override
public void propertyChange(PropertyChangeEvent event) {
    // If the new value is true then we must check all field editors.
    // If it is false, then the page is invalid in any case.

    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        SCIntegerFieldEditor launchTimeout = getLaunchTimeoutText();
        SCIntegerFieldEditor debugTimeout = getDebugTimeoutText();
        SCIntegerFieldEditor loadTimeout = getLoadTimeoutText();
        if (newValue) {
            if (event.getSource() != launchTimeout) {
                launchTimeout.refreshValidState();
            }
            if (event.getSource() != debugTimeout) {
                debugTimeout.refreshValidState();
            }
            if (event.getSource() != loadTimeout) {
                loadTimeout.refreshValidState();
            }
            if (event.getSource() != fErrorLogLimitText) {

            }
        }
        setValid(launchTimeout.isValid() && debugTimeout.isValid() && loadTimeout.isValid() && checkValues());
        updateLicensingEnablement();
        getContainer().updateButtons();
    } else {
        setValid(checkValues());
    }
}

From source file:com.google.cloud.tools.eclipse.preferences.areas.FieldEditorWrapper.java

License:Apache License

@Override
public Control createContents(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fieldEditor = createFieldEditor(container);
    fieldEditor.setPage(messages);//from  ww w  . j  a va  2s .  c o m
    fieldEditor.setPropertyChangeListener(new IPropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent event) {
            if (FieldEditor.IS_VALID.equals(event.getProperty())) {
                fireValueChanged(IS_VALID, event.getOldValue(), event.getNewValue());
            } else if (FieldEditor.VALUE.equals(event.getProperty())) {
                fireValueChanged(VALUE, event.getOldValue(), event.getNewValue());
            }
        }
    });
    fieldEditor.setPreferenceStore(getPreferenceStore());
    fieldEditor.load();
    fieldEditor.fillIntoGrid(container, fieldEditor.getNumberOfControls());
    return container;
}

From source file:com.iw.plugins.spindle.ui.preferences.SpecFoldingPreferencePage.java

License:Mozilla Public License

public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        // If the new value is true then we must check all field editors.
        // If it is false, then the page is invalid in any case.
        if (newValue) {
            setValid(fFoldOnEditorOpen.isValid());
        } else {/* w w  w.  j ava  2  s .c  o  m*/
            setValid(newValue);
        }
    }
}

From source file:com.iw.plugins.spindle.ui.preferences.SpindleEditorPreferencePage.java

License:Mozilla Public License

public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        // If the new value is true then we must check all field editors.
        // If it is false, then the page is invalid in any case.
        if (newValue) {
            setValid(fAutoActivateContentAssist.isValid() && fOfferXHTML.isValid() && fAsYouTypeSpec.isValid()
                    && fAsYouTypeTemplate.isValid());
        } else {// w  w  w  .  j a  va  2s  . c  o m
            setValid(newValue);
        }
    }
}

From source file:com.iw.plugins.spindle.ui.preferences.SpindleGeneralPreferencePage.java

License:Mozilla Public License

public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        setValid(newValue);/* ww w.  jav  a 2  s.  co  m*/
    }
}

From source file:com.swtdesigner.FieldLayoutPreferencePage.java

License:Open Source License

/**
 * The field editor preference page implementation of this <code>IPreferencePage</code>
 * (and <code>IPropertyChangeListener</code>) method intercepts <code>IS_VALID</code> 
 * events but passes other events on to its superclass.
 *//*  ww  w.j  ava2 s  .  c  om*/
public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        // If the new value is true then we must check all field editors.
        // If it is false, then the page is invalid in any case.
        if (newValue) {
            checkState();
        } else {
            invalidFieldEditor = (FieldEditor) event.getSource();
            setValid(newValue);
        }
    }
}

From source file:de.anbos.eclipse.logviewer.plugin.preferences.LogViewerPreferences.java

License:Apache License

public void init(IWorkbench workbench) {
    validityChangeListener = new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(FieldEditor.IS_VALID))
                updateValidState();//from w  w  w  . j ava 2 s. com
        }
    };
}

From source file:de.fhg.igd.mapviewer.server.tiles.wizard.pages.CustomTileServerConfigPage.java

License:Open Source License

/**
 * Create components for basic options, the server name and URL pattern.
 *//*  www.j a va 2s .c  o m*/
protected void createComponent() {

    // name
    String serverName = getConfiguration().getName();
    boolean enterName = serverName == null || serverName.isEmpty();

    name = new ConfigurationNameFieldEditor(getConfiguration());
    name.fillIntoGrid(page, 3);
    name.setStringValue(serverName);
    if (!enterName) {
        checkName = false;
        name.setEnabled(false, page);
    }
    name.setLabelText(Messages.BasicConfigurationPage_3);
    name.setPage(this);
    name.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(FieldEditor.IS_VALID)) {
                update();
            }
        }
    });

    final String nameTip = Messages.BasicConfigurationPage_4;
    name.getTextControl(page).addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            setMessage(null);
        }

        @Override
        public void focusGained(FocusEvent e) {
            setMessage(nameTip, INFORMATION);
        }
    });

    // url
    url = new ConfigurationURLFieldEditor();
    url.fillIntoGrid(page, 3);
    url.setEmptyStringAllowed(false);
    url.setStringValue(getConfiguration().getUrlPattern());
    url.setLabelText(Messages.BasicConfigurationPage_5);
    url.getTextControl(page).setToolTipText(Messages.BasicConfigurationPage_5);
    url.setPage(this);
    url.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(FieldEditor.IS_VALID)) {
                update();
            }
        }
    });

    final String urlTip = Messages.BasicConfigurationPage_5;
    url.getTextControl(page).addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            setMessage(null);
        }

        @Override
        public void focusGained(FocusEvent e) {
            setMessage(urlTip, INFORMATION);
        }
    });

    // url information
    Label label = new Label(page, SWT.WRAP);
    label.setText(Messages.BasicConfigurationPage_11);
    label.setLayoutData(new GridData(SWT.HORIZONTAL, SWT.TOP, true, false, 3, 1));
}

From source file:de.fhg.igd.mapviewer.server.tiles.wizard.pages.CustomTileServerConfigPage.java

License:Open Source License

@Override
public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        update();
    }
}

From source file:de.fhg.igd.mapviewer.server.tiles.wizard.pages.CustomTileServerExtensionConfigPage.java

License:Open Source License

/**
 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
 *///  www. j ava  2s.  c om
@Override
public void propertyChange(PropertyChangeEvent event) {
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
        update();
    }
}