Java 类org.eclipse.ui.preferences.ScopedPreferenceStore 实例源码

项目:team-explorer-everywhere    文件:SynchronizeLabelDecorator.java   
public SynchronizeLabelDecorator(final Subscriber subscriber) {
    this.subscriber = subscriber;

    preferenceStore = new ScopedPreferenceStore(new InstanceScope(), TEAM_UI_PLUGIN_ID);

    decorate = Boolean.TRUE.equals(preferenceStore.getBoolean(DECORATION_PREFERENCE_CONSTANT));

    preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
        @Override
        public void propertyChange(final PropertyChangeEvent event) {
            if (event.getProperty().equals(DECORATION_PREFERENCE_CONSTANT)) {
                /*
                 * Note that we compare against the string value of the
                 * preference here. Preferences are not strongly typed
                 * (they're strings under the hood), so in the property
                 * change event, we're given the string value.
                 */
                decorate = "true".equals(event.getNewValue()); //$NON-NLS-1$

                ((ILabelProviderListener) listeners.getListener()).labelProviderChanged(
                    new LabelProviderChangedEvent(SynchronizeLabelDecorator.this));
            }
        }
    });
}
项目:jsweet-eclipse-plugin    文件:JSweetBuilder.java   
private void forceStaticImports() {
    try {
        IPreferenceStore s = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.jdt.ui");
        String favorites = s.getString(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS);
        for (String f : defaultFavorites) {
            if (!favorites.contains(f)) {
                if (!favorites.isEmpty()) {
                    favorites += ";";
                }
                favorites += f;
            }
        }
        Log.info("forcing favorite static members: " + favorites);
        s.setValue(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, favorites);
    } catch (Exception e) {
        Log.error(e);
    }
}
项目:PDFReporter-Studio    文件:JRXmlWriterHelper.java   
public static String getVersion(IResource resource, JasperReportsConfiguration jContext, boolean showDialog) {
    String version = jContext.getProperty(StudioPreferencePage.JSS_COMPATIBILITY_VERSION, LAST_VERSION);
    if (showDialog && jContext.getPropertyBoolean(StudioPreferencePage.JSS_COMPATIBILITY_SHOW_DIALOG, false)) {
        VersionDialog dialog = new VersionDialog(Display.getDefault().getActiveShell(), version, resource);
        if (dialog.open() == Dialog.OK) {
            version = dialog.getVersion();
            try {
                ScopedPreferenceStore pstore = JaspersoftStudioPlugin.getInstance().getPreferenceStore(resource,
                        JaspersoftStudioPlugin.getUniqueIdentifier());
                pstore.setValue(StudioPreferencePage.JSS_COMPATIBILITY_VERSION, version);

                // resource.setPersistentProperty(new QualifiedName(JaspersoftStudioPlugin.getUniqueIdentifier(),
                // StudioPreferencePage.JSS_COMPATIBILITY_VERSION), version);
                if (dialog.isHideNext())
                    pstore.setValue(StudioPreferencePage.JSS_COMPATIBILITY_SHOW_DIALOG, false);
                pstore.save();
                // resource.setPersistentProperty(new QualifiedName(JaspersoftStudioPlugin.getUniqueIdentifier(),
                // StudioPreferencePage.JSS_COMPATIBILITY_SHOW_DIALOG), "false");
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    }
    return version;
}
项目:mybatipse    文件:ScopedFieldEditorPreferencePage.java   
@Override
public boolean performOk()
{
    boolean result = super.performOk();
    if (result && isProjectPropertyPage())
    {
        // try
        // {
        ScopedPreferenceStore store = (ScopedPreferenceStore)getPreferenceStore();
        store.setValue(USE_PROJECT_SETTINGS, useProjectSettingsButton.getSelection());
        // store.save();
        // }
        // catch (IOException e)
        // {
        // e.printStackTrace();
        // }
    }
    return result;
}
项目:SPLevo    文件:JaMoPPTodoTagCustomizer.java   
@Override
public void adjustTodoTags() {
    ScopedPreferenceStore jdt = new ScopedPreferenceStore(InstanceScope.INSTANCE, JDT_PROPERTIES_QUALIFIER);

    String taskTags = jdt.getString(TODO_TASK_TAG_PROPERTY_QUALIFIER);
    if (taskTags.contains(TODO_TASK_TAG)) {
        return;
    }
    taskTags = taskTags + "," + TODO_TASK_TAG;
    jdt.putValue(TODO_TASK_TAG_PROPERTY_QUALIFIER, taskTags);

    String taskPriorities = jdt.getString(TODO_TASK_PRIORITY_PROPERTY_QUALIFIER);
    taskPriorities = taskPriorities + "," + TODO_TASK_PRIORITY;
    jdt.putValue(TODO_TASK_PRIORITY_PROPERTY_QUALIFIER, taskPriorities);

    try {
        jdt.save();
    } catch (IOException e) {
        LOGGER.warn("Could not save preferences.", e);
    }
}
项目:watchdog    文件:Preferences.java   
/**
 * Constructor internally implements a singleton, not visible to class
 * users. The preferences are stored on a per eclipse installation basis.
 */
private Preferences() {
    store = (ScopedPreferenceStore) Activator.getDefault()
            .getPreferenceStore();
    store.setDefault(LOGGING_ENABLED_KEY, false);
    store.setDefault(AUTHENTICATION_ENABLED_KEY, true);
    store.setDefault(USERID_KEY, "");
    store.setDefault(PROG_EXP_KEY, "");
    store.setDefault(SERVER_KEY, WatchDogGlobals.DEFAULT_SERVER_URI);
    store.setDefault(WORKSPACES_KEY, "");
    store.setDefault(TRANSFERED_INTERVALS_KEY, 0);
    store.setDefault(LAST_TRANSFERED_INTERVALS_KEY, "never");
    store.setDefault(TRANSFERED_EVENTS_KEY, 0);
    store.setDefault(LAST_TRANSFERED_EVENTS_KEY, "never");
    store.setDefault(IS_OLD_VERSION, false);
    store.setDefault(IS_BIG_UPDATE_ANSWERED, false);
    store.setDefault(IS_BIG_UPDATE_AVAILABLE, false);

    projectSettings = readSerializedWorkspaceSettings(WORKSPACES_KEY);
}
项目:dawnsci    文件:PlottingFactory.java   
/**
 * Reads the extension points for the plotting systems registered and returns
 * a plotting system based on the users current preferences.
 * 
 * @return
 */
@SuppressWarnings("unchecked")
public static <T> IPlottingSystem<T> createPlottingSystem() throws Exception {

    final ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE,"org.dawb.workbench.ui");
    String plotType = store.getString("org.dawb.plotting.system.choice");
    if (plotType.isEmpty()) plotType = System.getProperty("org.dawb.plotting.system.choice");// For Geoff et. al. can override.
    if (plotType==null) plotType = "org.dawb.workbench.editors.plotting.lightWeightPlottingSystem"; // That is usually around

    IPlottingSystem<T> system = createPlottingSystem(plotType);
    if (system!=null) return system;

    IConfigurationElement[] systems = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.dawnsci.plotting.api.plottingClass");
    if (systems.length == 0) {
        return null;
    }

    IPlottingSystem<T> ifnotfound = (IPlottingSystem<T>)systems[0].createExecutableExtension("class");
    store.setValue("org.dawb.plotting.system.choice", systems[0].getAttribute("id"));
    return ifnotfound;
}
项目:eclipsensis    文件:FileAssociationChecker.java   
private void initializePreference(String associationId, boolean enablement, String bundleId, String enablementPref)
{
    if(!PREFERENCES.contains(associationId)) {
        boolean enablement2 = enablement;
        if(enablementPref != null) {
            Bundle bundle = Platform.getBundle(bundleId);
            if(bundle != null) {
                IPreferenceStore prefs = new ScopedPreferenceStore(new InstanceScope(), bundle.getSymbolicName());
                if(prefs.contains(enablementPref)) {
                    enablement2 = prefs.getBoolean(enablementPref);
                }
            }
        }
        PREFERENCES.setValue(associationId,Boolean.toString(enablement2));
    }
}
项目:birt    文件:UIUtil.java   
public static Color getEclipseEditorForeground( )
{
    ScopedPreferenceStore preferenceStore = new ScopedPreferenceStore( InstanceScope.INSTANCE,
            "org.eclipse.ui.editors" );//$NON-NLS-1$
    Color color = null;
    if ( preferenceStore != null )
    {
        color = preferenceStore.getBoolean( AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT ) ? null
                : createColor( preferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND,
                        Display.getCurrent( ) );
    }
    if ( color == null )
    {
        color = Display.getDefault( )
                .getSystemColor( SWT.COLOR_LIST_FOREGROUND );
    }
    return color;
}
项目:birt    文件:UIUtil.java   
public static Color getEclipseEditorBackground( )
{
    ScopedPreferenceStore preferenceStore = new ScopedPreferenceStore( InstanceScope.INSTANCE,
            "org.eclipse.ui.editors" );//$NON-NLS-1$
    Color color = null;
    if ( preferenceStore != null )
    {
        color = preferenceStore.getBoolean( AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT ) ? null
                : createColor( preferenceStore,
                        AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND,
                        Display.getCurrent( ) );
    }
    if ( color == null )
    {
        color = Display.getDefault( )
                .getSystemColor( SWT.COLOR_LIST_BACKGROUND );
    }
    return color;
}
项目:n4js    文件:AbstractOutlineWorkbenchTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, getEditorId());
    comparer = new IOutlineNodeComparer.Default();

    // when using in XPECT, XPECT already creates the project structure
    if (shouldCreateProjectStructure()) {
        createProjectStructure();
    }
    //
    openXtextDocument();
    openOutlineView();
}
项目:google-cloud-eclipse    文件:PreferenceResolver.java   
/**
 * Resolve a path like <code>instance://org.example.bundle/path/to/boolean</code> to an
 * {@link IPreferenceStore}.
 * 
 * @param preferenceUri the preference path
 * @return the corresponding store
 * @throws IllegalArgumentException if unable to resolve the URI
 */
