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

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

Introduction

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

Prototype

int getDefaultInt(String name);

Source Link

Document

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

Usage

From source file:org.emftext.sdk.concretesyntax.resource.cs.ui.CsContentAssistPreferencePage.java

License:Open Source License

protected void performDefaults() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    assistEnabled = preferenceStore.getDefaultBoolean(
            org.emftext.sdk.concretesyntax.resource.cs.ui.CsPreferenceConstants.EDITOR_CONTENT_ASSIST_ENABLED);
    activationDelay = preferenceStore.getDefaultInt(
            org.emftext.sdk.concretesyntax.resource.cs.ui.CsPreferenceConstants.EDITOR_CONTENT_ASSIST_DELAY);
    activationTriggers = preferenceStore.getDefaultString(
            org.emftext.sdk.concretesyntax.resource.cs.ui.CsPreferenceConstants.EDITOR_CONTENT_ASSIST_TRIGGERS);
    // defaults in widgets
    btnActivate.setEnabled(assistEnabled);
    btnActivate.setSelection(assistEnabled);
    txtDelay.setEnabled(assistEnabled);//from  w  w  w  .j  a  v  a 2  s  .co  m
    txtDelay.setText(String.valueOf(activationDelay));
    txtTriggers.setEnabled(assistEnabled);
    txtTriggers.setText(activationTriggers);
}

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

License:Open Source License

/**
 * Loads the given key from the orgin into the target.
 * /*from   ww  w  .  j  a v  a  2  s  . com*/
 * @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:org.fusesource.ide.jvmmonitor.internal.tools.ToolsPreferencePage.java

License:Open Source License

@Override
protected void performDefaults() {
    IPreferenceStore store = getPreferenceStore();
    String updatePeriod = String.valueOf(store.getDefaultInt(IConstants.UPDATE_PERIOD));
    updatePeriodText.setText(updatePeriod);
    maxNumberOfClassesText/*www  .  j  av  a 2s  .c  o  m*/
            .setText(String.valueOf(getPreferenceStore().getDefaultInt(IConstants.MAX_CLASSES_NUMBER)));

    super.performDefaults();
}

From source file:org.jbpm.eclipse.task.preferences.TaskPreferencePage.java

License:Apache License

private void initializeDefaults() {
    IPreferenceStore store = getPreferenceStore();
    ipAddressText.setText(store.getDefaultString(TaskConstants.SERVER_IP_ADDRESS));
    portText.setText(store.getDefaultInt(TaskConstants.SERVER_PORT) + "");
    languageText.setText(store.getDefaultString(TaskConstants.LANGUAGE));
    transportType.select(store.getInt(TaskConstants.TRANSPORT));
}

From source file:org.lh.dmlj.schema.editor.dictionary.tools.preference.ui.DictionaryPreferencePage.java

License:Open Source License

private void initializeDefaults() {
    IPreferenceStore store = getPreferenceStore();
    String defaultSchema = store.getDefaultString(PreferenceConstants.DEFAULT_SCHEMA);
    textDefaultSchema.setText(defaultSchema);
    int defaultQueryDbkeyListSizeMaximum = store
            .getDefaultInt(PreferenceConstants.DEFAULT_QUERY_DBKEY_LIST_SIZE_MAXIMUM);
    textDefaultQueryDbkeyListSizeMaximum.setText(String.valueOf(defaultQueryDbkeyListSizeMaximum));
}

From source file:org.lh.dmlj.schema.editor.preference.PrintPreferencesPreferencePage.java

License:Open Source License

private void initializeDefaults() {

    IPreferenceStore store = getPreferenceStore();

    Unit unit = Unit.valueOf(store.getDefaultString(PreferenceConstants.UNITS));
    // we do not need to change lblMargins since the unit is set at another preference page

    // margins are stored in pels (logical pixels; 72 pels == 1 inch)...
    int topMargin = store.getDefaultInt(PreferenceConstants.TOP_MARGIN);
    int bottomMargin = store.getDefaultInt(PreferenceConstants.BOTTOM_MARGIN);
    int leftMargin = store.getDefaultInt(PreferenceConstants.LEFT_MARGIN);
    int rightMargin = store.getDefaultInt(PreferenceConstants.RIGHT_MARGIN);

    spinnerTopMargin.setSelection(toMargin(topMargin, unit));
    spinnerBottomMargin.setSelection(toMargin(bottomMargin, unit));
    spinnerLeftMargin.setSelection(toMargin(leftMargin, unit));
    spinnerRightMargin.setSelection(toMargin(rightMargin, unit));

    doChecks();/*w  w  w  .j av a2s . c  o m*/

}

From source file:org.pwsafe.passwordsafeswt.preference.PasswordPolicyPreferences.java

License:Open Source License

/**
 * Called when user clicks Restore Defaults
 *///from   ww  w .  ja va 2 s. c  o  m
