类org.eclipse.ui.texteditor.ChainedPreferenceStore源码实例Demo

下面列出了怎么用org.eclipse.ui.texteditor.ChainedPreferenceStore的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: xtext-xtend   文件: XtendPreferenceStoreAccess.java
@SuppressWarnings("all")
@Override
public IPreferenceStore getContextPreferenceStore(Object context) {
	IProject project = getProject(context);
	if (project == null) return getPreferenceStore();
	IPreferenceStore store = super.getContextPreferenceStore(context);
	ProjectScope projectScope = new ProjectScope(project);
	FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(projectScope, JavaCore.PLUGIN_ID);
	jdtStore.setSearchContexts(new IScopeContext[] {
			projectScope,
			new InstanceScope(),
			new ConfigurationScope()
	});
	return new ChainedPreferenceStore(new IPreferenceStore[] {
		store,
		jdtStore,
		PreferenceConstants.getPreferenceStore()
	});
}
 
/**
 * 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
 *
 * @since 3.0
 */
private IPreferenceStore createCombinedPreferenceStore(IEditorInput input) {
	List<IPreferenceStore> stores= new ArrayList<IPreferenceStore>(3);

	IJavaProject project= EditorUtility.getJavaProject(input);
	if (project != null) {
		stores.add(new EclipsePreferencesAdapter(new ProjectScope(project.getProject()), JavaCore.PLUGIN_ID));
	}

	stores.add(JavaPlugin.getDefault().getPreferenceStore());
	stores.add(new PreferencesAdapter(JavaPlugin.getJavaCorePluginPreferences()));
	stores.add(EditorsUI.getPreferenceStore());
	stores.add(PlatformUI.getPreferenceStore());

	return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()]));
}
 
private Control createPreviewer(Composite parent) {

		IPreferenceStore store= new ChainedPreferenceStore(new IPreferenceStore[] { fOverlayStore, JavaPlugin.getDefault().getCombinedPreferenceStore()});
		fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, store);
		fColorManager= new JavaColorManager(false);
		PropertiesFileSourceViewerConfiguration configuration= new PropertiesFileSourceViewerConfiguration(fColorManager, store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING);
		fPreviewViewer.configure(configuration);
		Font font= JFaceResources.getFont(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT);
		fPreviewViewer.getTextWidget().setFont(font);
		new SourcePreviewerUpdater(fPreviewViewer, configuration, store);
		fPreviewViewer.setEditable(false);

		String content= loadPreviewContentFromFile("PropertiesFileEditorColorSettingPreviewCode.txt"); //$NON-NLS-1$
		IDocument document= new Document(content);
		PropertiesFileDocumentSetupParticipant.setupDocument(document);
		fPreviewViewer.setDocument(document);

		return fPreviewViewer.getControl();
	}
 
private Control createPreviewer(Composite parent) {

		IPreferenceStore store = new ChainedPreferenceStore(new IPreferenceStore[] { fOverlayStore,
				EditorConfigUIPlugin.getDefault().getCombinedPreferenceStore() });
		fPreviewViewer = new SourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
		fColorManager = new EditorConfigColorManager(false);
		EditorConfigSourceViewerConfiguration configuration = new EditorConfigSourceViewerConfiguration(fColorManager,
				store, null, IEditorConfigPartitions.EDITOR_CONFIG_PARTITIONING);
		fPreviewViewer.configure(configuration);
		Font font = JFaceResources.getFont(PreferenceConstants.EDITOR_CONFIG_EDITOR_TEXT_FONT);
		fPreviewViewer.getTextWidget().setFont(font);
		new SourcePreviewerUpdater(fPreviewViewer, configuration, store);
		fPreviewViewer.setEditable(false);

		String content = loadPreviewContentFromFile("EditorConfigEditorColorSettingPreviewCode.txt"); //$NON-NLS-1$
		IDocument document = new Document(content);
		EditorConfigDocumentSetupParticipant.setupDocument(document);
		fPreviewViewer.setDocument(document);

		return fPreviewViewer.getControl();
	}
 