public static IPreferenceStore resolve(URI preferenceUri) throws IllegalArgumentException {
  IScopeContext context = resolveScopeContext(preferenceUri.getScheme());
  String path = preferenceUri.getHost();
  if (preferenceUri.getPath() != null) {
    path += preferenceUri.getPath();
  }
  return new ScopedPreferenceStore(context, path);
}
项目:google-cloud-eclipse    文件:PreferenceResolverTest.java   
@Test
public void testResolveInstance() throws IllegalArgumentException, URISyntaxException {
  IPreferenceStore store = PreferenceResolver.resolve(new URI("instance://com.google.test/foo"));
  assertTrue(store instanceof ScopedPreferenceStore);

  IEclipsePreferences[] nodes = ((ScopedPreferenceStore) store).getPreferenceNodes(false);
  assertEquals(1, nodes.length);
  assertEquals("/instance/com.google.test/foo", nodes[0].absolutePath());
}
项目:google-cloud-eclipse    文件:PreferenceResolverTest.java   
@Test
public void testResolveConfig() throws IllegalArgumentException, URISyntaxException {
  IPreferenceStore store =
      PreferenceResolver.resolve(new URI("configuration://com.google.test/foo"));
  assertTrue(store instanceof ScopedPreferenceStore);

  IEclipsePreferences[] nodes = ((ScopedPreferenceStore) store).getPreferenceNodes(false);
  assertEquals(1, nodes.length);
  assertEquals("/configuration/com.google.test/foo", nodes[0].absolutePath());
}
项目:uml2solidity    文件:PreferenceConstants.java   
public static IPreferenceStore getPreferenceStore(IProject project) {
    if (project != null) {
        IPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(project), Activator.PLUGIN_ID);
        if(store.getBoolean(PreferenceConstants.GENERATOR_PROJECT_SETTINGS))
        return store;
    }
    return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);//Activator.PLUGIN_ID);
}
项目:uml2solidity    文件:PreferenceConstants.java   
public static IPreferenceStore getPreferenceStore(IProject project) {
    if (project != null) {
        IPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(project), Activator.PLUGIN_ID);
        if(store.getBoolean(PreferenceConstants.COMPILER_PROJECT_SETTINGS)|| store.getBoolean(PreferenceConstants.BUILDER_PROJECT_SETTINGS))
        return store;
    }
    return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);//Activator.PLUGIN_ID);
}
项目:SparkBuilderGenerator    文件:PreferenceStoreProvider.java   
public PreferenceStoreWrapper providePreferenceStore() {
    IPreferenceStore[] preferenceStores = new IPreferenceStore[2];
    preferenceStores[0] = Activator.getDefault().getPreferenceStore();

    ScopedPreferenceStore jdtCorePreferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.jdt.core");
    if (currentJavaProject.isPresent()) { // if we are in a project add to search scope
        jdtCorePreferenceStore.setSearchContexts(new IScopeContext[] { new ProjectScope(currentJavaProject.get().getProject()), InstanceScope.INSTANCE });
    }
    preferenceStores[1] = jdtCorePreferenceStore;

    return new PreferenceStoreWrapper(new ChainedPreferenceStore(preferenceStores));
}
项目:dsl-devkit    文件:AbstractValidPreferencePage.java   
/**
 * Instantiates a new valid preference page for a given Xtext language.
 *
 * @param languageName
 *          the language name
 * @param fileExtensions
 *          the file extensions
 */
