Example usage for org.eclipse.jface.resource JFaceResources getString

List of usage examples for org.eclipse.jface.resource JFaceResources getString

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources getString.

Prototype

public static String getString(String key) 

Source Link

Document

Returns the resource object with the given key in JFace's resource bundle.

Usage

From source file:com.nsn.squirrel.preferences.ScopedPreferenceStore.java

License:Open Source License

public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
    // important: create intermediate array to protect against listeners
    // being added/removed during the notification
    final Object[] list = getListeners();
    if (list.length == 0) {
        return;/*from w  w  w  . j a va  2s . c  o m*/
    }
    final PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue);
    for (int i = 0; i < list.length; i++) {
        final IPropertyChangeListener listener = (IPropertyChangeListener) list[i];
        SafeRunner.run(new SafeRunnable(JFaceResources.getString("PreferenceStore.changeError")) { //$NON-NLS-1$
            public void run() {
                listener.propertyChange(event);
            }
        });
    }
}

From source file:com.paulisse.eclipse.plugin.rsync.preferences.thirdparty.MultiLineStringFieldEditor.java

License:Open Source License

/**
 * Creates a string field editor.//  w w w  . j av a  2s.  c  om
 * Use the method <code>setTextLimit</code> to limit the text.
 *
 * @param name the name of the preference this field editor works on
 * @param labelText the label text of the field editor
 * @param width the width of the text input field in characters,
 *  or <code>UNLIMITED</code> for no limit
 * @param strategy either <code>VALIDATE_ON_KEY_STROKE</code> to perform
 *  on the fly checking (the default), or <code>VALIDATE_ON_FOCUS_LOST</code> to
 *  perform validation only after the text has been typed in
 * @param parent the parent of the field editor's control
 * @since 2.0
 */
public MultiLineStringFieldEditor(String name, String labelText, int width, int strategy, Composite parent) {
    init(name, labelText);
    widthInChars = width;
    setValidateStrategy(strategy);
    isValid = false;
    errorMessage = JFaceResources.getString("StringFieldEditor.errorMessage");//$NON-NLS-1$
    createControl(parent);
}

From source file:com.prodyna.bamboo.status.preferences.ProjectFieldEditor.java

License:Open Source License

private Button createPushButton(Composite parent, String key) {
    Button button = new Button(parent, SWT.PUSH);
    button.setText(JFaceResources.getString(key));
    button.setFont(parent.getFont());//from w ww.j av a  2s . c o  m
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH);
    data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
    button.setLayoutData(data);
    button.addSelectionListener(new SelectionListener() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            doLoad();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {

        }
    });
    return button;
}

From source file:com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.IntegerFieldEditor.java

License:Open Source License

/**
 * Creates an integer field editor./*from  w  ww.  ja v a  2 s  .c o m*/
 * 
 * @param name
 *            the name of the preference this field editor works on
 * @param labelText
 *            the label text of the field editor
 * @param parent
 *            the parent of the field editor's control
 * @param textLimit
 *            the maximum number of characters in the text.
 */
public IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit) {
    init(name, labelText);
    setTextLimit(textLimit);
    setEmptyStringAllowed(false);
    setWidthInChars(3);
    setErrorMessage(JFaceResources.getString("IntegerFieldEditor.errorMessage"));//$NON-NLS-1$
    createControl(parent);
}

From source file:com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.IntegerFieldEditor.java

License:Open Source License

/**
 * Creates an integer field editor./*from  www.j av  a 2 s .com*/
 * 
 * @param name
 *            the name of the preference this field editor works on
 * @param labelText
 *            the label text of the field editor
 * @param parent
 *            the parent of the field editor's control
 * @param textLimit
 *            the maximum number of characters in the text.
 * @param width
 *            the width of the field, measured in characters
 */
public IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit, int width) {
    init(name, labelText);
    setTextLimit(textLimit);
    setEmptyStringAllowed(false);
    setWidthInChars(width);
    setErrorMessage(JFaceResources.getString("IntegerFieldEditor.errorMessage"));//$NON-NLS-1$
    createControl(parent);
}

From source file:com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.ProjectAwareScopedPreferenceStore.java

License:Open Source License