源代码5 项目: birt   文件: DecoratedScriptEditor.java
/**
 * Constructs a decorated script editor with the specified parent and the
 * specified script.
 * 
 * @param parent
 *            the parent editor.
 * @param script
 *            the script to edit
 */
public DecoratedScriptEditor( IEditorPart parent, String script )
{
	super( );
	this.parent = parent;
	this.sourceViewerConfiguration = new ScriptSourceViewerConfiguration( context );
	setSourceViewerConfiguration( this.sourceViewerConfiguration );
	setDocumentProvider( new ScriptDocumentProvider( parent ) );
	setScript( script );

	IPreferences preferences = PreferenceFactory.getInstance( )
			.getPreferences( ReportPlugin.getDefault( ) );
	if ( preferences instanceof PreferenceWrapper )
	{
		IPreferenceStore store = ( (PreferenceWrapper) preferences ).getPrefsStore( );
		if ( store != null )
		{
			IPreferenceStore baseEditorPrefs = EditorsUI.getPreferenceStore();
			setPreferenceStore( new ChainedPreferenceStore(new IPreferenceStore[]{store, baseEditorPrefs}) );
		}
	}
}
 
源代码6 项目: goclipse   文件: AbstractLangEditor.java
protected IPreferenceStore createCombinedPreferenceStore(IEditorInput input) {
	List<IPreferenceStore> stores = new ArrayList<IPreferenceStore>(4);
	
	IProject project = EditorUtils.getAssociatedProject(input);
	if (project != null) {
		stores.add(new EclipsePreferencesAdapter(new ProjectScope(project), LangUIPlugin.PLUGIN_ID));
	}
	
	stores.add(LangUIPlugin.getInstance().getPreferenceStore());
	stores.add(LangUIPlugin.getInstance().getCorePreferenceStore());
	
	alterCombinedPreferenceStores_beforeEditorsUI(stores);
	stores.add(EditorsUI.getPreferenceStore());
	
	return new ChainedPreferenceStore(ArrayUtil.createFrom(stores, IPreferenceStore.class));
}
 
源代码7 项目: xtext-eclipse   文件: PreferenceStoreAccessTest.java
@SuppressWarnings("deprecation")
@Test public void testChainedPreferenceStore() {
	ScopedPreferenceStore configurationStore = new ScopedPreferenceStore(new ConfigurationScope(), LANGUAGE_ID);
	configurationStore.setValue("someInt", 12);
	configurationStore.setValue("anotherInt", 12);
	configurationStore.setDefault("thirdInt", 12);
	ScopedPreferenceStore instanceStore = new ScopedPreferenceStore(new InstanceScope(), LANGUAGE_ID);
	instanceStore.setValue("someInt", 13);
	instanceStore.setDefault("anotherInt", 13);
	ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] { instanceStore, configurationStore });
	assertEquals(13, chainedStore.getInt("someInt"));
	assertEquals(13, chainedStore.getInt("anotherInt"));
	assertEquals(12, chainedStore.getInt("thirdInt"));
}
 
源代码8 项目: xtext-eclipse   文件: PreferenceStoreAccessImpl.java
@Override
public IPreferenceStore getPreferenceStore() {
	lazyInitialize();
	Activator activator = Activator.getDefault();
	if (activator != null)
		return new ChainedPreferenceStore(new IPreferenceStore[] {
				getWritablePreferenceStore(),
				activator.getPreferenceStore(), 
				EditorsUI.getPreferenceStore() });
	return new ChainedPreferenceStore(new IPreferenceStore[] {
			getWritablePreferenceStore(),
			EditorsUI.getPreferenceStore() });
}
 
源代码9 项目: xtext-eclipse   文件: PreferenceStoreAccessImpl.java
@Override
public IPreferenceStore getContextPreferenceStore(Object context) {
	lazyInitialize();
	// may be null on shutdown
	Activator activator = Activator.getDefault();
	if (activator != null)
		return new ChainedPreferenceStore(new IPreferenceStore[] { 
				getWritablePreferenceStore(context),
				activator.getPreferenceStore(),
				EditorsUI.getPreferenceStore()});
	return new ChainedPreferenceStore(new IPreferenceStore[] { 
			getWritablePreferenceStore(context),
			EditorsUI.getPreferenceStore()});
}
 