@Inject
public AbstractValidPreferencePage(@Named(Constants.LANGUAGE_NAME) final String languageName, @Named(Constants.FILE_EXTENSIONS) final String fileExtensions) {
  super();
  this.languageName = languageName;
  this.fileExtensions = fileExtensions;

  preferences = new ScopedPreferenceStore(InstanceScope.INSTANCE, getPreferenceStoreName());
  setPreferenceStore(preferences);
}
项目:tlaplus    文件:PreferenceStoreHelper.java   
/**
 * Retrieves preference store with the project scope
 * @return a store instance
 */
public static IPreferenceStore getProjectPreferenceStore(IProject project)
{
    ProjectScope scope = new ProjectScope(project);
    ScopedPreferenceStore store = new ScopedPreferenceStore(scope, Activator.PLUGIN_ID /*Activator.getDefault().getBundle().getSymbolicName()*/);
    return store;
}
项目:typescript.java    文件:TypeScriptMainPreferencePage.java   
public TypeScriptMainPreferencePage() {
    super(GRID);
    IScopeContext scope = DefaultScope.INSTANCE;
    setPreferenceStore(new ScopedPreferenceStore(scope, TypeScriptCorePlugin.PLUGIN_ID));
    // setDescription(Messages.js_debug_pref_page_desc);
    setImageDescriptor(TypeScriptUIImageResource.getImageDescriptor(TypeScriptUIImageResource.IMG_LOGO));
}
项目:typescript.java    文件:TypeScriptDocumentProvider.java   
private static IPreferenceStore createProjectSpecificPreferenceStore(IProject project) {
    List<IPreferenceStore> stores = new ArrayList<IPreferenceStore>();
    if (project != null) {
        stores.add(new EclipsePreferencesAdapter(new ProjectScope(project), TypeScriptUIPlugin.PLUGIN_ID));
        stores.add(new EclipsePreferencesAdapter(new ProjectScope(project), TypeScriptCorePlugin.PLUGIN_ID));
    }
    stores.add(new ScopedPreferenceStore(InstanceScope.INSTANCE, TypeScriptUIPlugin.PLUGIN_ID));
    stores.add(new ScopedPreferenceStore(InstanceScope.INSTANCE, TypeScriptCorePlugin.PLUGIN_ID));
    stores.add(new ScopedPreferenceStore(DefaultScope.INSTANCE, TypeScriptUIPlugin.PLUGIN_ID));
    stores.add(new ScopedPreferenceStore(DefaultScope.INSTANCE, TypeScriptCorePlugin.PLUGIN_ID));
    return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()]));
}
项目:bts    文件:ShowPreferenceDialogHandler.java   
@Execute
public void execute(MApplication app) {
    PreferenceManager pm = configurePreferences();
    PreferenceDialog dialog = new PreferenceDialog(shell, pm);
    dialog.setPreferenceStore(new ScopedPreferenceStore(
            InstanceScope.INSTANCE, "org.bbaw.bts.app"));
    dialog.create();
    dialog.getTreeViewer().setComparator(new ViewerComparator());
    dialog.getTreeViewer().expandAll();
    dialog.open();
}
项目:cppcheclipse    文件:CppcheclipsePlugin.java   
public static IPersistentPreferenceStore getProjectPreferenceStore(IProject project) {
    // Create an overlay preference store and fill it with properties
    ProjectScope ps = new ProjectScope(project);
    ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, getId());
    PreferenceInitializer.initializePropertiesDefault(scoped);
    return scoped;
}
项目:eclipse-extras    文件:LaunchConfigProviderPDETest.java   
@Before
public void setUp() {
  preferenceStore = new ScopedPreferenceStore( InstanceScope.INSTANCE, DEBUG_PLUGIN_ID );
  launchManager = DebugPlugin.getDefault().getLaunchManager();
  setFilterLaunchConfigsInClosedProjects( false );
  setFilterLaunchConfigsInDeletedProjects( false );
  launchConfigProvider = new LaunchConfigProvider( launchManager );
}
项目:eclipse-extras    文件:DebugUIPreferencesPDETest.java   
@Test
public void testPreferenceStoreType() {
  DebugUIPreferences debugUIPreferences = new DebugUIPreferences();

  IPreferenceStore preferenceStore = debugUIPreferences.getPreferenceStore();

  assertThat( preferenceStore ).isInstanceOf( ScopedPreferenceStore.class );
}
项目:org.csstudio.display.builder    文件:PreferencePage.java   
/** Initialize */
public PreferencePage()
{
    super(FieldEditorPreferencePage.GRID);
    setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID));
    setMessage(Messages.PrefPage_Title);
}
项目:pep-tools    文件:ProjectTemplateSection.java   
public void finish() {
    replacementStrings.put(KEY_PACKAGE_NAME, String.valueOf(getValue(KEY_PLUGIN_ID)));

    for (Entry<TemplateOption, ParameterDescriptor> entry : options.entrySet()) {
        TemplateOption templateOption = entry.getKey();
        ParameterDescriptor descriptor = entry.getValue();
        if (descriptor == null) {
            continue;
        }

        Object value = templateOption.getValue();
        if (!(value instanceof String)) {
            continue;
        }

        String valueString = (String) value;
        replacementStrings.put(templateOption.getName() + UNMAPPED_VALUE_SUFFIX, valueString);
        ParameterMapping valueMapping = descriptor.getValueMapping();
        String newValue = valueString.replaceAll(valueMapping.getPattern(), valueMapping.getReplacement());
        templateOption.setValue(newValue);

        addStringMappings(templateOption.getName(), valueString);

        ParameterPreference preference = descriptor.getPreference();
        if (preference != null) {
            IPersistentPreferenceStore preferences = new ScopedPreferenceStore(InstanceScope.INSTANCE,
                    preference.getPluginId());
            preferences.setValue(preference.getPreferenceName(), valueString);
            try {
                preferences.save();
            } catch (IOException e) {
                ProjectTemplateActivator.logError("Failed to save preference", e);
            }
        }
    }
}
项目:pep-tools    文件:TemplateOptionFactory.java   
private String getPreferenceValue(ParameterDescriptor descriptor) {
    ParameterPreference preference = descriptor.getPreference();
    if (preference == null) {
        return null;
    }

    IPreferenceStore preferences = new ScopedPreferenceStore(InstanceScope.INSTANCE, preference.getPluginId());
    return preferences.getString(preference.getPreferenceName());
}
项目:PDFReporter-Studio    文件:TextFieldEditor.java   
protected void doStore() {
    IPreferenceStore pstore = getPreferenceStore();
    if (isNullAllowedAndSet()) {
        if (pstore instanceof EclipsePreferences)
            ((EclipsePreferences) pstore).remove(getPreferenceName());
        else if (pstore instanceof ScopedPreferenceStore) {
            // try {
            for (IEclipsePreferences ep : ((ScopedPreferenceStore) pstore).getPreferenceNodes(true))
                ep.remove(getPreferenceName());

            // Method m = pstore.getClass().getDeclaredMethod("getStorePreferences");
            // m.setAccessible(true);
            // if (m != null) {
            // IEclipsePreferences ep = (IEclipsePreferences) m.invoke(pstore);
            // ep.remove(getPreferenceName());
            // }
            // } catch (SecurityException e) {
            // e.printStackTrace();
            // } catch (NoSuchMethodException e) {
            // e.printStackTrace();
            // } catch (IllegalArgumentException e) {
            // e.printStackTrace();
            // } catch (IllegalAccessException e) {
            // e.printStackTrace();
            // } catch (InvocationTargetException e) {
            // e.printStackTrace();
            // }

        } else
            pstore.setValue(getPreferenceName(), null);
    } else
        pstore.setValue(getPreferenceName(), textField.getText());
}
项目:PDFReporter-Studio    文件:SizeGridAction.java   
@Override
protected void doRun() throws Exception {
    int x = getStore().getInt(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEX);
    int y = getStore().getInt(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEY);

    SizeDialog dlg = new SizeDialog(UIUtils.getShell(), new Dimension(x, y));
    if (dlg.open() == Window.OK) {
        ScopedPreferenceStore store = getStore();
        store.setValue(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEX, dlg.getWidth());
        store.setValue(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEY, dlg.getHeight());

        store.save();
    }
}
项目:CooperateModelingEnvironment    文件:ProjectPropertiesStore.java   
private static IPersistentPreferenceStore createStore(IProject project) {
    IScopeContext projectScope = new ProjectScope(project);
    IPersistentPreferenceStore store = new ScopedPreferenceStore(projectScope, CooperateProjectNature.NATURE_ID);
    CDO_HOST.init(store);
    CDO_PORT.init(store);
    CDO_REPO.init(store);
    MSG_PORT.init(store);
    return store;
}
项目:APICloud-Studio    文件:TroubleshootingPreferencePage.java   
/**
 * GeneralPreferencePage
 */
