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

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

Introduction

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

Prototype

int INT_DEFAULT_DEFAULT

To view the source code for org.eclipse.jface.preference IPreferenceStore INT_DEFAULT_DEFAULT.

Click Source Link

Document

The default-default value for int preferences (0).

Usage

From source file:au.gov.ga.earthsci.eclipse.extras.ide.ChooseWorkspaceData.java

License:Open Source License

/**
* Look in the config area preference store for the list of recently used
* workspaces.//  w ww.  j  a v  a  2 s  . co m
* 
* NOTE: During the transition phase the file will be checked if no config
* preferences are found.
* 
* @return true if the values were successfully retrieved and false
*         otherwise
*/
public boolean readPersistedData() {
    IPreferenceStore store = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, Activator.PLUGIN_ID);

    // The old way was to store this information in a file, the new is to
    // use the configuration area preference store. To help users with the
    // transition, this code always looks for values in the preference
    // store; they are used if found. If there aren't any related
    // preferences, then the file method is used instead. This class always
    // writes to the preference store, so the fall-back should be needed no
    // more than once per-user, per-configuration.

    // This code always sets the value of the protocol to a non-zero value
    // (currently at 2).  If the value comes back as the default (0), then
    // none of the preferences were set, revert to the file method.

    int protocol = store.getInt(IDE.Preferences.RECENT_WORKSPACES_PROTOCOL);
    if (protocol == IPreferenceStore.INT_DEFAULT_DEFAULT && readPersistedData_file()) {
        return true;
    }

    // 2. get value for showDialog
    showDialog = store.getBoolean(IDE.Preferences.SHOW_WORKSPACE_SELECTION_DIALOG);

    // 3. use value of numRecent to create proper length array
    int max = store.getInt(IDE.Preferences.MAX_RECENT_WORKSPACES);
    max = Math.max(max, RECENT_MAX_LENGTH);

    // 4. load values of recent workspaces into array
    String workspacePathPref = store.getString(IDE.Preferences.RECENT_WORKSPACES);
    recentWorkspaces = decodeStoredWorkspacePaths(protocol, max, workspacePathPref);

    return true;
}

From source file:com.github.jennybrown8.wicketsourceopener.preferences.SecurePreferenceStore.java

License:GNU General Public License

@Override
public int getDefaultInt(String name) {
    if (defaultProperties.containsKey(name)) {
        Integer value;/*from   w  ww .  j a v a 2s.c  o  m*/
        try {
            value = Integer.parseInt(defaultProperties.getProperty(name));
        } catch (NumberFormatException e) {
            return IPreferenceStore.INT_DEFAULT_DEFAULT;
        }
        return value.intValue();
    } else {
        return IPreferenceStore.INT_DEFAULT_DEFAULT;
    }
}

From source file:com.github.jennybrown8.wicketsourceopener.preferences.SecurePreferenceStore.java

License:GNU General Public License

@Override
public int getInt(String name) {
    try {/* w  w w. jav a 2s .c o  m*/
        return securePreferences.getInt(name, IPreferenceStore.INT_DEFAULT_DEFAULT);
    } catch (StorageException e) {
        exceptionHandler.handle(e);
    }
    return IPreferenceStore.INT_DEFAULT_DEFAULT;
}

From source file:net.sf.eclipsensis.settings.NSISPreferences.java

License:Open Source License

@Override
public void removeInt(String name) {
    mPreferenceStore.setValue(name, IPreferenceStore.INT_DEFAULT_DEFAULT);
}

From source file:org.eclipse.babel.editor.preferences.MsgEditorPreferences.java

License:Open Source License

public static int getMinHeight() {
    return PREFS.getInt(MIN_HEIGHT, IPreferenceStore.INT_DEFAULT_DEFAULT);
}

From source file:org.eclipse.babel.editor.preferences.ReportingPrefPage.java

License:Open Source License

/**
 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
 *//*from w ww. ja v  a2 s  .  c om*/
protected void performDefaults() {
    reportMissingVals.select(MsgEditorPreferences.VALIDATION_MESSAGE_ERROR);
    reportDuplVals.select(MsgEditorPreferences.VALIDATION_MESSAGE_WARNING);
    reportSimVals.select(IPreferenceStore.INT_DEFAULT_DEFAULT);
    reportSimValsMode[0].setSelection(true);
    reportSimValsMode[1].setSelection(IPreferenceStore.BOOLEAN_DEFAULT_DEFAULT);
    reportSimPrecision.setText(Double.toString(0.75d));
    refreshEnabledStatuses();
    super.performDefaults();
}

From source file:org.eclipse.ui.internal.ide.ChooseWorkspaceData.java

License:Open Source License

/**
* Look in the config area preference store for the list of recently used
* workspaces.//from  w w w . j av  a2s .  co m
* 
* NOTE: During the transition phase the file will be checked if no config
* preferences are found.
* 
* @return true if the values were successfully retrieved and false
*         otherwise
*/
public boolean readPersistedData() {
    IPreferenceStore store = new ScopedPreferenceStore(new ConfigurationScope(),
            IDEWorkbenchPlugin.IDE_WORKBENCH);

    // The old way was to store this information in a file, the new is to
    // use the configuration area preference store. To help users with the
    // transition, this code always looks for values in the preference
    // store; they are used if found. If there aren't any related
    // preferences, then the file method is used instead. This class always
    // writes to the preference store, so the fall-back should be needed no
    // more than once per-user, per-configuration.

    // This code always sets the value of the protocol to a non-zero value
    // (currently at 2).  If the value comes back as the default (0), then
    // none of the preferences were set, revert to the file method.

    int protocol = store.getInt(IDE.Preferences.RECENT_WORKSPACES_PROTOCOL);
    if (protocol == IPreferenceStore.INT_DEFAULT_DEFAULT && readPersistedData_file()) {
        return true;
    }

    // 2. get value for showDialog
    showDialog = store.getBoolean(IDE.Preferences.SHOW_WORKSPACE_SELECTION_DIALOG);

    // 3. use value of numRecent to create proper length array
    int max = store.getInt(IDE.Preferences.MAX_RECENT_WORKSPACES);
    max = Math.max(max, RECENT_MAX_LENGTH);

    // 4. load values of recent workspaces into array
    String workspacePathPref = store.getString(IDE.Preferences.RECENT_WORKSPACES);
    recentWorkspaces = decodeStoredWorkspacePaths(protocol, max, workspacePathPref);

    return true;
}