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

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

Introduction

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

Prototype

String getDefaultString(String name);

Source Link

Document

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

Usage

From source file:org.apache.directory.studio.ldapbrowser.common.ValueEditorsPreferences.java

License:Apache License

/**
 * Gets the default Attribute Value Editor Relations.
 *
 * @return/*w w w.ja  v  a2  s. c  om*/
 *      an array containing all the default Attribute Value Editor Relations
 */
public AttributeValueEditorRelation[] getDefaultAttributeValueEditorRelations() {
    IPreferenceStore store = BrowserCommonActivator.getDefault().getPreferenceStore();
    String s = store.getDefaultString(BrowserCommonConstants.PREFERENCE_ATTRIBUTE_VALUEEDITOR_RELATIONS);
    // Migration issue from 1.0.1 to 1.1.0 (DIRSTUDIO-287): class AttributeValueProviderRelation 
    // was renamed to AttributeValueEditorRelation, to be able to load the old configuration it
    // is necessary to replace the old class name with the new class name.
    s = s.replaceAll("AttributeValueProviderRelation", "AttributeValueEditorRelation"); //$NON-NLS-1$ //$NON-NLS-2$
    s = s.replaceAll("valueProviderClassname", "valueEditorClassName"); //$NON-NLS-1$ //$NON-NLS-2$
    AttributeValueEditorRelation[] aver = (AttributeValueEditorRelation[]) Utils.deserialize(s);
    return aver;
}

From source file:org.apache.directory.studio.ldapbrowser.common.ValueEditorsPreferences.java

License:Apache License

/**
 * Gets an array containing all the default Syntax Value Editor Relations
 *
 * @return//from  ww w.j a va  2 s. co  m
 *      an array containing all the default Syntax Value Editor Relations
 */
public SyntaxValueEditorRelation[] getDefaultSyntaxValueEditorRelations() {
    IPreferenceStore store = BrowserCommonActivator.getDefault().getPreferenceStore();
    String s = store.getDefaultString(BrowserCommonConstants.PREFERENCE_SYNTAX_VALUEPEDITOR_RELATIONS);
    // Migration issue from 1.0.1 to 1.1.0 (DIRSTUDIO-287): class SyntaxValueProviderRelation 
    // was renamed to SyntaxValueEditorRelation, to be able to load the old configuration it
    // is necessary to replace the old class name with the new class name.
    s = s.replaceAll("SyntaxValueProviderRelation", "SyntaxValueEditorRelation"); //$NON-NLS-1$ //$NON-NLS-2$
    s = s.replaceAll("valueProviderClassname", "valueEditorClassName"); //$NON-NLS-1$ //$NON-NLS-2$
    SyntaxValueEditorRelation[] sver = (SyntaxValueEditorRelation[]) Utils.deserialize(s);
    return sver;
}

From source file:org.apache.directory.studio.schemaeditor.view.preferences.HierarchyViewPreferencePage.java

License:Apache License

/**
 * {@inheritDoc}/*  ww  w.  j a  va  2s. c  o  m*/
 */
protected void performDefaults() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    labelCombo.select(store.getDefaultInt(PluginConstants.PREFS_HIERARCHY_VIEW_LABEL));
    limitButton.setSelection(store.getDefaultBoolean(PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE));
    lengthText.setEnabled(limitButton.getSelection());
    lengthText.setText(store.getDefaultString(PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH));

    secondaryLabelButtonDisplay.setSelection(
            store.getDefaultBoolean(PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY));
    secondaryLabelCombo.select(store.getDefaultInt(PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL));
    secondaryLabelLimitButton.setSelection(
            store.getDefaultBoolean(PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE));
    secondaryLabelLengthText.setText(
            store.getDefaultString(PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH));

    if (secondaryLabelButtonDisplay.getSelection()) {
        secondaryLabelCombo.setEnabled(true);
        secondaryLabelLimitButton.setEnabled(true);
        secondaryLabelLengthText.setEnabled(secondaryLabelLimitButton.getSelection());
    } else {
        secondaryLabelCombo.setEnabled(false);
        secondaryLabelLimitButton.setEnabled(false);
        secondaryLabelLengthText.setEnabled(false);
    }

    super.performDefaults();
}

