本文整理汇总了Java中org.eclipse.jface.text.MarginPainter.setMarginRulerColor方法的典型用法代码示例。如果您正苦于以下问题:Java MarginPainter.setMarginRulerColor方法的具体用法?Java MarginPainter.setMarginRulerColor怎么用?Java MarginPainter.setMarginRulerColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.MarginPainter
的用法示例。
在下文中一共展示了MarginPainter.setMarginRulerColor方法的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);
}
示例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);
}