Example usage for org.eclipse.jface.preference IPreferenceStore getDefaultFloat

List of usage examples for org.eclipse.jface.preference IPreferenceStore getDefaultFloat

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore getDefaultFloat.

Prototype

float getDefaultFloat(String name);

Source Link

Document

Returns the default value for the float-valued preference with the given name.

Usage

From source file:org.eclipse.ui.texteditor.ChainedPreferenceStore.java

License:Open Source License

public float getDefaultFloat(String name) {
    IPreferenceStore visibleStore = getVisibleStore(name);
    if (visibleStore != null)
        return visibleStore.getDefaultFloat(name);
    return FLOAT_DEFAULT_DEFAULT;
}

From source file:org.erlide.ui.util.OverlayPreferenceStore.java

License:Open Source License

/**
 * Loads the given key from the orgin into the target.
 * // w ww  . j ava  2s.  c o  m
 * @param orgin
 *            the source preference store
 * @param key
 *            the overlay key
 * @param target
 *            the preference store to which the key is propagated
 * @param forceInitialization
 *            if <code>true</code> the value in the target gets initialized
 *            before loading
 */
private void loadProperty(final IPreferenceStore orgin, final OverlayKey key, final IPreferenceStore target,
        final boolean forceInitialization) {
    final TypeDescriptor d = key.fDescriptor;
    if (TypeDescriptor.BOOLEAN == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, true);
        }
        target.setValue(key.fKey, orgin.getBoolean(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));

    } else if (TypeDescriptor.DOUBLE == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1.0D);
        }
        target.setValue(key.fKey, orgin.getDouble(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));

    } else if (TypeDescriptor.FLOAT == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1.0F);
        }
        target.setValue(key.fKey, orgin.getFloat(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));

    } else if (TypeDescriptor.INT == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1);
        }
        target.setValue(key.fKey, orgin.getInt(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));

    } else if (TypeDescriptor.LONG == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, 1L);
        }
        target.setValue(key.fKey, orgin.getLong(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));

    } else if (TypeDescriptor.STRING == d) {

        if (forceInitialization) {
            target.setValue(key.fKey, "1"); //$NON-NLS-1$
        }
        target.setValue(key.fKey, orgin.getString(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));

    }
}

From source file:uk.ac.diamond.scisoft.qstatmonitor.preferences.QStatMonitorPreferencePage.java

License:Open Source License

/**
 * Initialises widgets to default values
 * //from   w  w  w .  j  ava 2  s.  co m
 * @param preferences
 */
private void setWidgetsDefaultValues(final IPreferenceStore preferences) {
    btnAutoRefresh.setSelection(preferences.getDefaultBoolean(QStatMonitorPreferenceConstants.P_REFRESH));
    spnInterval.setSelection(
            convertSpinnerValue(preferences.getDefaultFloat(QStatMonitorPreferenceConstants.P_SLEEP)));

    btnAllResources
            .setSelection(preferences.getDefaultBoolean(QStatMonitorPreferenceConstants.P_RESOURCES_ALL));
    cboResource.setText(preferences.getDefaultString(QStatMonitorPreferenceConstants.P_RESOURCE));

    btnUsersAll.setSelection(preferences.getDefaultBoolean(QStatMonitorPreferenceConstants.P_USER_ALL));
    btnUsersCurr.setSelection(preferences.getDefaultBoolean(QStatMonitorPreferenceConstants.P_USER_CURR));
    btnUsersCust.setSelection(preferences.getDefaultBoolean(QStatMonitorPreferenceConstants.P_USER_CUST));
    txtUser.setText(preferences.getDefaultString(QStatMonitorPreferenceConstants.P_USER));
}

From source file:_org.eclipse.dltk.ui.preferences.OverlayPreferenceStore.java

License:Open Source License

protected void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target,
        boolean forceInitialization) {
    TypeDescriptor d = key.fDescriptor;//w  ww . j  a  v  a  2  s .  com
    if (BOOLEAN == d) {

        if (forceInitialization)
            target.setValue(key.fKey, true);
        target.setValue(key.fKey, orgin.getBoolean(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));

    } else if (DOUBLE == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1.0D);
        target.setValue(key.fKey, orgin.getDouble(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));

    } else if (FLOAT == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1.0F);
        target.setValue(key.fKey, orgin.getFloat(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));

    } else if (INT == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1);
        target.setValue(key.fKey, orgin.getInt(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));

    } else if (LONG == d) {

        if (forceInitialization)
            target.setValue(key.fKey, 1L);
        target.setValue(key.fKey, orgin.getLong(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));

    } else if (STRING == d) {

        if (forceInitialization)
            target.setValue(key.fKey, "1"); //$NON-NLS-1$
        target.setValue(key.fKey, orgin.getString(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));

    }
}