本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.putBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipsePreferences.putBoolean方法的具体用法?Java IEclipsePreferences.putBoolean怎么用?Java IEclipsePreferences.putBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.preferences.IEclipsePreferences
的用法示例。
在下文中一共展示了IEclipsePreferences.putBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performOk
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
public boolean performOk() {
IEclipsePreferences prefs = MsgEditorPreferences.getEclipsePreferenceStore();
prefs.put(MsgEditorPreferences.GROUP__LEVEL_SEPARATOR, keyGroupSeparator.getText());
prefs.put(MsgEditorPreferences.FILTER_LOCALES_STRING_MATCHERS,filterLocales.getText());
prefs.putBoolean(MsgEditorPreferences.UNICODE_UNESCAPE_ENABLED, convertEncodedToUnicode.getSelection());
prefs.putBoolean(MsgEditorPreferences.NL_SUPPORT_ENABLED,supportNL.getSelection());
prefs.putBoolean(MsgEditorPreferences.ADD_MSG_EDITOR_BUILDER_TO_JAVA_PROJECTS, setupRbeNatureAutomatically.getSelection());
prefs.putBoolean(MsgEditorPreferences.KEY_TREE_HIERARCHICAL, keyTreeHierarchical.getSelection());
prefs.putBoolean(MsgEditorPreferences.KEY_TREE_EXPANDED, keyTreeExpanded.getSelection());
prefs.putBoolean(MsgEditorPreferences.FIELD_TAB_INSERTS, fieldTabInserts.getSelection());
try {
prefs.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
refreshEnabledStatuses();
return super.performOk();
}
示例2: setToken
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void setToken(IEclipsePreferences prefs, Theme theme, String ourTokenType, String jdtToken,
boolean revertToDefaults)
{
if (revertToDefaults)
{
prefs.remove(jdtToken);
prefs.remove(jdtToken + "_bold"); //$NON-NLS-1$
prefs.remove(jdtToken + "_italic"); //$NON-NLS-1$
prefs.remove(jdtToken + "_underline"); //$NON-NLS-1$
prefs.remove(jdtToken + "_strikethrough"); //$NON-NLS-1$
}
else
{
TextAttribute attr = theme.getTextAttribute(ourTokenType);
prefs.put(jdtToken, StringConverter.asString(attr.getForeground().getRGB()));
prefs.putBoolean(jdtToken + "_bold", (attr.getStyle() & SWT.BOLD) != 0); //$NON-NLS-1$
prefs.putBoolean(jdtToken + "_italic", (attr.getStyle() & SWT.ITALIC) != 0); //$NON-NLS-1$
prefs.putBoolean(jdtToken + "_underline", (attr.getStyle() & TextAttribute.UNDERLINE) != 0); //$NON-NLS-1$
prefs.putBoolean(jdtToken + "_strikethrough", (attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0); //$NON-NLS-1$
}
}
示例3: setUpdatePermissions
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Sets if the new files and folders should get their permissions updated after transferring.
*
* @param shouldUpdate
* true if the permissions should be updated, false otherwise
* @param direction
* indicates if this is for upload or download permissions
*/
public static void setUpdatePermissions(boolean shouldUpdate, PermissionDirection direction)
{
IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(CoreIOPlugin.PLUGIN_ID);
switch (direction)
{
case UPLOAD:
prefs.putBoolean(IPreferenceConstants.UPLOAD_UPDATE_PERMISSIONS, shouldUpdate);
break;
case DOWNLOAD:
prefs.putBoolean(IPreferenceConstants.DOWNLOAD_UPDATE_PERMISSIONS, shouldUpdate);
break;
}
try
{
prefs.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CoreIOPlugin.getDefault(), e);
}
}
示例4: mavenOffline
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Set a bunch of preferences so that m2eclipse hopefully isn't doing a lot
* of time consuming stuff in the background.
*/
public static void mavenOffline() throws Error {
System.out.println("Pacifying m2eclipse...");
IEclipsePreferences m2EclipsePrefs = new InstanceScope().getNode("org.eclipse.m2e.core");
m2EclipsePrefs.putBoolean("eclipse.m2.offline", true);
m2EclipsePrefs.putBoolean("eclipse.m2.globalUpdatePolicy", false);
m2EclipsePrefs.putBoolean("eclipse.m2.updateIndexes", false);
try {
m2EclipsePrefs.flush();
}
catch (BackingStoreException e) {
throw new Error(e);
}
// LegacyProjectChecker.NON_BLOCKING = true;
System.out.println("Pacifying m2eclipse...DONE");
}
示例5: setPluginDefaults
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* This method re-applies the plugin defaults for the spaces for tabs and tab width preferences from the default
* scope of the plugin preference store. The default values are taken from getDefaultTabWidth() and
* getDefaultSpacesForTabs(). The default scope getDefaultPluginPreferenceStore() is used.
*/
protected void setPluginDefaults()
{
IEclipsePreferences store = getDefaultPluginPreferenceStore();
if (store == null)
{
return;
}
store.putBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS,
getDefaultSpacesForTabs());
store.putInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, getDefaultTabWidth());
try
{
store.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CommonEditorPlugin.getDefault(), e);
}
}
示例6: saveBoolPref
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void saveBoolPref(String key, boolean value) {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
node.putBoolean(key, value);
try {
node.flush();
} catch (BackingStoreException e) {
PrefEditorPlugin.log(e);
}
}
示例7: enableAutoBuild
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected static void enableAutoBuild(boolean enable) {
String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(qualifier);
node.putBoolean("description.autobuilding", enable);
try {
node.flush();
} catch (BackingStoreException e) {
throw new IllegalStateException(e);
}
}
示例8: disableProjectNatureSolutionLookup
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* In oxygen there is an nature solution lookup feature that causes a dialog to open for each imported project.
* We disable it since it's not a very useful feature.
*
* @return
*/
private boolean disableProjectNatureSolutionLookup()
{
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(ORG_ECLIPSE_EPP_MPC_UI_PREFS);
boolean val = prefs.getBoolean(ORG_ECLIPSE_EPP_MPC_NATURELOOKUP, true);
prefs.putBoolean(ORG_ECLIPSE_EPP_MPC_NATURELOOKUP, false);
try {
prefs.flush();
} catch (BackingStoreException e) {
throw new IllegalStateException(e);
}
return val;
}
示例9: enableAutoBuild
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void enableAutoBuild(boolean enable)
{
String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(qualifier);
node.putBoolean("description.autobuilding", enable);
try
{
node.flush();
}
catch (BackingStoreException e)
{
Activator.logError("Failed to enable auto build", e);
throw new IllegalStateException(e);
}
}
示例10: enableAutoBuild
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void enableAutoBuild( boolean enable )
{
String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
IEclipsePreferences node = InstanceScope.INSTANCE.getNode( qualifier );
node.putBoolean( "description.autobuilding", enable );
try
{
node.flush();
}
catch( BackingStoreException e )
{
throw new IllegalStateException( e );
}
}
示例11: initializeFormalParameters
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void initializeFormalParameters(final IEclipsePreferences preferences) {
preferences.put("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.FORMAL.PARAMETERS.PARAM1$PARAMETER", GET_FORMAL_PARAMETERS_PARAM_1_DEFAULT);
preferences.putBoolean("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.FORMAL.PARAMETERS.PARAM2$PARAMETER", GET_FORMAL_PARAMETERS_PARAM_2_DEFAULT);
preferences.putBoolean("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.FORMAL.PARAMETERS.PARAM3$PARAMETER", GET_FORMAL_PARAMETERS_PARAM_3_DEFAULT);
preferences.put("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.FORMAL.PARAMETERS.NAMES$PARAMETER", com.avaloq.tools.ddk.check.runtime.configuration.CheckPreferencesHelper.marshalStrings(GET_FORMAL_PARAMETERS_NAMES_DEFAULT));
preferences.put("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.FORMAL.PARAMETERS.INTS$PARAMETER", com.avaloq.tools.ddk.check.runtime.configuration.CheckPreferencesHelper.marshalIntegers(GET_FORMAL_PARAMETERS_INTS_DEFAULT));
}
示例12: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences()
{
final IPreferenceStore uiPreferencesStore = TLCUIActivator.getDefault().getPreferenceStore();
final IPreferenceStore tlcPreferencesStore = TLCActivator.getDefault().getPreferenceStore();
tlcPreferencesStore.setDefault(TLCActivator.I_TLC_SNAPSHOT_KEEP_COUNT, 10);
// This is so bad.. we store them in parallel because one is needed by plugin relied upon the PreferencePage
// and the other by a plugin which is on the opposite side of the dependency. (TLCModelLaunchDelegate)
uiPreferencesStore.setDefault(TLCActivator.I_TLC_SNAPSHOT_KEEP_COUNT, 10);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_TRACE_MAX_SHOW_ERRORS, 10000);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_POPUP_ERRORS, true);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_REVALIDATE_ON_MODIFY, true);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_MAXIMUM_HEAP_SIZE_DEFAULT, MAX_HEAP_SIZE_DEFAULT);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_MAXSETSIZE_DEFAULT, TLCGlobals.setBound);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_FPBITS_DEFAULT, 1);
uiPreferencesStore.setDefault(ITLCPreferenceConstants.I_TLC_FPSETIMPL_DEFAULT, FPSetFactory.getImplementationDefault());
// store.setDefault(ITLCPreferenceConstants.I_TLC_DELETE_PREVIOUS_FILES, true);
// By default we want the Toolbox to show a modal progress dialog upon TLC
// startup. A user can opt to subsequently suppress the dialog.
// This restores the behavior prior to https://bugs.eclipse.org/146205#c10.
if (!uiPreferencesStore.contains(ITLCPreferenceConstants.I_TLC_SHOW_MODAL_PROGRESS)) {
final IEclipsePreferences node = InstanceScope.INSTANCE
.getNode(WorkbenchPlugin.getDefault().getBundle().getSymbolicName());
node.putBoolean(IPreferenceConstants.RUN_IN_BACKGROUND, false);
try {
node.flush();
} catch (final BackingStoreException e) {
TLCUIActivator.getDefault().logError("Error trying to flush the workbench plugin preferences store.",
e);
}
uiPreferencesStore.setValue(ITLCPreferenceConstants.I_TLC_SHOW_MODAL_PROGRESS, true);
}
}
示例13: performOk
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public boolean performOk()
{
IEclipsePreferences store = getPluginPreferenceStore();
if (tabSpaceCombo.getText().equals(Messages.CommonEditorPreferencePage_UseSpacesOption))
{
store.putBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS, true);
store.putBoolean(IPreferenceConstants.USE_GLOBAL_DEFAULTS, false);
}
else if (tabSpaceCombo.getText().equals(Messages.CommonEditorPreferencePage_UseTabOption))
{
store.putBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS, false);
store.putBoolean(IPreferenceConstants.USE_GLOBAL_DEFAULTS, false);
}
else
{
removePluginDefaults();
store.remove(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS);
store.remove(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
store.putBoolean(IPreferenceConstants.USE_GLOBAL_DEFAULTS, true);
}
try
{
store.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CommonEditorPlugin.getDefault(), e);
}
return super.performOk();
}
示例14: initializeTslintPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void initializeTslintPreferences(IEclipsePreferences node, ITypeScriptRepository defaultRepository) {
node.put(TypeScriptCorePreferenceConstants.TSLINT_STRATEGY, TslintSettingsStrategy.DisableTslint.name());
node.put(TypeScriptCorePreferenceConstants.TSLINT_USE_CUSTOM_TSLINTJSON_FILE, "");
if (defaultRepository != null) {
node.put(TypeScriptCorePreferenceConstants.TSLINT_EMBEDDED_TYPESCRIPT_ID, defaultRepository.getName());
node.putBoolean(TypeScriptCorePreferenceConstants.TSLINT_USE_EMBEDDED_TYPESCRIPT, true);
} else {
node.putBoolean(TypeScriptCorePreferenceConstants.TSLINT_USE_EMBEDDED_TYPESCRIPT, false);
}
node.put(TypeScriptCorePreferenceConstants.TSLINT_INSTALLED_TYPESCRIPT_PATH, "");
}
示例15: setHyperlinkValues
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void setHyperlinkValues(Theme theme, IEclipsePreferences prefs, boolean revertToDefaults)
{
if (prefs == null || theme == null)
{
return;
}
if (revertToDefaults)
{
// Console preferences
prefs.remove(JFacePreferences.HYPERLINK_COLOR);
prefs.remove(JFacePreferences.ACTIVE_HYPERLINK_COLOR);
// Editor preferences
prefs.remove(DefaultHyperlinkPresenter.HYPERLINK_COLOR_SYSTEM_DEFAULT);
prefs.remove(DefaultHyperlinkPresenter.HYPERLINK_COLOR);
}
else
{
TextAttribute editorHyperlink = theme.getTextAttribute("hyperlink"); //$NON-NLS-1$
prefs.put(JFacePreferences.HYPERLINK_COLOR,
StringConverter.asString(editorHyperlink.getForeground().getRGB()));
JFaceResources.getColorRegistry().put(JFacePreferences.HYPERLINK_COLOR,
editorHyperlink.getForeground().getRGB());
prefs.put(JFacePreferences.ACTIVE_HYPERLINK_COLOR,
StringConverter.asString(editorHyperlink.getForeground().getRGB()));
JFaceResources.getColorRegistry().put(JFacePreferences.ACTIVE_HYPERLINK_COLOR,
editorHyperlink.getForeground().getRGB());
prefs.putBoolean(DefaultHyperlinkPresenter.HYPERLINK_COLOR_SYSTEM_DEFAULT, false);
prefs.put(DefaultHyperlinkPresenter.HYPERLINK_COLOR,
StringConverter.asString(editorHyperlink.getForeground().getRGB()));
}
}