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


Java MarginPainter类代码示例

本文整理汇总了Java中org.eclipse.jface.text.MarginPainter的典型用法代码示例。如果您正苦于以下问题:Java MarginPainter类的具体用法?Java MarginPainter怎么用?Java MarginPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createMarginPainter

import org.eclipse.jface.text.MarginPainter; //导入依赖的package包/类
/**
 * Create margin painter and add to source viewer
 */
protected void createMarginPainter() {
	MarginPainter marginPainter = new MarginPainter(sourceViewer);
	marginPainter.setMarginRulerColumn(MAX_LINE_WIDTH);
	marginPainter.setMarginRulerColor(Display.getDefault().getSystemColor(
			SWT.COLOR_GRAY));
	sourceViewer.addPainter(marginPainter);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:11,代码来源:SpellcheckableMessageArea.java

示例2: JavaPreview

import org.eclipse.jface.text.MarginPainter; //导入依赖的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


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