@Override
protected void performDefaults() {
    // Get the preference store
    final IPreferenceStore preferenceStore = getPreferenceStore();

    spiLength.setSelection(preferenceStore.getDefaultInt(DEFAULT_PASSWORD_LENGTH));
    btnUseLowercase.setSelection(preferenceStore.getDefaultBoolean(USE_LOWERCASE_LETTERS));
    btnUserUppercase.setSelection(preferenceStore.getDefaultBoolean(USE_UPPERCASE_LETTERS));
    btnUseDigits.setSelection(preferenceStore.getDefaultBoolean(USE_DIGITS));
    btnUseSymbols.setSelection(preferenceStore.getDefaultBoolean(USE_SYMBOLS));
    btnUseEaseToRead.setSelection(preferenceStore.getDefaultBoolean(USE_EASY_TO_READ));
    btnUseHexOnly.setSelection(preferenceStore.getDefaultBoolean(USE_HEX_ONLY));

}

From source file:org.pwsafe.passwordsafeswt.preference.SecurityPreferences.java

License:Open Source License

/**
 * Called when user clicks Restore Defaults
 *///from   w w  w.  ja  v  a2 s .  c o m
@Override
protected void performDefaults() {
    // Get the preference store
    final IPreferenceStore preferenceStore = getPreferenceStore();

    // Reset the fields to the defaults
    btnClearClipboard.setSelection(preferenceStore.getDefaultBoolean(CLEAR_CLIPBOARD_ON_MIN));
    btnLockDatabaseOnMin.setSelection(preferenceStore.getDefaultBoolean(LOCK_DB_ON_MIN));
    btnConfirmSaveOnMinimize.setSelection(preferenceStore.getDefaultBoolean(CONFIRM_SAVE_ON_MIN));
    btnConfirmCopy.setSelection(preferenceStore.getDefaultBoolean(CONFIRM_COPY_TO_CLIPBOARD));
    btnLockDatabaseOnWorkstationLock.setSelection(preferenceStore.getDefaultBoolean(LOCK_DB_ON_WS_LOCK));
    btnLockOnIdle.setSelection(preferenceStore.getDefaultBoolean(LOCK_ON_IDLE));
    spiMinutesIdle.setData(preferenceStore.getDefaultInt(LOCK_ON_IDLE_MINS));

}

From source file:org.rubypeople.rdt.internal.ui.preferences.NewRubyProjectPreferencePage.java

License:Open Source License

protected void performDefaults() {
    IPreferenceStore store = getPreferenceStore();
    for (int i = 0; i < fCheckBoxes.size(); i++) {
        Button button = (Button) fCheckBoxes.get(i);
        String key = (String) button.getData();
        button.setSelection(store.getDefaultBoolean(key));
    }//from  w  w w  .  ja v  a 2 s  . co m
    for (int i = 0; i < fRadioButtons.size(); i++) {
        Button button = (Button) fRadioButtons.get(i);
        String[] info = (String[]) button.getData();
        button.setSelection(info[1].equals(store.getDefaultString(info[0])));
    }
    for (int i = 0; i < fTextControls.size(); i++) {
        Text text = (Text) fTextControls.get(i);
        String key = (String) text.getData();
        text.setText(store.getDefaultString(key));
    }
    if (fJRECombo != null) {
        fJRECombo.select(store.getDefaultInt(LOADPATH_JRELIBRARY_INDEX));
    }

    validateFolders();
    super.performDefaults();
}

From source file:org.spearce.egit.ui.internal.preferences.GitDecoratorPreferencePage.java

License:Open Source License

/**
 * Defaults was clicked. Restore the Git decoration preferences to their
 * default values/* w ww  .  j a  va 2 s  .  c o  m*/
 */
protected void performDefaults() {
    super.performDefaults();
    IPreferenceStore store = getPreferenceStore();

    recomputeAncestorDecorations
            .setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_RECOMPUTE_ANCESTORS));
    containerRecurseLimit.setSelection(store.getDefaultInt(UIPreferences.DECORATOR_RECURSIVE_LIMIT));

    fileTextFormat.setText(store.getDefaultString(UIPreferences.DECORATOR_FILETEXT_DECORATION));
    folderTextFormat.setText(store.getDefaultString(UIPreferences.DECORATOR_FOLDERTEXT_DECORATION));
    projectTextFormat.setText(store.getDefaultString(UIPreferences.DECORATOR_PROJECTTEXT_DECORATION));

    showTracked.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_TRACKED_ICON));
    showUntracked.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON));
    showStaged.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_STAGED_ICON));
    showConflicts.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_CONFLICTS_ICON));
    showAssumeValid.setSelection(store.getDefaultBoolean(UIPreferences.DECORATOR_SHOW_ASSUME_VALID_ICON));
}