List of usage examples for org.eclipse.jface.preference IPreferenceStore getDefaultString
String getDefaultString(String name);
From source file:com.bdaum.zoom.ui.internal.preferences.ImportPreferencePage.java
License:Open Source License
@Override public void doPerformDefaults() { IPreferenceStore preferenceStore = getPreferenceStore(); Map<String, IRawConverter> rawConverters = BatchActivator.getDefault().getRawConverters(); for (IRawConverter rc : rawConverters.values()) { String path = rc.getPathId(); String dflt = preferenceStore.getDefaultString(path); preferenceStore.setValue(path, dflt); BatchUtilities.putPreferences(path, dflt); for (IRawConverter.RawProperty prop : rc.getProperties()) { dflt = preferenceStore.getDefaultString(prop.id); preferenceStore.setValue(prop.id, dflt); BatchUtilities.putPreferences(prop.id, dflt); }/*w w w.j ava2 s .com*/ } preferenceStore.setValue(PreferenceConstants.RAWIMPORT, preferenceStore.getDefaultString(PreferenceConstants.RAWIMPORT)); preferenceStore.setValue(PreferenceConstants.DNGCONVERTERPATH, preferenceStore.getDefaultString(PreferenceConstants.DNGCONVERTERPATH)); preferenceStore.setValue(PreferenceConstants.DNGUNCOMPRESSED, preferenceStore.getDefaultBoolean(PreferenceConstants.DNGUNCOMPRESSED)); preferenceStore.setValue(PreferenceConstants.DNGLINEAR, preferenceStore.getDefaultBoolean(PreferenceConstants.DNGLINEAR)); preferenceStore.setValue(PreferenceConstants.DERIVERELATIONS, preferenceStore.getDefaultString(PreferenceConstants.DERIVERELATIONS)); preferenceStore.setValue(PreferenceConstants.DNGFOLDER, preferenceStore.getDefaultString(PreferenceConstants.DNGFOLDER)); preferenceStore.setValue(PreferenceConstants.DEVICEWATCH, preferenceStore.getDefaultString(PreferenceConstants.DEVICEWATCH)); preferenceStore.setValue(PreferenceConstants.TETHEREDSHOW, preferenceStore.getDefaultString(PreferenceConstants.TETHEREDSHOW)); preferenceStore.setValue(PreferenceConstants.MAXIMPORTS, preferenceStore.getDefaultInt(PreferenceConstants.MAXIMPORTS)); preferenceStore.setValue(PreferenceConstants.RECIPEDETECTORS, preferenceStore.getDefaultString(PreferenceConstants.RECIPEDETECTORS)); preferenceStore.setValue(PreferenceConstants.PROCESSRECIPES, preferenceStore.getDefaultBoolean(PreferenceConstants.PROCESSRECIPES)); preferenceStore.setValue(PreferenceConstants.ARCHIVERECIPES, preferenceStore.getDefaultBoolean(PreferenceConstants.ARCHIVERECIPES)); preferenceStore.setValue(PreferenceConstants.AUTORULES, preferenceStore.getDefaultString(PreferenceConstants.AUTORULES)); preferenceStore.setValue(PreferenceConstants.IMPORTFACEDATA, preferenceStore.getDefaultBoolean(PreferenceConstants.IMPORTFACEDATA)); preferenceStore.setValue(PreferenceConstants.IMPORTMAKERNOTES, preferenceStore.getDefaultBoolean(PreferenceConstants.IMPORTMAKERNOTES)); }
From source file:com.bdaum.zoom.ui.internal.preferences.KeywordPreferencePage.java
License:Open Source License
@Override protected void doPerformDefaults() { IPreferenceStore preferenceStore = getPreferenceStore(); preferenceStore.setValue(PreferenceConstants.KEYWORDFILTER, preferenceStore.getDefaultString(PreferenceConstants.KEYWORDFILTER)); }
From source file:com.bdaum.zoom.ui.internal.preferences.MetadataPreferencePage.java
License:Open Source License
private void setDefaults(TreeViewer viewer, String key) { if (viewer instanceof CheckboxTreeViewer) ((CheckboxTreeViewer) viewer).setCheckedElements(EMPTYOBJECTS); IPreferenceStore preferenceStore = getPreferenceStore(); String ess = preferenceStore.getDefaultString(key); preferenceStore.setValue(key, ess);//from w ww . j ava 2 s . c om fillViewer(viewer, ess, -1, true); }
From source file:com.boothen.jsonedit.preferences.JsonPreferenceStore.java
License:Open Source License
@Override public void initializeDefaultPreferences() { IPreferenceStore preferenceStore = getIPreferenceStore(); IPreferenceStore editorPreferenceStore = getEditorPreferenceStore(); preferenceStore.setDefault(OVERRIDE_TAB_SETTING, false); preferenceStore.setDefault(SPACES_FOR_TABS, true); preferenceStore.setDefault(NUM_SPACES, 4); preferenceStore.setDefault(EDITOR_MATCHING_BRACKETS, true); preferenceStore.setDefault(EDITOR_MATCHING_BRACKETS_COLOR, StringConverter.asString(JsonColorProvider.STRING)); preferenceStore.setDefault(AUTO_FORMAT_ON_SAVE, false); preferenceStore.setDefault(STRING_COLOR, StringConverter.asString(JsonColorProvider.STRING)); preferenceStore.setDefault(VALUE_COLOR, StringConverter.asString(JsonColorProvider.VALUE)); preferenceStore.setDefault(NULL_COLOR, StringConverter.asString(JsonColorProvider.NULL)); preferenceStore.setDefault(ERROR_COLOR, StringConverter.asString(JsonColorProvider.ERROR)); preferenceStore.setDefault(DEFAULT_COLOR, StringConverter.asString(JsonColorProvider.DEFAULT)); preferenceStore.setDefault(ERROR_TEXT_STYLE, editorPreferenceStore.getDefaultString(ERROR_TEXT_STYLE)); preferenceStore.setDefault(ERROR_INDICATION, editorPreferenceStore.getDefaultString(ERROR_INDICATION)); preferenceStore.setDefault(ERROR_INDICATION_COLOR, editorPreferenceStore.getDefaultString(ERROR_INDICATION_COLOR)); }
From source file:com.centurylink.mdw.plugin.preferences.MdwPreferencePage.java
License:Apache License
protected void initializeFromDefaults() { IPreferenceStore store = getPreferenceStore(); int defaultReportingLevel = store.getDefaultInt(PREFS_MDW_REPORTING_LEVEL); mdwReportingLevelCombo.setText(PluginMessages.MESSAGE_LEVELS.get(new Integer(defaultReportingLevel))); jdbcFetchSizeText.setText(String.valueOf(store.getDefaultInt(PREFS_JDBC_FETCH_SIZE))); copyrightNoticeTextArea.setText(store.getDefaultString(PREFS_COPYRIGHT_NOTICE)); eventManagerCheckbox.setSelection(true); threadPoolManagerCheckbox.setSelection(true); }
From source file:com.centurylink.mdw.plugin.preferences.model.MdwSettings.java
License:Apache License
public void initialize() { setDefaultValues();// w w w . j a v a2 s. c o m IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); String relUrl = store.getString(PREFS_MDW_RELEASES_URL); if (relUrl.endsWith("/")) relUrl = relUrl.substring(0, relUrl.length() - 1); setMdwReleasesUrl(relUrl); if (getMdwReleasesUrl().length() == 0) setMdwReleasesUrl(store.getDefaultString(PREFS_MDW_RELEASES_URL)); setWorkspaceSetupUrl(store.getString(PREFS_WORKSPACE_SETUP_URL)); if (getWorkspaceSetupUrl().length() == 0) setWorkspaceSetupUrl(store.getDefaultString(PREFS_WORKSPACE_SETUP_URL)); setDiscoveryUrl(store.getString(PREFS_DISCOVERY_URL)); if (getDiscoveryUrl().length() == 0) setDiscoveryUrl(store.getDefaultString(PREFS_DISCOVERY_URL)); setIncludePreviewBuilds(store.getBoolean(PREFS_INCLUDE_PREVIEW_BUILDS)); setJdbcFetchSize(store.getInt(PREFS_JDBC_FETCH_SIZE)); if (getJdbcFetchSize() == 0) setJdbcFetchSize(store.getDefaultInt(PREFS_JDBC_FETCH_SIZE)); setCopyrightNotice(store.getString(PREFS_COPYRIGHT_NOTICE)); if (getCopyrightNotice().length() == 0) setCopyrightNotice(store.getDefaultString(PREFS_COPYRIGHT_NOTICE)); setInPlaceLabelEditing(store.getBoolean(PREFS_IN_PLACE_LABEL_EDITING)); setCompareConflictingAssetsDuringImport(store.getBoolean(PREFS_COMPARE_CONFLICTING_ASSETS)); setAllowDeleteArchivedProcesses(store.getBoolean(PREFS_ALLOW_DELETE_ARCHIVED_PROCESSES)); setAllowAssetNamesWithoutExtensions(store.getBoolean(PREFS_ALLOW_ASSETS_WITHOUT_EXTENSIONS)); setUseEmbeddedEditorForExcelAssets(store.getBoolean(PREFS_EMBEDDED_EDITOR_FOR_EXCEL)); setDoubleClickOpensSubprocessesAndScripts( store.getBoolean(PREFS_DOUBLE_CLICK_OPENS_SUBPROCESSES_AND_SCRIPTS)); setInferSmartSubprocVersionSpec(store.getBoolean(PREFS_INFER_SMART_SUBPROC_VERSION_SPEC)); setMdwReportingLevel(store.getInt(PREFS_MDW_REPORTING_LEVEL)); int red = store.getInt(PREFS_READONLY_BG_RED); int green = store.getInt(PREFS_READONLY_BG_GREEN); int blue = store.getInt(PREFS_READONLY_BG_BLUE); setReadOnlyBackground(new RGB(red, green, blue)); setTempResourceLocation(store.getString(PREFS_TEMP_RESOURCE_DIRECTORY)); if (getTempResourceLocation().length() == 0) setTempResourceLocation(store.getDefaultString(PREFS_TEMP_RESOURCE_DIRECTORY)); setTempFilesToKeep(store.getInt(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP)); if (getTempFilesToKeep() == 0) setTempFilesToKeep(store.getDefaultInt(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP)); setLoadScriptLibsOnEdit(store.getBoolean(PREFS_LOAD_SCRIPT_LIBS_ON_EDIT)); setWarnOverrideAttrsNotCarriedForward(store.getBoolean(PREFS_WARN_OVERRIDE_ATTRS_NOT_CARRIED_FORWARD)); logTimings = store.getBoolean(PREFS_LOG_TIMINGS); logConnectErrors = store.getBoolean(PREFS_LOG_CONNECT_ERRORS); swingLaunchEventManager = store.getBoolean(PREFS_SWING_LAUNCH_EVENT_MANAGER); swingLaunchThreadPoolManager = store.getBoolean(PREFS_SWING_LAUNCH_THREAD_POOL_MANAGER); useDiscoveredVcsCredentials = store.getBoolean(PREFS_USE_DISCOVERED_VCS_CREDS); setHttpConnectTimeout(store.getInt(PREFS_HTTP_CONNECT_TIMEOUT_MS)); setHttpReadTimeout(store.getInt(PREFS_HTTP_READ_TIMEOUT_MS)); setSmtpHost(store.getString(PREFS_SMTP_HOST)); setSmtpPort(store.getInt(PREFS_SMTP_PORT)); }
From source file:com.centurylink.mdw.plugin.preferences.model.ServerConsoleSettings.java
License:Apache License
/** * initialize attribute values from preferences *//*from w ww .j a v a 2 s. co m*/ public void initialize() { setDefaultValues(); IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); bufferSize = store.getInt(PREFS_SERVER_CONSOLE_BUFFER_SIZE); if (bufferSize == 0) bufferSize = store.getDefaultInt(PREFS_SERVER_CONSOLE_BUFFER_SIZE); FontData fd = new FontData(store.getString(PREFS_SERVER_CONSOLE_FONT)); if (fd.equals(new FontData("Courier New", 10, SWT.NORMAL))) fd = new FontData(store.getDefaultString(PREFS_SERVER_CONSOLE_FONT)); setFontData(fd); int red = store.getInt(PREFS_SERVER_CONSOLE_FONT_RED); if (red == 0) red = store.getDefaultInt(PREFS_SERVER_CONSOLE_FONT_RED); int green = store.getInt(PREFS_SERVER_CONSOLE_FONT_GREEN); if (green == 0) green = store.getDefaultInt(PREFS_SERVER_CONSOLE_FONT_GREEN); int blue = store.getInt(PREFS_SERVER_CONSOLE_FONT_BLUE); if (blue == 0) blue = store.getDefaultInt(PREFS_SERVER_CONSOLE_FONT_BLUE); setFontRgb(new RGB(red, green, blue)); red = store.getInt(PREFS_SERVER_CONSOLE_BG_RED); if (red == 255) red = store.getDefaultInt(PREFS_SERVER_CONSOLE_BG_RED); green = store.getInt(PREFS_SERVER_CONSOLE_BG_GREEN); if (green == 255) green = store.getDefaultInt(PREFS_SERVER_CONSOLE_BG_GREEN); blue = store.getInt(PREFS_SERVER_CONSOLE_BG_BLUE); if (blue == 255) blue = store.getDefaultInt(PREFS_SERVER_CONSOLE_BG_BLUE); setBackgroundRgb(new RGB(red, green, blue)); String clientShell = store.getString(PREFS_SERVER_CLIENT_SHELL); if (clientShell == null || clientShell.isEmpty()) clientShell = store.getDefaultString(PREFS_SERVER_CLIENT_SHELL); setClientShell(ClientShell.valueOf(clientShell)); String clientShellExePath = store.getString(PREFS_SERVER_CLIENT_SHELL_EXE_PATH); if (clientShellExePath != null && !clientShellExePath.isEmpty()) setClientShellExe(new File(clientShellExePath)); else setClientShellExe(null); }
From source file:com.centurylink.mdw.plugin.preferences.ProcessDesignPreferencePage.java
License:Apache License
protected void initializeFromDefaults() { IPreferenceStore store = getPreferenceStore(); allowAssetNamesWithoutExtensionsCheckbox .setSelection(store.getDefaultBoolean(PREFS_ALLOW_ASSETS_WITHOUT_EXTENSIONS)); inPlaceLabelEditingCheckbox.setSelection(store.getDefaultBoolean(PREFS_IN_PLACE_LABEL_EDITING)); compareConflictingAssetsCheckbox.setSelection(store.getDefaultBoolean(PREFS_COMPARE_CONFLICTING_ASSETS)); allowDeleteArchivedProcessesCheckbox .setSelection(store.getDefaultBoolean(PREFS_ALLOW_DELETE_ARCHIVED_PROCESSES)); doubleClickOpensSubprocsAndScriptsCheckbox .setSelection(store.getDefaultBoolean(PREFS_DOUBLE_CLICK_OPENS_SUBPROCESSES_AND_SCRIPTS)); inferSmartSubprocVersionSpecCheckbox .setSelection(store.getDefaultBoolean(PREFS_INFER_SMART_SUBPROC_VERSION_SPEC)); showBamEventDataFieldCheckbox.setSelection(store.getDefaultBoolean(PREFS_SHOW_BAM_EVENT_DATA_INPUT_FIELD)); warnOverrideAttrsNotCarriedForwardCheckbox .setSelection(store.getDefaultBoolean(PREFS_WARN_OVERRIDE_ATTRS_NOT_CARRIED_FORWARD)); embeddedEditorForExcelCheckbox.setSelection(store.getDefaultBoolean(PREFS_EMBEDDED_EDITOR_FOR_EXCEL)); int red = store.getDefaultInt(PREFS_READONLY_BG_RED); int green = store.getDefaultInt(PREFS_READONLY_BG_GREEN); int blue = store.getDefaultInt(PREFS_READONLY_BG_BLUE); readOnlyBackgroundRgb = new RGB(red, green, blue); colorDialog.setRGB(readOnlyBackgroundRgb); tempResourceLocationText.setText(store.getDefaultString(PREFS_TEMP_RESOURCE_DIRECTORY)); previousTempFileVersionsSpinner.setSelection(store.getInt(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP)); loadScriptLibsOnEditCheckbox.setSelection(store.getDefaultBoolean(PREFS_LOAD_SCRIPT_LIBS_ON_EDIT)); }
From source file:com.centurylink.mdw.plugin.preferences.ServerConsolePreferencePage.java
License:Apache License
@Override protected void initializeFromDefaults() { IPreferenceStore store = getPreferenceStore(); bufferSize = store.getDefaultInt(PREFS_SERVER_CONSOLE_BUFFER_SIZE); String font = store.getDefaultString(PREFS_SERVER_CONSOLE_FONT); fontData = new FontData(font); fontDialog.setFontList(new FontData[] { fontData }); int red = store.getDefaultInt(PREFS_SERVER_CONSOLE_FONT_RED); int green = store.getDefaultInt(PREFS_SERVER_CONSOLE_FONT_GREEN); int blue = store.getDefaultInt(PREFS_SERVER_CONSOLE_FONT_BLUE); fontRgb = new RGB(red, green, blue); fontDialog.setRGB(fontRgb);//from ww w. j a va2s . c om red = store.getDefaultInt(PREFS_SERVER_CONSOLE_BG_RED); green = store.getDefaultInt(PREFS_SERVER_CONSOLE_BG_GREEN); blue = store.getDefaultInt(PREFS_SERVER_CONSOLE_BG_BLUE); backgroundRgb = new RGB(red, green, blue); colorDialog.setRGB(backgroundRgb); String csPref = store.getString(PREFS_SERVER_CLIENT_SHELL); if (ClientShell.Putty.toString().equals(csPref)) clientShell = ClientShell.Putty; else clientShell = ClientShell.Karaf; if (clientShell == ClientShell.Putty) { puttyClientRadio.setSelection(true); puttyExeText.setText(store.getString(PREFS_SERVER_CLIENT_SHELL_EXE_PATH)); } else { karafClientRadio.setSelection(true); puttyExeText.setEnabled(false); } }
From source file:com.centurylink.mdw.plugin.preferences.UrlsPreferencePage.java
License:Apache License
protected void initializeFromDefaults() { IPreferenceStore store = getPreferenceStore(); mdwReleasesUrlTextField.setText(store.getDefaultString(PREFS_MDW_RELEASES_URL)); workspaceSetupUrlTextField.setText(store.getDefaultString(PREFS_WORKSPACE_SETUP_URL)); discoveryUrlTextField.setText(store.getDefaultString(PREFS_DISCOVERY_URL)); httpConnectTimeoutText.setText(String.valueOf(store.getDefaultInt(PREFS_HTTP_CONNECT_TIMEOUT_MS))); httpReadTimeoutText.setText(String.valueOf(store.getDefaultInt(PREFS_HTTP_READ_TIMEOUT_MS))); smtpHostTextField.setText(store.getDefaultString(PREFS_SMTP_HOST)); smtpPortTextField.setText(String.valueOf(store.getDefaultInt(PREFS_SMTP_PORT))); }