源代码10 项目: xtext-eclipse   文件: PreferenceStoreAccessor.java
@SuppressWarnings("all")
private ChainedPreferenceStore getPluginCssPreferenceStore() {
	return new ChainedPreferenceStore(new IPreferenceStore[] {
			new FixedScopedPreferenceStore(new InstanceScope(), plugin.getBundle().getSymbolicName()),
			new FixedScopedPreferenceStore(new InstanceScope(), Activator.getDefault().getBundle().getSymbolicName())
	});
}
 
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));
}
 
源代码12 项目: xtext-xtend   文件: XtendPreferenceStoreAccess.java
@SuppressWarnings("all")
@Override
public IPreferenceStore getPreferenceStore() {
	IPreferenceStore store = super.getPreferenceStore();
	FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(new InstanceScope(), JavaCore.PLUGIN_ID);
	jdtStore.setSearchContexts(new IScopeContext[] {
			new InstanceScope(),
			new ConfigurationScope()
	});
	return new ChainedPreferenceStore(new IPreferenceStore[] {
		store,
		jdtStore,
		PreferenceConstants.getPreferenceStore()
	});
}
 
源代码13 项目: typescript.java   文件: TypeScriptMergeViewer.java
private ChainedPreferenceStore createChainedPreferenceStore(IIDETypeScriptProject project) {
	ArrayList<IPreferenceStore> stores = new ArrayList<>(4);
	if (project != null) {
		stores.add(new EclipsePreferencesAdapter(new ProjectScope(project.getProject()),
				TypeScriptCorePlugin.PLUGIN_ID));
		stores.add(new EclipsePreferencesAdapter(new ProjectScope(project.getProject()),
				TypeScriptUIPlugin.PLUGIN_ID));
	}
	stores.add(JavaScriptPlugin.getDefault().getPreferenceStore());
	stores.add(new PreferencesAdapter(JavaScriptCore.getPlugin().getPluginPreferences()));
	stores.add(new PreferencesAdapter(JSDTTypeScriptUIPlugin.getDefault().getPluginPreferences()));
	stores.add(EditorsUI.getPreferenceStore());
	return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()]));
}
 
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()]));
}
 
/**
 * 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 IPreferenceStore createCombinedPreferenceStore(IEditorInput input) {
	List stores = new ArrayList();

	// IJavaScriptProject project= EditorUtility.getJavaProject(input);
	// if (project != null) {
	// stores.add(new EclipsePreferencesAdapter(new
	// ProjectScope(project.getProject()), JavaScriptCore.PLUGIN_ID));
	// }
	addPreferenceStores(stores, input);
	return new ChainedPreferenceStore((IPreferenceStore[]) stores.toArray(new IPreferenceStore[stores.size()]));
}
 
源代码16 项目: KaiZen-OpenAPI-Editor   文件: SwaggerEditor.java
public SwaggerEditor() {
    super(new SwaggerDocumentProvider(), //
            // ZEN-4361 Missing marker location indicators (Overview Ruler) next to editor
            // scrollbar in KZOE
            new ChainedPreferenceStore(new IPreferenceStore[] { //
                    Activator.getDefault().getPreferenceStore(), //
                    // Preferences store for EditorsPlugin has settings to show/hide the rules and
                    // markers
                    EditorsPlugin.getDefault().getPreferenceStore() }));

    getPreferenceStore().addPropertyChangeListener(validationChangeListener);
}
 
源代码17 项目: KaiZen-OpenAPI-Editor   文件: OpenApi3Editor.java
public OpenApi3Editor() {
    super(new OpenApi3DocumentProvider(), //
            // ZEN-4361 Missing marker location indicators (Overview Ruler) next to editor
            // scrollbar in KZOE
            new ChainedPreferenceStore(new IPreferenceStore[] { //
                    Activator.getDefault().getPreferenceStore(), //
                    // Preferences store for EditorsPlugin has settings to show/hide the rules and
                    // markers
                    EditorsPlugin.getDefault().getPreferenceStore() }));

    getPreferenceStore().addPropertyChangeListener(validationChangeListener);
}
 
/**
 * @param composite
 */
