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


Java CompositeRuler类代码示例

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


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

示例1: invoke

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@Override
public Object invoke(Object obj, Method thisMethod, Method proceed, Object[] args) throws Throwable {
	if ("createControl".equals(thisMethod.getName())) {
		CompositeRuler parentRuler = (CompositeRuler) args[0];
		this.fCachedTextViewer = parentRuler.getTextViewer();
		this.fCachedTextWidget = fCachedTextViewer.getTextWidget();
	} else if ("setDisplayMode".equals(thisMethod.getName())) {
		this.fCharacterDisplay = (boolean) args[0];
	} else if ("doPaint".equals(thisMethod.getName()) && args.length > 1) {
		GC gc = (GC) args[0];
		ILineRange visibleLines = (ILineRange) args[1];

		if (fRevisionPainter == null) {
			fRevisionPainter = getValue("fRevisionPainter", obj);
			fDiffPainter = getValue("fDiffPainter", obj);
		}

		LineNumberChangeRulerColumn l = ((LineNumberChangeRulerColumn) obj);
		doPaint(gc, visibleLines, l);
		return null;
	}
	return proceed.invoke(obj, args);
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:24,代码来源:LineNumberChangeRulerColumnPatch.java

示例2: handlePreferenceStoreChanged

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@Override
protected void handlePreferenceStoreChanged(final PropertyChangeEvent event) {
	final LineNumberColumn c;
	super.handlePreferenceStoreChanged(event);
	if (event.getProperty().equals(PREFERENCE_COLOR_BACKGROUND)) {
		// this.fSourceViewerDecorationSupport.updateOverviewDecorations();

		this.getVerticalRuler().getControl()
				.setBackground(GamaColors.get(AutoStartup.EDITOR_BACKGROUND_COLOR.getValue()).color());

		final Iterator e = ((CompositeRuler) getVerticalRuler()).getDecoratorIterator();
		while (e.hasNext()) {
			final IVerticalRulerColumn column = (IVerticalRulerColumn) e.next();
			column.getControl()
					.setBackground(GamaColors.get(AutoStartup.EDITOR_BACKGROUND_COLOR.getValue()).color());
			column.redraw();
		}
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:20,代码来源:GamlEditor.java

示例3: SqlSourceViewer

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
public SqlSourceViewer(Composite parent, int style) {
    super(parent, new CompositeRuler(),
            SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | style);
    this.setRangeIndicator(new DefaultRangeIndicator());
    this.configure(new SQLEditorSourceViewerConfiguration(EditorsUI
            .getSharedTextColors(), Activator.getDefault()
            .getPreferenceStore(), null));

    this.getTextWidget().setFont(JFaceResources.getTextFont());
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:11,代码来源:SqlSourceViewer.java

示例4: createPartControl

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@Override
public void createPartControl(Composite composite) {
	SourceViewer sourceViewer = (SourceViewer) createTypeScriptSourceViewer(composite, new CompositeRuler(),
			null, false, fTextOrientation | SWT.H_SCROLL | SWT.V_SCROLL, createChainedPreferenceStore(null));
	setSourceViewer(this, sourceViewer);
	createNavigationActions();
	getSelectionProvider().addSelectionChangedListener(getSelectionChangedListener());
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:9,代码来源:TypeScriptMergeViewer.java

示例5: createControl

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@Override
public Control createControl(CompositeRuler parentRuler,
		Composite parentControl) {
	Control control = super.createControl(parentRuler, parentControl);
	setBackground(BTSUIConstants.COLOR_RULER_COLUMN_BACKGROUND);
	return control;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:8,代码来源:EgyLineNumberRulerColumn.java

示例6: overrideRulerColors

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void overrideRulerColors()
{
	IThemeableEditor editor = this.fEditor.get();

	// default to bg color of surrounding composite
	Color bg = null;
	// Use editor background color if we can
	if (editor != null)
	{
		ISourceViewer sv = editor.getISourceViewer();
		if (sv != null)
		{
			StyledText text = sv.getTextWidget();
			if (text != null)
			{
				bg = text.getBackground();
				// copy the color because for some reason it gets disposed
				bg = ThemePlugin.getDefault().getColorManager().getColor(bg.getRGB());
			}
		}

		// force the colors for all the ruler columns (specifically so we force the folding bg to match).
		CompositeRuler ruler = (CompositeRuler) editor.getIVerticalRuler();
		Iterator<IVerticalRulerColumn> iter = ruler.getDecoratorIterator();
		while (iter.hasNext())
		{
			IVerticalRulerColumn column = iter.next();
			column.getControl().setBackground(bg);
		}
	}

	if (fLineColumn != null)
	{
		fLineColumn.setBackground(bg);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:38,代码来源:ThemeableEditorExtension.java

示例7: createAnnotationRulerColumn

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@Override
protected IVerticalRulerColumn createAnnotationRulerColumn(CompositeRuler ruler) {
	if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER))
		return super.createAnnotationRulerColumn(ruler);

	AnnotationRulerColumn column= new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
	column.setHover(new JavaExpandHover(ruler, getAnnotationAccess(), new IDoubleClickListener() {

		public void doubleClick(DoubleClickEvent event) {
			// for now: just invoke ruler double click action
			triggerAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK);
		}

		private void triggerAction(String actionID) {
			IAction action= getAction(actionID);
			if (action != null) {
				if (action instanceof IUpdate)
					((IUpdate) action).update();
				// hack to propagate line change
				if (action instanceof ISelectionListener) {
					((ISelectionListener)action).selectionChanged(null, null);
				}
				if (action.isEnabled())
					action.run();
			}
		}

	}));

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

示例8: createPartControl

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
@Override
public void createPartControl(Composite composite) {
	SourceViewer sourceViewer= (SourceViewer)createJavaSourceViewer(composite, new CompositeRuler(), null, false, fTextOrientation | SWT.H_SCROLL | SWT.V_SCROLL, createChainedPreferenceStore(null));
	setSourceViewer(this, sourceViewer);
	createNavigationActions();
	getSelectionProvider().addSelectionChangedListener(getSelectionChangedListener());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:JavaMergeViewer.java

示例9: createCompositeRuler

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
/**
 * Creates a new line number ruler column that is appropriately initialized.
 * 
 * @return the created line number column
 */
private CompositeRuler createCompositeRuler( )
{
	CompositeRuler ruler = new CompositeRuler( );

	ruler.setModel( new AnnotationModel( ) );
	return ruler;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ScriptEditor.java

示例10: createVerticalRuler

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
/**
 * Creates the vertical ruler to be used by this editor.
 * 
 * @return the vertical ruler
 */
protected IVerticalRuler createVerticalRuler( )
{
	CompositeRuler ruler = createCompositeRuler( );

	ruler.addDecorator( 0, createLineNumberRulerColumn( ) );
	return ruler;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ScriptEditor.java

示例11: createVerticalRuler

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
/**
 * Creates the vertical ruler to be used by this editor.
 * 
 * @return the vertical ruler
 */
private IVerticalRuler createVerticalRuler( )
{
	IVerticalRuler ruler = createCompositeRuler( );

	if ( ruler instanceof CompositeRuler )
	{
		CompositeRuler compositeRuler = (CompositeRuler) ruler;

		compositeRuler.addDecorator( 0, createLineNumberRulerColumn( ) );
	}
	return ruler;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ExpressionBuilder.java

示例12: getCpAnnotationRuler

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
public static CompositeRuler getCpAnnotationRuler() {
	return cpAnnotationRuler;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:4,代码来源:EmbeddedEditorFactory.java

示例13: setCpAnnotationRuler

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
public static void setCpAnnotationRuler(CompositeRuler cpAnnotationRuler) {
	EmbeddedEditorFactory.cpAnnotationRuler = cpAnnotationRuler;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:4,代码来源:EmbeddedEditorFactory.java

示例14: createPartControl

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
public void createPartControl(Composite parent)
{
	int VERTICAL_RULER_WIDTH = 12;

	int styles = SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
	ISharedTextColors sharedColors = EditorsPlugin.getDefault().getSharedTextColors();
	IOverviewRuler overviewRuler = new OverviewRuler(null, VERTICAL_RULER_WIDTH, sharedColors);
	CompositeRuler ruler = new CompositeRuler(VERTICAL_RULER_WIDTH);

	_document = new Document();
	_document.set(_docString);

	_annotationModel = new AnnotationModel();
	_annotationModel.connect(_document);

	_sourceViewer = new SourceViewer(parent, ruler, overviewRuler, true, styles);
	_sourceViewer.configure(new SourceViewerConfiguration());

	_sds = new SourceViewerDecorationSupport(_sourceViewer, overviewRuler, null, sharedColors);

	AnnotationPreference ap = new AnnotationPreference();
	ap.setColorPreferenceKey(ANNO_KEY_COLOR);
	ap.setHighlightPreferenceKey(ANNO_KEY_HIGHLIGHT);
	ap.setVerticalRulerPreferenceKey(ANNO_KEY_VERTICAL);
	ap.setOverviewRulerPreferenceKey(ANNO_KEY_OVERVIEW);
	ap.setTextPreferenceKey(ANNO_KEY_TEXT);
	ap.setAnnotationType(ANNO_TYPE);
	_sds.setAnnotationPreference(ap);

	//		_sds.install(EditorsPlugin.getDefault().getPreferenceStore());

	_sourceViewer.setDocument(_document, _annotationModel);

	_sourceViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	ruler.addDecorator(0, new LineNumberRulerColumn());

	Annotation annotation = new Annotation(false);
	annotation.setType(ANNO_TYPE);
	Position position = new Position(0, 4);
	_annotationModel.addAnnotation(annotation, position);
	parent.layout();
}
 
开发者ID:cplutte,项目名称:bts,代码行数:44,代码来源:WrappedSourceViewer.java

示例15: createControl

import org.eclipse.jface.text.source.CompositeRuler; //导入依赖的package包/类
public Control createControl(CompositeRuler parentRuler, Composite parentControl) {
	Control control= super.createControl(parentRuler, parentControl);
	fRevisionPainter.setParentRuler(parentRuler);
	fDiffPainter.setParentRuler(parentRuler);
	return control;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:7,代码来源:CommonLineNumberChangeRulerColumn.java


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