本文整理汇总了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);
}
}
示例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);
}
}
}
示例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;
}
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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();
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}