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

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

Introduction

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

Prototype

String STRING_DEFAULT_DEFAULT

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

Click Source Link

Document

The default-default value for String preferences ("").

Usage

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

License:GNU General Public License

@Override
public String getDefaultString(String name) {
    if (defaultProperties.containsKey(name)) {
        return defaultProperties.getProperty(name);
    } else {//from   w  w w .  ja  va2 s. c  om
        return IPreferenceStore.STRING_DEFAULT_DEFAULT;
    }
}

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

License:GNU General Public License

@Override
public String getString(String name) {
    try {/*w w w  . ja  va2s .c o m*/
        return securePreferences.get(name, IPreferenceStore.STRING_DEFAULT_DEFAULT);
    } catch (StorageException e) {
        exceptionHandler.handle(e);
    }
    return IPreferenceStore.STRING_DEFAULT_DEFAULT;
}

From source file:mlm.eclipse.ide.jsworkingset.internal.JSWorkingSetPrefs.java

License:Open Source License

private static void setString(final IWorkingSet pWorkingSet, final String pKeyPrefix, final String pValue) {

    if (pWorkingSet == null) {

        return;//w ww.j av  a 2  s. c o m

    }

    try {

        final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();

        if (pValue != null) {

            // set
            prefStore.setValue(pKeyPrefix + pWorkingSet.getName(), pValue);

        } else {

            // remove
            prefStore.setValue(pKeyPrefix + pWorkingSet.getName(), IPreferenceStore.STRING_DEFAULT_DEFAULT);

        }

    } catch (final Exception ex) {

        // log
        Activator.log(IStatus.ERROR, "Failed to save to preferences!", ex); //$NON-NLS-1$

    }

}

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

License:Open Source License

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

From source file:net.xmind.signin.internal.XMindUpdater.java

License:Open Source License

private IStatus confirmDownload(IProgressMonitor monitor) {
    if (monitor.isCanceled())
        return CANCELED;

    if (downloadPermitted)
        return OK;

    monitor.subTask(Messages.XMindUpdater_Task_ConfirmDownloading);
    return runInUI(monitor, new IRunnable() {
        public IStatus run(IProgressMonitor monitor) throws Exception {
            ScopedPreferenceStore preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE,
                    "org.xmind.cathy"); //$NON-NLS-1$
            String version = data.getBuildId();
            if (SKIPPABLE_YES.equalsIgnoreCase(skippable)
                    && preferenceStore.getString("needSkipVersion").equals( //$NON-NLS-1$
                            version))/*from   ww w .java2 s.c  o m*/
                return CANCELED;
            int code = new NewUpdateDialog(getParentShell()).open();
            if (code == DOWNLOAD_ID) {
                return OK;
            } else if (code == SKIP_ID) {
                //                    openAllDownloadsUrl();
                preferenceStore.setValue("needSkipVersion", //$NON-NLS-1$
                        version == null ? IPreferenceStore.STRING_DEFAULT_DEFAULT : version);
            } else if (code == REMIND_ME_ID) {
                preferenceStore.setValue("needSkipVersion", //$NON-NLS-1$
                        IPreferenceStore.STRING_DEFAULT_DEFAULT);
            }
            return CANCELED;
        }
    });
}

From source file:org.camunda.bpm.modeler.core.preferences.Bpmn2Preferences.java

License:Open Source License

public void loadDefaults() {
    String rid = TargetRuntime.getFirstNonDefaultId();
    globalPreferences.setDefault(PREF_TARGET_RUNTIME, rid);
    globalPreferences.setDefault(PREF_SHOW_ADVANCED_PROPERTIES, false);
    globalPreferences.setDefault(PREF_SHOW_DESCRIPTIONS, true);
    globalPreferences.setDefault(PREF_IS_HORIZONTAL, BPMNDIAttributeDefault.DEFAULT_TRUE.name());
    globalPreferences.setDefault(PREF_IS_EXPANDED, BPMNDIAttributeDefault.ALWAYS_TRUE.name());
    globalPreferences.setDefault(PREF_IS_MESSAGE_VISIBLE, BPMNDIAttributeDefault.ALWAYS_TRUE.name());
    globalPreferences.setDefault(PREF_IS_MARKER_VISIBLE, BPMNDIAttributeDefault.DEFAULT_TRUE.name());

    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG, false); // tri-state checkbox
    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG_FOR_activitiES, false);
    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG_FOR_GATEWAYS, false);
    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG_FOR_EVENTS, false);
    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG_FOR_EVENT_DEFS, false);
    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG_FOR_DATA_DEFS, false);
    globalPreferences.setDefault(PREF_POPUP_CONFIG_DIALOG_FOR_CONTAINERS, false);

    for (Class key : shapeStyles.keySet()) {
        globalPreferences.setDefault(getShapeStyleId(key), IPreferenceStore.STRING_DEFAULT_DEFAULT);
    }/*from w w  w  . j av a  2 s .  c om*/
    globalPreferences.setDefault(PREF_CONNECTION_TIMEOUT, "1000");
}

From source file:org.eclipse.cdt.ui.newui.CDTPrefUtil.java

License:Open Source License

public static void cleanPreferredTCs() {
    setStr(KEY_PREFTC, IPreferenceStore.STRING_DEFAULT_DEFAULT);
    readPreferredTCs();
}

From source file:org.eclipse.rap.interactiondesign.tests.ConfigurableStackTest.java

License:Open Source License

public void testGetSavedStackId() {
    String savedStackId = ConfigurableStack.getSavedStackId(site);
    assertEquals(IPreferenceStore.STRING_DEFAULT_DEFAULT, savedStackId);
}

From source file:org.eclipse.rap.interactiondesign.tests.ConfigurableStackTest.java

License:Open Source License

public void testProxyLoadSavedStack() {
    ConfigurationAction configAction = stack.getConfigAction();
    String id = "org.eclipse.rap.ui.interactiondesign.test.stackPresentation2";
    configAction.saveStackPresentationId(id);

    Composite parent = stack.getParent();
    ConfigurableStackProxy confProxy = new ConfigurableStackProxy(parent, site, PresentationFactory.KEY_VIEW);
    ConfigurableStack currentStack = confProxy.getCurrentStackPresentation();
    String stackPresentationId = currentStack.getStackPresentationId();
    String stringDefaultDefault = IPreferenceStore.STRING_DEFAULT_DEFAULT;
    configAction.saveStackPresentationId(stringDefaultDefault);
    assertEquals(id, stackPresentationId);
}

From source file:org.eclipse.rap.interactiondesign.tests.ConfigurationActionTest.java

License:Open Source License

public void testSaveAndLoadStackId() {
    ConfigurationAction configAction = stack.getConfigAction();
    String id = stack.getStackPresentationId();
    String savedStackId = ConfigurableStack.getSavedStackId(site);
    String defaultString = IPreferenceStore.STRING_DEFAULT_DEFAULT;
    assertEquals(defaultString, savedStackId);
    configAction.saveStackPresentationId(id);
    savedStackId = ConfigurableStack.getSavedStackId(site);
    assertEquals(id, savedStackId);/*from  ww w.j av a 2s.  c om*/
    configAction.saveStackPresentationId(defaultString);
    savedStackId = ConfigurableStack.getSavedStackId(site);
    assertEquals(defaultString, savedStackId);
}