public SourceViewer createSourcePreview(Composite composite, IScriptFormatterFactory factory)
{
	IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
	// TODO - Note that we pass the factory's preferences store and not calling to this.getPrefereceStore.
	// In case we decide to unify the preferences into the this plugin, we might need to change this.
	IPreferenceStore store = new ChainedPreferenceStore(new IPreferenceStore[] { factory.getPreferenceStore(),
			generalTextStore });
	SourceViewer fPreviewViewer = createPreviewViewer(composite, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL
			| SWT.BORDER, store);
	if (fPreviewViewer == null)
	{
		return null;
	}
	SourceViewerConfiguration configuration = (SourceViewerConfiguration) factory
			.createSimpleSourceViewerConfiguration(fColorManager, store, null, false);
	fPreviewViewer.configure(configuration);
	if (fPreviewViewer.getTextWidget().getTabs() == 0)
	{
		fPreviewViewer.getTextWidget().setTabs(4);
	}
	new ScriptSourcePreviewerUpdater(fPreviewViewer, configuration, store);
	fPreviewViewer.setEditable(false);
	IDocument document = new Document();
	fPreviewViewer.setDocument(document);
	IPartitioningConfiguration partitioningConfiguration = (IPartitioningConfiguration) factory
			.getPartitioningConfiguration();
	CompositePartitionScanner partitionScanner = new CompositePartitionScanner(
			partitioningConfiguration.createSubPartitionScanner(), new NullSubPartitionScanner(),
			new NullPartitionerSwitchStrategy());
	IDocumentPartitioner partitioner = new ExtendedFastPartitioner(partitionScanner,
			partitioningConfiguration.getContentTypes());
	partitionScanner.setPartitioner((IExtendedPartitioner) partitioner);
	partitioner.connect(document);
	document.setDocumentPartitioner(partitioner);
	return fPreviewViewer;
}
 
源代码19 项目: APICloud-Studio   文件: UserAgentManager.java
/**
 * Process the preference key value associated with UserAgentManager. This method is automatically called when the
 * singleton instance is created. If the preference key value is somehow manipulated outside of UserAgentManager
 * (and it shouldn't be), then this method will need to be invoked to update the in-memory cache of
 * nature/user-agent info.
 */
void loadPreference()
{
	// Grab preference value. We use a ChainedPreferenceStore to be able to migrate the preference location from the
	// UIEplPlugin to the CommonEditorPlugin (the new location that we will use to save the
	// IPreferenceConstants.USER_AGENT_PREFERENCE)
	ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] {
			CommonEditorPlugin.getDefault().getPreferenceStore(), UIEplPlugin.getDefault().getPreferenceStore() });
	String preferenceValue = chainedStore.getString(IPreferenceConstants.USER_AGENT_PREFERENCE);

	Map<String, String[]> result;
	if (!StringUtil.isEmpty(preferenceValue))
	{
		result = extractUserAgents(preferenceValue);
	}
	else
	{
		result = new HashMap<String, String[]>();
		// set defaults
		for (String natureID : ResourceUtil.getAptanaNaturesMap().values())
		{
			result.put(natureID, getDefaultUserAgentIDs(natureID));
		}
	}

	// cache result
	ACTIVE_USER_AGENTS_BY_NATURE_ID = result;
}
 
源代码20 项目: APICloud-Studio   文件: EditorUtil.java
public static int getDefaultSpaceIndentSize(String preferencesQualifier)
{
	int spaceIndentSize = 0;
	if (CommonEditorPlugin.getDefault() != null && EditorsPlugin.getDefault() != null)
	{
		spaceIndentSize = new ChainedPreferenceStore(new IPreferenceStore[] {
				CommonEditorPlugin.getDefault().getPreferenceStore(),
				EditorsPlugin.getDefault().getPreferenceStore() })
				.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
	}
	return (spaceIndentSize > 0) ? spaceIndentSize : DEFAULT_SPACE_INDENT_SIZE;
}
 
/**
 * Creates and returns a preference store which combines the preference
 * stores from the text tools and which is read-only.
 *
 * @param javaTextTools the Java text tools
 * @return the combined read-only preference store
 * @since 3.0
 */
