本文整理汇总了Java中org.eclipse.ui.texteditor.ChainedPreferenceStore类的典型用法代码示例。如果您正苦于以下问题:Java ChainedPreferenceStore类的具体用法?Java ChainedPreferenceStore怎么用?Java ChainedPreferenceStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChainedPreferenceStore类属于org.eclipse.ui.texteditor包,在下文中一共展示了ChainedPreferenceStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BatchSourceViewerConfiguration
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
/**
* Creates configuration by given adaptable
*
* @param adaptable
* must provide {@link ColorManager} and {@link IFile}
*/
public BatchSourceViewerConfiguration(IAdaptable adaptable) {
IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
this.fPreferenceStore = new ChainedPreferenceStore(
new IPreferenceStore[] { getPreferences().getPreferenceStore(), generalTextStore });
Assert.isNotNull(adaptable, "adaptable may not be null!");
this.annotationHoover = new BatchEditorAnnotationHoover();
this.contentAssistant = new ContentAssistant();
contentAssistProcessor = new BatchEditorSimpleWordContentAssistProcessor();
contentAssistant.enableColoredLabels(true);
contentAssistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
for (BatchDocumentIdentifier identifier: BatchDocumentIdentifiers.values()){
contentAssistant.setContentAssistProcessor(contentAssistProcessor, identifier.getId());
}
contentAssistant.addCompletionListener(contentAssistProcessor.getCompletionListener());
this.colorManager = adaptable.getAdapter(ColorManager.class);
Assert.isNotNull(colorManager, " adaptable must support color manager");
this.defaultTextAttribute = new TextAttribute(
colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
this.adaptable=adaptable;
}
示例2: BashSourceViewerConfiguration
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
/**
* Creates configuration by given adaptable
*
* @param adaptable
* must provide {@link ColorManager} and {@link IFile}
*/
public BashSourceViewerConfiguration(IAdaptable adaptable) {
IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
this.fPreferenceStore = new ChainedPreferenceStore(
new IPreferenceStore[] { getPreferences().getPreferenceStore(), generalTextStore });
Assert.isNotNull(adaptable, "adaptable may not be null!");
this.annotationHoover = new BashEditorAnnotationHoover();
this.contentAssistant = new ContentAssistant();
contentAssistProcessor = new BashEditorSimpleWordContentAssistProcessor();
contentAssistant.enableColoredLabels(true);
contentAssistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
for (BashDocumentIdentifier identifier: BashDocumentIdentifiers.values()){
contentAssistant.setContentAssistProcessor(contentAssistProcessor, identifier.getId());
}
contentAssistant.addCompletionListener(contentAssistProcessor.getCompletionListener());
this.colorManager = adaptable.getAdapter(ColorManager.class);
Assert.isNotNull(colorManager, " adaptable must support color manager");
this.defaultTextAttribute = new TextAttribute(
colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
this.adaptable=adaptable;
}
示例3: contributeToPreferenceStore
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
public static IPreferenceStore contributeToPreferenceStore(ITextEditor textEditor,
IPreferenceStore preferenceStore) {
try {
// Get old store
IPreferenceStore oldStore = getPreferenceStore(textEditor);
// Create chained store with preference store to add
IPreferenceStore newStore = new ChainedPreferenceStore(
new IPreferenceStore[] { preferenceStore, oldStore });
// Update the text editor with new preference store
setPreferenceStoreOfTextEditor(textEditor, newStore);
// Update the source viewer configuration with new preference store
setPreferenceStoreOfSourceViewerConfiguration(textEditor, newStore);
return newStore;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
示例4: createCombinedPreferenceStore
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
/**
* 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()]));
}
示例5: createPreviewer
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
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();
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:PropertiesFileEditorPreferencePage.java
示例6: createPreviewer
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
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();
}
示例7: createPreviewer
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
private NSISSourceViewer createPreviewer(Composite parent)
{
NSISSourceViewer previewer = new NSISSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL
| SWT.BORDER | SWT.WRAP);
NSISTextUtility.hookSourceViewer(previewer);
SourceViewerConfiguration configuration = new NSISSourceViewerConfiguration(
new ChainedPreferenceStore(new IPreferenceStore[] { NSISPreferences.getInstance().getPreferenceStore(),
EditorsUI.getPreferenceStore() }));
previewer.configure(configuration);
new NSISDocumentSetupParticipant().setup(mCommandDoc);
previewer.setDocument(mCommandDoc);
previewer.setEditable(false);
final StyledText textWidget = previewer.getTextWidget();
textWidget.getCaret().setVisible(false);
textWidget.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e)
{
textWidget.setSelectionRange(e.x, 0);
}
});
return previewer;
}
示例8: createPreviewer
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
private Control createPreviewer(Composite parent)
{
mPreviewer= new NSISSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
NSISTextUtility.hookSourceViewer(mPreviewer);
SourceViewerConfiguration configuration= new NSISSourceViewerConfiguration(new ChainedPreferenceStore(new IPreferenceStore[]{mPreferenceStore,getPreferenceStore(), EditorsUI.getPreferenceStore()}));
mPreviewer.configure(configuration);
InputStream is = null;
String content= ""; //$NON-NLS-1$
try {
is = getClass().getResourceAsStream("NSISPreview.txt"); //$NON-NLS-1$
content= new String(IOUtility.loadContentFromStream(is));
}
catch(Exception e) {
EclipseNSISPlugin.getDefault().log(e);
}
finally {
IOUtility.closeIO(is);
}
IDocument document= new Document(content);
new NSISDocumentSetupParticipant().setup(document);
mPreviewer.setDocument(document);
mPreviewer.setEditable(false);
return mPreviewer.getControl();
}
示例9: createViewer
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
@Override
protected SourceViewer createViewer(Composite parent)
{
mViewer = new NSISTemplateSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
NSISTextUtility.hookSourceViewer(mViewer);
SourceViewerConfiguration configuration = new NSISTemplateSourceViewerConfiguration(new ChainedPreferenceStore(
new IPreferenceStore[] { getPreferenceStore(), EditorsUI.getPreferenceStore() }));
mViewer.configure(configuration);
IDocument document = new Document();
new NSISDocumentSetupParticipant().setup(document);
mViewer.setDocument(document);
mViewer.setEditable(false);
return mViewer;
}
示例10: DecoratedScriptEditor
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
/**
* 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}) );
}
}
}
示例11: createCombinedPreferenceStore
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
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));
}
示例12: providePreferenceStore
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
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));
}
示例13: createPreviewer
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
private Control createPreviewer(Composite parent) {
IPreferenceStore generalTextStore = FluentMkUI.getDefault().getPreferenceStore();
IPreferenceStore store = new ChainedPreferenceStore(new IPreferenceStore[] { getPreferenceStore(),
new PreferencesAdapter(createTemporaryCorePreferenceStore()), generalTextStore });
fPreviewViewer = new FluentMkSourceViewer(parent, null, null, false, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER,
store);
FluentMkSimpleSourceViewerConfiguration configuration = new FluentMkSimpleSourceViewerConfiguration(
fColorManager, store, null, Partitions.MK_PARTITIONING, false);
fPreviewViewer.configure(configuration);
Font font = JFaceResources.getFont(Prefs.EDITOR_TEXT_FONT);
fPreviewViewer.getTextWidget().setFont(font);
new PreviewSourceUpdater(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("ColorsPreview.md"); //$NON-NLS-1$
IDocument document = new Document(content);
FluentMkUI.getDefault().getTextTools().setupDocumentPartitioner(document, Partitions.MK_PARTITIONING);
fPreviewViewer.setDocument(document);
return fPreviewViewer.getControl();
}
示例14: createChainedPreferenceStore
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
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()]));
}
示例15: createProjectSpecificPreferenceStore
import org.eclipse.ui.texteditor.ChainedPreferenceStore; //导入依赖的package包/类
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()]));
}