From source file:org.apache.directory.studio.schemaeditor.view.preferences.SchemaViewPreferencePage.java

License:Apache License

/**
 * {@inheritDoc}//from ww  w  .j  a v  a2 s  . co  m
 */
protected void performDefaults() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    labelCombo.select(store.getDefaultInt(PluginConstants.PREFS_SCHEMA_VIEW_LABEL));
    limitButton.setSelection(store.getDefaultBoolean(PluginConstants.PREFS_SCHEMA_VIEW_ABBREVIATE));
    lengthText.setEnabled(limitButton.getSelection());
    lengthText.setText(store.getDefaultString(PluginConstants.PREFS_SCHEMA_VIEW_ABBREVIATE_MAX_LENGTH));

    secondaryLabelButtonDisplay
            .setSelection(store.getDefaultBoolean(PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_DISPLAY));
    secondaryLabelCombo.select(store.getDefaultInt(PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL));
    secondaryLabelLimitButton.setSelection(
            store.getDefaultBoolean(PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE));
    secondaryLabelLengthText.setText(
            store.getDefaultString(PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH));

    if (secondaryLabelButtonDisplay.getSelection()) {
        secondaryLabelCombo.setEnabled(true);
        secondaryLabelLimitButton.setEnabled(true);
        secondaryLabelLengthText.setEnabled(secondaryLabelLimitButton.getSelection());
    } else {
        secondaryLabelCombo.setEnabled(false);
        secondaryLabelLimitButton.setEnabled(false);
        secondaryLabelLengthText.setEnabled(false);
    }

    schemaLabelButtonDisplay
            .setSelection(store.getDefaultBoolean(PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_LABEL_DISPLAY));

    super.performDefaults();
}

From source file:org.apache.directory.studio.schemaeditor.view.preferences.SearchViewPreferencePage.java

License:Apache License

/**
 * {@inheritDoc}/* w  w  w. j a  v a 2  s.  com*/
 */
protected void performDefaults() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    labelCombo.select(store.getDefaultInt(PluginConstants.PREFS_SEARCH_VIEW_LABEL));
    limitButton.setSelection(store.getDefaultBoolean(PluginConstants.PREFS_SEARCH_VIEW_ABBREVIATE));
    lengthText.setEnabled(limitButton.getSelection());
    lengthText.setText(store.getDefaultString(PluginConstants.PREFS_SEARCH_VIEW_ABBREVIATE_MAX_LENGTH));

    secondaryLabelButtonDisplay
            .setSelection(store.getDefaultBoolean(PluginConstants.PREFS_SEARCH_VIEW_SECONDARY_LABEL_DISPLAY));
    secondaryLabelCombo.select(store.getDefaultInt(PluginConstants.PREFS_SEARCH_VIEW_SECONDARY_LABEL));
    secondaryLabelLimitButton.setSelection(
            store.getDefaultBoolean(PluginConstants.PREFS_SEARCH_VIEW_SECONDARY_LABEL_ABBREVIATE));
    secondaryLabelLengthText.setText(
            store.getDefaultString(PluginConstants.PREFS_SEARCH_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH));

    if (secondaryLabelButtonDisplay.getSelection()) {
        secondaryLabelCombo.setEnabled(true);
        secondaryLabelLimitButton.setEnabled(true);
        secondaryLabelLengthText.setEnabled(secondaryLabelLimitButton.getSelection());
    } else {
        secondaryLabelCombo.setEnabled(false);
        secondaryLabelLimitButton.setEnabled(false);
        secondaryLabelLengthText.setEnabled(false);
    }

    schemaLabelButtonDisplay
            .setSelection(store.getDefaultBoolean(PluginConstants.PREFS_SEARCH_VIEW_SCHEMA_LABEL_DISPLAY));

    super.performDefaults();
}

From source file:org.apache.felix.sigil.eclipse.ui.internal.preferences.VersionsPreferencePage.java

License:Apache License