private static final IPreferenceStore createPreferenceStore(JavaTextTools javaTextTools) {
	Assert.isNotNull(javaTextTools);
	IPreferenceStore generalTextStore= EditorsUI.getPreferenceStore();
	if (javaTextTools.getCorePreferenceStore() == null)
		return new ChainedPreferenceStore(new IPreferenceStore[] { javaTextTools.getPreferenceStore(), generalTextStore});

	return new ChainedPreferenceStore(new IPreferenceStore[] { javaTextTools.getPreferenceStore(), new PreferencesAdapter(javaTextTools.getCorePreferenceStore()), generalTextStore });
}
 
public JavaPreview(Map<String, String> workingValues, Composite parent) {
		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
		fPreviewDocument= new Document();
		fWorkingValues= workingValues;
		tools.setupJavaDocumentPartitioner( fPreviewDocument, IJavaPartitions.JAVA_PARTITIONING);

		PreferenceStore prioritizedSettings= new PreferenceStore();
		HashMap<String, String> complianceOptions= new HashMap<String, String>();
		JavaModelUtil.setComplianceOptions(complianceOptions, JavaModelUtil.VERSION_LATEST);
		for (Entry<String, String> complianceOption : complianceOptions.entrySet()) {
			prioritizedSettings.setValue(complianceOption.getKey(), complianceOption.getValue());
		}

		IPreferenceStore[] chain= { prioritizedSettings, JavaPlugin.getDefault().getCombinedPreferenceStore() };
		fPreferenceStore= new ChainedPreferenceStore(chain);
		fSourceViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, fPreferenceStore);
		fSourceViewer.setEditable(false);
		Cursor arrowCursor= fSourceViewer.getTextWidget().getDisplay().getSystemCursor(SWT.CURSOR_ARROW);
		fSourceViewer.getTextWidget().setCursor(arrowCursor);

		// Don't set caret to 'null' as this causes https://bugs.eclipse.org/293263
//		fSourceViewer.getTextWidget().setCaret(null);

		fViewerConfiguration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), fPreferenceStore, null, IJavaPartitions.JAVA_PARTITIONING, true);
		fSourceViewer.configure(fViewerConfiguration);
		fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));

		fMarginPainter= new MarginPainter(fSourceViewer);
		final RGB rgb= PreferenceConverter.getColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR);
		fMarginPainter.setMarginRulerColor(tools.getColorManager().getColor(rgb));
		fSourceViewer.addPainter(fMarginPainter);

		new JavaSourcePreviewerUpdater();
		fSourceViewer.setDocument(fPreviewDocument);
	}
 
private Control createPreviewer(Composite parent) {

		IPreferenceStore generalTextStore= EditorsUI.getPreferenceStore();
		IPreferenceStore store= new ChainedPreferenceStore(new IPreferenceStore[] { getPreferenceStore(), new PreferencesAdapter(createTemporaryCorePreferenceStore()), generalTextStore });
		fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.H_SCROLL | SWT.BORDER, store);
		SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(fColorManager, store, null, IJavaPartitions.JAVA_PARTITIONING, false);
		fPreviewViewer.configure(configuration);
		// fake 1.5 source to get 1.5 features right.
		configuration.handlePropertyChangeEvent(new PropertyChangeEvent(this, JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4, JavaCore.VERSION_1_5));
		Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
		fPreviewViewer.getTextWidget().setFont(font);
		new JavaSourcePreviewerUpdater(fPreviewViewer, configuration, store);

		fPreviewViewer.setEditable(false);
		Cursor arrowCursor= fPreviewViewer.getTextWidget().getDisplay().getSystemCursor(SWT.CURSOR_ARROW);
		fPreviewViewer.getTextWidget().setCursor(arrowCursor);

		// Don't set caret to 'null' as this causes https://bugs.eclipse.org/293263
//		fPreviewViewer.getTextWidget().setCaret(null);

		String content= loadPreviewContentFromFile("ColorSettingPreviewCode.txt"); //$NON-NLS-1$
		IDocument document= new Document(content);
		JavaPlugin.getDefault().getJavaTextTools().setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
		fPreviewViewer.setDocument(document);

		installSemanticHighlighting();


		return fPreviewViewer.getControl();
	}
 
