Search in sources :

Example 1 with ScopedPreferenceStore

use of org.eclipse.ui.preferences.ScopedPreferenceStore in project translationstudio8 by heartsome.

the class TSPreferenceInitializer method initializeDefaultPreferences.

@Override
public void initializeDefaultPreferences() {
    // 设置 colors 首选项页的初始值
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TAG_FG_COLOR, new RGB(234, 234, 234));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TAG_BG_COLOR, new RGB(223, 112, 0));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.WRONG_TAG_COLOR, new RGB(255, 0, 0));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.DIFFERENCE_FG_COLOR, new RGB(255, 0, 0));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.DIFFERENCE_BG_COLOR, new RGB(244, 244, 159));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.PT_COLOR, new RGB(255, 0, 0));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.QT_COLOR, new RGB(255, 204, 204));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.MT_COLOR, new RGB(171, 217, 198));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH101_COLOR, new RGB(255, 255, 204));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH100_COLOR, new RGB(37, 168, 204));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH90_COLOR, new RGB(79, 185, 214));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH80_COLOR, new RGB(114, 199, 222));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH70_COLOR, new RGB(155, 215, 231));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH0_COLOR, new RGB(198, 240, 251));
    PreferenceConverter.setDefault(store, IColorPreferenceConstant.HIGHLIGHTED_TERM_COLOR, new RGB(170, 255, 85));
    // 设置 net.heartsome.cat.common.core 插件中的语言代码初始值
    IPreferenceStore corePreferenceStore = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, CoreActivator.getDefault().getBundle().getSymbolicName());
    corePreferenceStore.setDefault(IPreferenceConstants.LANGUAGECODE, LocaleService.getLanguageConfigAsString());
    // 设置选择路径对话框的初始值
    PlatformUI.getPreferenceStore().setDefault(IPreferenceConstants.LAST_DIRECTORY, System.getProperty("user.home"));
    ColorConfigLoader.init();
}
Also used : IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) RGB(org.eclipse.swt.graphics.RGB) ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore)

Example 2 with ScopedPreferenceStore

use of org.eclipse.ui.preferences.ScopedPreferenceStore in project flux by eclipse.

the class ConnectionPreferencePage method init.

@Override
public void init(IWorkbench workbench) {
    setDescription("Allows setting of various Flux server connection parameters.");
    setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID));
    if (!editable) {
        setMessage("Settings cannot be changed from UI. They are set via environment variable and/or command line arguments", IMessageProvider.WARNING);
    }
}
Also used : ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore)

Example 3 with ScopedPreferenceStore

use of org.eclipse.ui.preferences.ScopedPreferenceStore in project xtext-xtend by eclipse.

the class LineSeparatorConversionTest method testSeparator.

private void testSeparator(String separator) throws Exception {
    IProject project = workbenchTestHelper.getProject();
    ScopedPreferenceStore projectPreferenceStore = new ScopedPreferenceStore(new ProjectScope(project), Platform.PI_RUNTIME);
    projectPreferenceStore.setValue(Platform.PREF_LINE_SEPARATOR, separator);
    workbenchTestHelper.createFile("Foo.xtend", "class Foo {}");
    waitForBuild();
    IFile compiledFile = project.getFile("xtend-gen/Foo.java");
    workbenchTestHelper.getFiles().add(compiledFile);
    String contents = WorkbenchTestHelper.getContentsAsString(compiledFile);
    List<String> expectedLines = ImmutableList.of("@SuppressWarnings(\"all\")", "public class Foo {", "}", "");
    String expectedContent = Joiner.on(separator).join(expectedLines);
    assertEquals(expectedContent, contents);
}
Also used : ProjectScope(org.eclipse.core.resources.ProjectScope) IFile(org.eclipse.core.resources.IFile) IProject(org.eclipse.core.resources.IProject) ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore)

Example 4 with ScopedPreferenceStore

use of org.eclipse.ui.preferences.ScopedPreferenceStore in project xtext-xtend by eclipse.

the class UnicodeEscapeTest method getProject.

private IProject getProject(String encoding) throws CoreException {
    IProject project = workbenchTestHelper.getProject();
    ScopedPreferenceStore projectPreferenceStore = new ScopedPreferenceStore(new ProjectScope(project), Platform.PI_RUNTIME);
    projectPreferenceStore.setValue(Platform.PREF_LINE_SEPARATOR, "\n");
    project.setDefaultCharset(encoding, null);
    return project;
}
Also used : ProjectScope(org.eclipse.core.resources.ProjectScope) IProject(org.eclipse.core.resources.IProject) ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore)

Example 5 with ScopedPreferenceStore

use of org.eclipse.ui.preferences.ScopedPreferenceStore in project linuxtools by eclipse.

the class AbstractProviderPreferencesPage method init.

@Override
public void init(IWorkbench workbench) {
    final IPreferenceStore store = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, ProviderProfileConstants.PLUGIN_ID);
    setPreferenceStore(store);
}
Also used : IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore)

Aggregations

ScopedPreferenceStore (org.eclipse.ui.preferences.ScopedPreferenceStore)24 ProjectScope (org.eclipse.core.resources.ProjectScope)9 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)8 IOException (java.io.IOException)4 IProject (org.eclipse.core.resources.IProject)4 IResource (org.eclipse.core.resources.IResource)3 CoreException (org.eclipse.core.runtime.CoreException)3 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)3 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 ILaunch (org.eclipse.debug.core.ILaunch)2 Launch (org.eclipse.debug.core.Launch)2 Before (org.junit.Before)2 BufferedInputStream (java.io.BufferedInputStream)1 BufferedWriter (java.io.BufferedWriter)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1