private void loadPreferences(boolean useDefaults) {
    IPreferenceStore prefs = getPreferenceStore();
    String lowerBoundStr;/*from  w ww .j a v  a  2  s . co  m*/
    if (useDefaults) {
        lowerBoundStr = prefs.getDefaultString(SigilCore.DEFAULT_VERSION_LOWER_BOUND);
    } else {
        lowerBoundStr = prefs.getString(SigilCore.DEFAULT_VERSION_LOWER_BOUND);
    }

    String upperBoundStr;
    if (useDefaults) {
        upperBoundStr = prefs.getDefaultString(SigilCore.DEFAULT_VERSION_UPPER_BOUND);
    } else {
        upperBoundStr = prefs.getString(SigilCore.DEFAULT_VERSION_UPPER_BOUND);
    }

    lowerBoundRule = VersionRangeBoundingRule.valueOf(lowerBoundStr);
    upperBoundRule = VersionRangeBoundingRule.valueOf(upperBoundStr);
}

From source file:org.axdt.common.preferences.fields.ComboField.java

License:Open Source License

public String getDefault(IPreferenceStore store) {
    return store.getDefaultString(key);
}

From source file:org.caesarj.ui.CaesarPlugin.java

License:Open Source License

/**
 * Adds step filter./* w  w  w .  ja  va  2 s. c om*/
 */
protected void setStepFilter() {
    IPreferenceStore store = JDIDebugUIPlugin.getDefault().getPreferenceStore();
    String afd = store.getDefaultString(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST);
    String af = store.getString(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST);
    int i;
    if (ACTIVE_FILTER.length > 0) {
        for (i = 0; i < ACTIVE_FILTER.length; i++) {
            if (afd.indexOf(ACTIVE_FILTER[i]) == -1) {
                afd += "," + ACTIVE_FILTER[i];
            }
            if (af.indexOf(ACTIVE_FILTER[i]) == -1) {
                af += "," + ACTIVE_FILTER[i];
            }
        }
        store.setDefault(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST, afd);
        store.setValue(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST, af);
    }
    String iafd = store.getDefaultString(IJDIPreferencesConstants.PREF_INACTIVE_FILTERS_LIST);
    String iaf = store.getString(IJDIPreferencesConstants.PREF_INACTIVE_FILTERS_LIST);
    if (INACTIVE_FILTER.length > 0) {
        for (i = 0; i < INACTIVE_FILTER.length; i++) {
            if (iafd.indexOf(INACTIVE_FILTER[i]) == -1) {
                iafd += "," + INACTIVE_FILTER[i];
            }
            if (iaf.indexOf(INACTIVE_FILTER[i]) == -1) {
                iaf += "," + INACTIVE_FILTER[i];
            }
        }
        store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_FILTERS_LIST, iafd);
        store.setValue(IJDIPreferencesConstants.PREF_INACTIVE_FILTERS_LIST, iaf);
    }
}

From source file:org.caleydo.view.info.selection.external.MyPreferences.java

License:Open Source License

static OpenExternally getExternalIDCategory(IPreferenceStore prefs, IDCategory category, boolean defaultValue) {

    final String prefix = "external.idcategory." + category + ".";

    String pattern = defaultValue ? prefs.getDefaultString(prefix + "pattern")
            : prefs.getString(prefix + "pattern");
    IDType type = IDType.getIDType(/*from   w  ww  . j  a va  2  s  .co  m*/
            defaultValue ? prefs.getDefaultString(prefix + "idType") : prefs.getString(prefix + "idType"));
    String label = defaultValue ? prefs.getDefaultString(prefix + "label") : prefs.getString(prefix + "label");

    if (type == null || pattern == null || pattern.isEmpty())
        return null;
    return new OpenExternally(pattern, label, type);
}

From source file:org.cfeclipse.cfml.preferences.OverlayPreferenceStore.java

License:Open Source License

private void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target,
        boolean forceInitialization) {
    TypeDescriptor d = key.fDescriptor;//from  w w  w .ja v  a 2  s  .c  o m
    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");
        target.setValue(key.fKey, orgin.getString(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));
    }
}