private ChainedPreferenceStore createChainedPreferenceStore(IJavaProject project) {
  	ArrayList<IPreferenceStore> stores= new ArrayList<IPreferenceStore>(4);
  	if (project != null)
  		stores.add(new EclipsePreferencesAdapter(new ProjectScope(project.getProject()), JavaCore.PLUGIN_ID));
stores.add(JavaPlugin.getDefault().getPreferenceStore());
stores.add(new PreferencesAdapter(JavaPlugin.getJavaCorePluginPreferences()));
stores.add(EditorsUI.getPreferenceStore());
return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()]));
  }
 
源代码25 项目: Pydev   文件: PyContentMergeViewerCreator.java
/**
 * Creates a new configuration with the pydev preference store so that the colors appear correctly when using
 * Aptana themes.
 * 
 * Also copies the available data from the original compare configuration to the new configuration.
 */
private CompareConfiguration createNewCompareConfiguration(CompareConfiguration mp) {
    List<IPreferenceStore> stores = PyDevUiPrefs.getDefaultStores(false);
    IPreferenceStore prefs = mp.getPreferenceStore();
    if (prefs != null) {
        //Note, we could use the CompareUIPlugin.getDefault().getPreferenceStore() directly, but it's access
        //is restricted, so, we go to the preferences of the previously created compare configuration.
        stores.add(prefs);
    }

    CompareConfiguration cc = new CompareConfiguration(new ChainedPreferenceStore(
            stores.toArray(new IPreferenceStore[stores.size()])));
    cc.setAncestorImage(mp.getAncestorImage(null));
    cc.setAncestorLabel(mp.getAncestorLabel(null));

    cc.setLeftImage(mp.getLeftImage(null));
    cc.setLeftLabel(mp.getLeftLabel(null));
    cc.setLeftEditable(mp.isLeftEditable());

    cc.setRightImage(mp.getRightImage(null));
    cc.setRightLabel(mp.getRightLabel(null));
    cc.setRightEditable(mp.isRightEditable());

    try {
        cc.setContainer(mp.getContainer());
    } catch (Throwable e) {
        //Ignore: not available in Eclipse 3.2.
    }

    return cc;
}
 
源代码26 项目: xtext-eclipse   文件: AbstractDetailsPart.java
@Override
protected final IPreferenceStore doGetPreferenceStore() {
	return new ChainedPreferenceStore(new IPreferenceStore[] { internalStore, masterPreferenceStore });
}
 
源代码27 项目: APICloud-Studio   文件: XMLEditor.java
public static IPreferenceStore getChainedPreferenceStore()
{
	return new ChainedPreferenceStore(new IPreferenceStore[] { XMLPlugin.getDefault().getPreferenceStore(),
			CommonEditorPlugin.getDefault().getPreferenceStore(), EditorsPlugin.getDefault().getPreferenceStore() });
}
 
源代码28 项目: APICloud-Studio   文件: JSSourceEditor.java
public static IPreferenceStore getChainedPreferenceStore()
{
	return new ChainedPreferenceStore(new IPreferenceStore[] { JSPlugin.getDefault().getPreferenceStore(),
			CommonEditorPlugin.getDefault().getPreferenceStore(), EditorsPlugin.getDefault().getPreferenceStore() });
}
 
源代码29 项目: APICloud-Studio   文件: DTDEditor.java
public static IPreferenceStore getChainedPreferenceStore()
{
	return new ChainedPreferenceStore(new IPreferenceStore[] { DTDPlugin.getDefault().getPreferenceStore(),
			CommonEditorPlugin.getDefault().getPreferenceStore(), EditorsPlugin.getDefault().getPreferenceStore() });
}
 
源代码30 项目: APICloud-Studio   文件: CSSSourceEditor.java
public static IPreferenceStore getChainedPreferenceStore()
{
	return new ChainedPreferenceStore(new IPreferenceStore[] { CSSPlugin.getDefault().getPreferenceStore(),
			CommonEditorPlugin.getDefault().getPreferenceStore(), EditorsPlugin.getDefault().getPreferenceStore() });
}
 
 类所在包
 同包方法