当前位置: 首页>>代码示例>>Java>>正文


Java JavaTextTools.getColorManager方法代码示例

本文整理汇总了Java中org.eclipse.jdt.ui.text.JavaTextTools.getColorManager方法的典型用法代码示例。如果您正苦于以下问题:Java JavaTextTools.getColorManager方法的具体用法?Java JavaTextTools.getColorManager怎么用?Java JavaTextTools.getColorManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.ui.text.JavaTextTools的用法示例。


在下文中一共展示了JavaTextTools.getColorManager方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPatternViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
@Override
protected SourceViewer createPatternViewer(Composite parent) {
	IDocument document= new Document();
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	JavaSourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL, store);
	SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, false);
	viewer.configure(configuration);
	viewer.setEditable(false);
	viewer.setDocument(document);

	Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
	viewer.getTextWidget().setFont(font);
	new JavaSourcePreviewerUpdater(viewer, configuration, store);

	Control control= viewer.getControl();
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
	control.setLayoutData(data);

	viewer.setEditable(false);
	return viewer;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:JavaTemplatesPage.java

示例2: createViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
@Override
protected SourceViewer createViewer(Composite parent) {
	IDocument document= new Document();
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, store);
	SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, false);
	viewer.configure(configuration);
	viewer.setEditable(false);
	viewer.setDocument(document);

	Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
	viewer.getTextWidget().setFont(font);
	new JavaSourcePreviewerUpdater(viewer, configuration, store);

	Control control= viewer.getControl();
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
	control.setLayoutData(data);

	return viewer;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:JavaTemplatePreferencePage.java

示例3: initialize

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
private void initialize() {

		initializeFields();

		for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++)
			fHighlightingColorList.add(new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1], fSyntaxColorListModel[i][1] + BOLD, fSyntaxColorListModel[i][1] + ITALIC, fSyntaxColorListModel[i][1] + STRIKETHROUGH, fSyntaxColorListModel[i][1] + UNDERLINE, null));

		fHighlightingColorListViewer.setInput(fHighlightingColorList);
		fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0)));

		// Make sure we propagate the colors to the shared color manager
		IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		PropertiesFileSourceViewerConfiguration sharedPropertiesFileSourceViewerConfiguration= new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING);
		new SourcePreviewerUpdater(fPreviewViewer, sharedPropertiesFileSourceViewerConfiguration, store);

	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:PropertiesFileEditorPreferencePage.java

示例4: JavaPreview

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
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);
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:36,代码来源:JavaPreview.java

示例5: getContentAssistant

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

	IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	IColorManager manager= textTools.getColorManager();


	ContentAssistant assistant= new ContentAssistant();
	assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
		// Register the same processor for strings and single line comments to get code completion at the start of those partitions.
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_STRING);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_CHARACTER);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_DOC);

	assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT));
	assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));
	assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
	assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
	assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
	assistant.setInformationControlCreator(new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString());
		}
	});

	Color background= getColor(store, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, manager);
	assistant.setContextInformationPopupBackground(background);
	assistant.setContextSelectorBackground(background);

	Color foreground= getColor(store, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, manager);
	assistant.setContextInformationPopupForeground(foreground);
	assistant.setContextSelectorForeground(foreground);

	return assistant;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:39,代码来源:CodeTemplateSourceViewerConfiguration.java

示例6: createViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
private SourceViewer createViewer(Composite parent, int nColumns) {
		Label label= new Label(parent, SWT.NONE);
		label.setText(PreferencesMessages.CodeTemplateBlock_preview);
		GridData data= new GridData();
		data.horizontalSpan= nColumns;
		label.setLayoutData(data);

		IDocument document= new Document();
		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
		tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
		IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
		SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, store);
		CodeTemplateSourceViewerConfiguration configuration= new CodeTemplateSourceViewerConfiguration(tools.getColorManager(), store, null, fTemplateProcessor);
		viewer.configure(configuration);

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

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

		viewer.setDocument(document);

		Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
		viewer.getTextWidget().setFont(font);
		new JavaSourcePreviewerUpdater(viewer, configuration, store);

		Control control= viewer.getControl();
		data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
		data.horizontalSpan= nColumns;
		data.heightHint= fPixelConverter.convertHeightInCharsToPixels(5);
		control.setLayoutData(data);

		return viewer;
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:37,代码来源:CodeTemplateBlock.java

示例7: initializeEditor

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
@Override
protected void initializeEditor() {
    super.initializeEditor();

    // install java source viewer configuration to allow java syntax highlighting
    JavaTextTools javaTextTools = JavaPlugin.getDefault().getJavaTextTools();
    JavaSourceViewerConfiguration sourceViewerConfiguration = new JavaSourceViewerConfiguration(
            javaTextTools.getColorManager(), JavaPlugin.getDefault().getCombinedPreferenceStore(), this,
            IJavaPartitions.JAVA_PARTITIONING);
    setSourceViewerConfiguration(sourceViewerConfiguration);
    
    
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:14,代码来源:UnifiedDiffEditor.java

示例8: createJavaSourceViewerConfiguration

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
@Override
protected JavaSourceViewerConfiguration createJavaSourceViewerConfiguration() {
  JavaTextTools textTools = JavaPlugin.getDefault().getJavaTextTools();
  return new GWTSourceViewerConfiguration(textTools.getColorManager(),
      getPreferenceStore(), this);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:7,代码来源:GWTJavaEditor.java

示例9: configure

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
/**
 * Configure the given content assistant from the given store.
 *
 * @param assistant the content assistant
 * @param store the preference store
 */
public static void configure(ContentAssistant assistant, IPreferenceStore store) {

	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	IColorManager manager= textTools.getColorManager();


	boolean enabled= store.getBoolean(AUTOACTIVATION);
	assistant.enableAutoActivation(enabled);

	int delay= store.getInt(AUTOACTIVATION_DELAY);
	assistant.setAutoActivationDelay(delay);

	Color c= getColor(store, PARAMETERS_FOREGROUND, manager);
	assistant.setContextInformationPopupForeground(c);
	assistant.setContextSelectorForeground(c);

	c= getColor(store, PARAMETERS_BACKGROUND, manager);
	assistant.setContextInformationPopupBackground(c);
	assistant.setContextSelectorBackground(c);

	enabled= store.getBoolean(AUTOINSERT);
	assistant.enableAutoInsert(enabled);

	enabled= store.getBoolean(PREFIX_COMPLETION);
	assistant.enablePrefixCompletion(enabled);

	enabled= store.getBoolean(USE_COLORED_LABELS);
	assistant.enableColoredLabels(enabled);


	configureJavaProcessor(assistant, store);
	configureJavaDocProcessor(assistant, store);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:40,代码来源:ContentAssistPreference.java

示例10: createJavaSourceViewerConfiguration

import org.eclipse.jdt.ui.text.JavaTextTools; //导入方法依赖的package包/类
/**
 * Returns a new Java source viewer configuration.
 *
 * @return a new <code>JavaSourceViewerConfiguration</code>
 * @since 3.3
 */
protected JavaSourceViewerConfiguration createJavaSourceViewerConfiguration() {
	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	return new JavaSourceViewerConfiguration(textTools.getColorManager(), getPreferenceStore(), this, IJavaPartitions.JAVA_PARTITIONING);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:JavaEditor.java


注:本文中的org.eclipse.jdt.ui.text.JavaTextTools.getColorManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。