public TroubleshootingPreferencePage()
{
    super(GRID);

    IPreferenceStore preferenceStore = new ScopedPreferenceStore(EclipseUtil.instanceScope(), CorePlugin
            .getDefault().getBundle().getSymbolicName());
    setPreferenceStore(preferenceStore);
    setDescription(Messages.TroubleshootingPreferencePage_TroubleshootingPageHeader);
}
项目:Eclipse-Postfix-Code-Completion    文件:SearchLabelProvider.java   
public SearchLabelProvider(JavaSearchResultPage page) {
    super(DEFAULT_SEARCH_TEXTFLAGS, DEFAULT_SEARCH_IMAGEFLAGS);
    addLabelDecorator(new ProblemsLabelDecorator(null));

    fPage= page;
    fLabelProviderMap= new HashMap<IMatchPresentation, ILabelProvider>(5);

    fSearchPreferences= new ScopedPreferenceStore(InstanceScope.INSTANCE, NewSearchUI.PLUGIN_ID);
    fSearchPropertyListener= new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            doSearchPropertyChange(event);
        }
    };
    fSearchPreferences.addPropertyChangeListener(fSearchPropertyListener);
}
项目:translationstudio8    文件:TSPreferenceInitializer.java   
@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();
}
项目:mybatipse    文件:ScopedFieldEditorPreferencePage.java   
@Override
public void setElement(IAdaptable element)
{
    this.element = element;
    setPreferenceStore(
        new ScopedPreferenceStore(new ProjectScope(getProject()), getPluginId()));
}
项目:idecore    文件:ApexCodeEditor.java   
/**
 * Creates and returns the preference store for this Java editor with the given input.
 * 
 * @param input
 *            The editor input for which to create the preference store
 * @return the preference store for this editor
 *
 */