@Override
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
    // important: create intermediate array to protect against listeners
    // being added/removed during the notification
    final Object[] list = getListeners();
    if (list.length == 0) {
        return;//from  ww  w . ja va 2  s . c o m
    }
    final PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue);
    for (int i = 0; i < list.length; i++) {
        final IPropertyChangeListener listener = (IPropertyChangeListener) list[i];
        SafeRunner.run(new SafeRunnable(JFaceResources.getString("PreferenceStore.changeError")) { //$NON-NLS-1$
            public void run() {
                listener.propertyChange(event);
            }
        });
    }
}

From source file:com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.StringFieldEditor.java

License:Open Source License

/**
 * Creates a string field editor.//from  ww w.  ja v  a  2 s  .  c o  m
 * Use the method <code>setTextLimit</code> to limit the text.
 * 
 * @param name
 *            the name of the preference this field editor works on
 * @param labelText
 *            the label text of the field editor
 * @param width
 *            the width of the text input field in characters,
 *            or <code>UNLIMITED</code> for no limit
 * @param strategy
 *            either <code>VALIDATE_ON_KEY_STROKE</code> to perform
 *            on the fly checking (the default), or <code>VALIDATE_ON_FOCUS_LOST</code> to
 *            perform validation only after the text has been typed in
 * @param parent
 *            the parent of the field editor's control
 * @since 2.0
 */
public StringFieldEditor(String name, String labelText, int width, int strategy, Composite parent) {
    init(name, labelText);
    widthInChars = width;
    setValidateStrategy(strategy);
    isValid = false;
    errorMessage = JFaceResources.getString("StringFieldEditor.errorMessage");//$NON-NLS-1$
    createControl(parent);
}

From source file:com.runwaysdk.manager.widgets.ProgressMonitorDialog.java

License:Open Source License

@Override
protected void configureShell(final Shell shell) {
    super.configureShell(shell);

    shell.setText(JFaceResources.getString("ProgressMonitorDialog.title")); //$NON-NLS-1$

    if (waitCursor == null) {
        waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
    }/*from  w  w  w  . j a v a 2 s.c  o m*/

    shell.setCursor(waitCursor);

    // Add a listener to set the message properly when the dialog becomes
    // visible
    shell.addListener(SWT.Show, new Listener() {
        public void handleEvent(Event event) {
            // We need to async the message update since the Show precedes
            // visibility
            shell.getDisplay().asyncExec(new Runnable() {
                public void run() {
                    setTask(DEFAULT_TASKNAME, true);

                    for (Runnable runnable : runnables) {
                        runnable.run();
                    }
                }
            });
        }
    });
}

From source file:com.simplifide.core.ui.preference.LicenseFieldEditor.java

License:Open Source License

/**
 * Creates a string field editor./*from   w ww . j  a  v  a 2s.co  m*/
 * Use the method <code>setTextLimit</code> to limit the text.
 * 
 * @param name the name of the preference this field editor works on
 * @param labelText the label text of the field editor
 * @param width the width of the text input field in characters,
 *  or <code>UNLIMITED</code> for no limit
 * @param strategy either <code>VALIDATE_ON_KEY_STROKE</code> to perform
 *  on the fly checking (the default), or <code>VALIDATE_ON_FOCUS_LOST</code> to
 *  perform validation only after the text has been typed in
 * @param parent the parent of the field editor's control
 * @since 2.0
 */
public LicenseFieldEditor(String name, String labelText, int width, int strategy, Composite parent) {
    init(name, labelText);
    widthInChars = width;
    setValidateStrategy(strategy);
    isValid = false;
    errorMessage = JFaceResources.getString("StringFieldEditor.errorMessage");//$NON-NLS-1$
    createControl(parent);
}

From source file:com.twinsoft.convertigo.eclipse.wizards.import_export.ProjectFileFieldEditor.java

License:Open Source License

/**
 * Creates a file field editor./*www  . ja  va  2  s.co m*/
 * 
 * @param name the name of the preference this field editor works on
 * @param labelText the label text of the field editor
 * @param enforceAbsolute <code>true</code> if the file path
 *  must be absolute, and <code>false</code> otherwise
 * @param parent the parent of the field editor's control
 */
public ProjectFileFieldEditor(String name, String labelText, boolean enforceAbsolute, Composite parent) {
    init(name, labelText);
    this.enforceAbsolute = enforceAbsolute;
    setErrorMessage(JFaceResources.getString("FileFieldEditor.errorMessage"));//$NON-NLS-1$
    setChangeButtonText(JFaceResources.getString("openBrowse"));//$NON-NLS-1$
    setValidateStrategy(VALIDATE_ON_FOCUS_LOST);
    createControl(parent);
}