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


Java ITextViewerExtension2类代码示例

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


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

示例1: registerAutoEditVetoer

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
/**
 * Registers our auto edit vetoer with the viewer.
 *
 * @param viewer
 *            the viewer we want to veto ui-triggered changes within linked
 *            positions
 */
private void registerAutoEditVetoer(ITextViewer viewer) {
	try {
		String[] contentTypes = getContentTypes(viewer.getDocument());
		if (viewer instanceof ITextViewerExtension2) {
			ITextViewerExtension2 vExtension = ((ITextViewerExtension2) viewer);
			for (int i = 0; i < contentTypes.length; i++) {
				vExtension.prependAutoEditStrategy(fAutoEditVetoer, contentTypes[i]);
			}
		} else {
			Assert.isTrue(false);
		}

	} catch (BadPartitioningException e) {
		leave(ILinkedModeListener.EXIT_ALL);
	}
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:24,代码来源:TweakedLinkedModeUI.java

示例2: configureSourceViewer

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
@Override
protected void configureSourceViewer(ISourceViewer sourceViewer) {
	sourceViewer.setEditable(false);
	sourceViewer.configure(sourceViewerConfiguration);
	if (sourceViewer instanceof ITextViewerExtension6) {
		ITextViewerExtension6 textViewerExtension6 = (ITextViewerExtension6) sourceViewer;
		textViewerExtension6.setHyperlinkDetectors(null,
				sourceViewerConfiguration.getHyperlinkStateMask(sourceViewer));
	}
	if (sourceViewer instanceof ITextViewerExtension2) {
		ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer;
		String[] configuredContentTypes = sourceViewerConfiguration.getConfiguredContentTypes(sourceViewer);
		for (String contentType : configuredContentTypes) {
			textViewerExtension2.removeTextHovers(contentType);
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:DefaultContentViewer.java

示例3: updateShowInvisible

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
protected void updateShowInvisible(boolean value)
{
	if (value)
	{
		if (whitespaceCharacterPainter == null)
		{
			whitespaceCharacterPainter = new WhitespaceCharacterPainter(previewViewer);
			((ITextViewerExtension2) previewViewer).addPainter(whitespaceCharacterPainter);
		}
	}
	else
	{
		if (whitespaceCharacterPainter != null)
		{
			((ITextViewerExtension2) previewViewer).removePainter(whitespaceCharacterPainter);
			whitespaceCharacterPainter = null;
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:FormatterModifyTabPage.java

示例4: unregisterAutoEditVetoer

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
private void unregisterAutoEditVetoer(ITextViewer viewer) {
	try {
		String[] contentTypes = getContentTypes(viewer.getDocument());
		if (viewer instanceof ITextViewerExtension2) {
			ITextViewerExtension2 vExtension = ((ITextViewerExtension2) viewer);
			for (int i = 0; i < contentTypes.length; i++) {
				vExtension.removeAutoEditStrategy(fAutoEditVetoer, contentTypes[i]);
			}
		} else {
			Assert.isTrue(false);
		}
	} catch (BadPartitioningException e) {
		leave(ILinkedModeListener.EXIT_ALL);
	}
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:16,代码来源:TweakedLinkedModeUI.java

示例5: createCursorLinePainter

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
private void createCursorLinePainter() {
    cursorLinePainter = new CursorLinePainter(txtViewer);
    Color color = new Color(Display.getCurrent(),PreferenceConverter.getColor(store,ILogViewerConstants.PREF_CURSORLINE_COLOR));
    cursorLinePainter.setHighlightColor(color);
    ITextViewerExtension2 extension = (ITextViewerExtension2)txtViewer;
    extension.addPainter(cursorLinePainter);
}
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:8,代码来源:LogFileViewer.java

示例6: repairRepresentation

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
private void repairRepresentation(boolean redrawAll)
{
    if (fActiveRegion == null) { return; }
    ISourceViewer viewer = getSourceViewer();
    if (viewer != null)
    {
        resetCursor(viewer);
        int offset = fActiveRegion.getOffset();
        int length = fActiveRegion.getLength();
        // remove style
        if (!redrawAll && viewer instanceof ITextViewerExtension2)
        {
            ((ITextViewerExtension2) viewer).invalidateTextPresentation(offset, length);
        } else
        {
            viewer.invalidateTextPresentation();
        }
        // remove underline
        if (viewer instanceof ITextViewerExtension5)
        {
            ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
            offset = extension.modelOffset2WidgetOffset(offset);
        } else
        {
            offset -= viewer.getVisibleRegion().getOffset();
        }
        StyledText text = viewer.getTextWidget();
        try
        {
            text.redrawRange(offset, length, true);
        }
        catch (IllegalArgumentException x)
        {
        }
    }
    fActiveRegion = null;
}
 
开发者ID:ninneko,项目名称:velocity-edit,代码行数:38,代码来源:VelocityEditor.java

示例7: createBackgroundPainter

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
public void createBackgroundPainter(ISourceViewer viewer)
{
	if (fFullLineBackgroundPainter == null)
	{
		if (viewer instanceof ITextViewerExtension2)
		{
			boolean lineHighlight = Platform.getPreferencesService().getBoolean(EditorsUI.PLUGIN_ID,
					AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, true, null);
			fFullLineBackgroundPainter = new LineBackgroundPainter(viewer);
			fFullLineBackgroundPainter.setHighlightLineEnabled(lineHighlight);
			ITextViewerExtension2 extension = (ITextViewerExtension2) viewer;
			extension.addPainter(fFullLineBackgroundPainter);
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:16,代码来源:ThemeableEditorExtension.java

示例8: repairPresentation

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
private void repairPresentation(ITextViewer viewer) {
	if (fRememberedStyleRange != null) {
		if (viewer instanceof ITextViewerExtension2) {
			// attempts to reduce the redraw area
			ITextViewerExtension2 viewer2= (ITextViewerExtension2)viewer;
			viewer2.invalidateTextPresentation(fRememberedStyleRange.start, fRememberedStyleRange.length);
		} else
			viewer.invalidateTextPresentation();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:AbstractJavaCompletionProposal.java

示例9: repairPresentation

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
private void repairPresentation(ITextViewer viewer) {
    if (fRememberedStyleRange != null) {
        if (viewer instanceof ITextViewerExtension2) {
            // attempts to reduce the redraw area
            ITextViewerExtension2 viewer2 = (ITextViewerExtension2) viewer;
            viewer2.invalidateTextPresentation(fRememberedStyleRange.start, fRememberedStyleRange.length);
        } else {
            viewer.invalidateTextPresentation();
        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:12,代码来源:PyCompletionPresentationUpdater.java

示例10: paint

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
public void paint(int reason)
{
	if (fViewer == null)
	{
		return;
	}
	if (fViewer.getDocument() == null)
	{
		deactivate(false);
		return;
	}

	// initialization
	if (!fIsActive)
	{
		StyledText textWidget = fViewer.getTextWidget();
		textWidget.addLineBackgroundListener(this);
		textWidget.addPaintListener(this);
		fPositionManager.managePosition(fCurrentLine);
		fIsActive = true;
	}

	// This forces redraw of the line highlight
	if (updateHighlightLine())
	{
		// clear last line
		// Fix the background colors for tokens that didn't have the same as line!
		if (isOpaque() && !fLastLine.isDeleted() && fViewer instanceof ITextViewerExtension2)
		{
			ITextViewerExtension2 ext = (ITextViewerExtension2) fViewer;
			try
			{
				ext.invalidateTextPresentation(fLastLine.getOffset(), fLastLine.getLength());
			}
			catch (Exception e)
			{
				IdeLog.logError(CommonEditorPlugin.getDefault(), MessageFormat.format(
						"Error invalidating syntax coloring for offset {0}, length {1}", fLastLine.getOffset(), //$NON-NLS-1$
						fLastLine.getLength()), e);
			}
		}
		drawHighlightLine(fLastLine);
		// draw new line
		drawHighlightLine(fCurrentLine);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:47,代码来源:LineBackgroundPainter.java

示例11: getTextHover

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
	return getTextHover(sourceViewer, contentType, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:JavaSourceViewerConfiguration.java

示例12: getTextHover

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
    return getTextHover(sourceViewer, contentType, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:5,代码来源:ApexSourceViewerConfiguration.java

示例13: getTextHover

import org.eclipse.jface.text.ITextViewerExtension2; //导入依赖的package包/类
@Override
public final ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
	return getTextHover(sourceViewer, contentType, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK);
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:5,代码来源:AbstractLangSourceViewerConfiguration.java


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