private static IPreferenceStore createCombinedPreferenceStore(IEditorInput input) {
    List<IPreferenceStore> stores = new ArrayList<>(3);

    stores.add(new ScopedPreferenceStore(InstanceScope.INSTANCE, ForceIdeEditorsPlugin.PLUGIN_ID));
    stores.add(new ScopedPreferenceStore(DefaultScope.INSTANCE, ForceIdeEditorsPlugin.PLUGIN_ID));
    stores.add(EditorsUI.getPreferenceStore());

    return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()]));
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SearchLabelProvider.java   
public SearchLabelProvider(JavaSearchResultPage page) {
    super(DEFAULT_SEARCH_TEXTFLAGS, DEFAULT_SEARCH_IMAGEFLAGS);
    addLabelDecorator(new ProblemsLabelDecorator(null));

    fPage= page;
    fLabelProviderMap= new HashMap<IMatchPresentation, ILabelProvider>(5);

    fSearchPreferences= new ScopedPreferenceStore(InstanceScope.INSTANCE, NewSearchUI.PLUGIN_ID);
    fSearchPropertyListener= new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            doSearchPropertyChange(event);
        }
    };
    fSearchPreferences.addPropertyChangeListener(fSearchPropertyListener);
}
项目:watchdog    文件:StartupUIThread.java   
private void savePreferenceStoreIfNeeded() {
    if (preferences.getStore().needsSaving()) {
        try {
            ((ScopedPreferenceStore) preferences.getStore()).save();
        } catch (IOException exception) {
            WatchDogLogger.getInstance().logSevere(exception);
        }
    }
}
项目:eclipse-timekeeper    文件:PreferenceInitializer.java   
@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE,
            TimekeeperPlugin.BUNDLE_ID);
    try {
        store.setDefault(TimekeeperPlugin.DATABASE_LOCATION, TimekeeperPlugin.DATABASE_LOCATION_SHARED);
        store.setDefault(TimekeeperPlugin.DATABASE_LOCATION_URL, TimekeeperPlugin.getDefault().getSharedLocation());
    } catch (Exception e){
        e.printStackTrace();
    }
}
项目:eclipse-timekeeper    文件:DatabasePreferences.java   
@Override
public void init(IWorkbench workbench) {
    IPreferenceStore preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE,
            TimekeeperPlugin.BUNDLE_ID);
    setPreferenceStore(preferenceStore);
    preferenceStore.addPropertyChangeListener(this);
}