• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IRewriteTarget类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: doExecuteResult

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
@Override
protected boolean doExecuteResult(ITextEditor editor, Object minibufferResult) {
	// use widget to avoid unpleasant scrolling side effects of IRewriteTarget
	Control widget = getTextWidget(editor);
	// wrap in compound change and no redraw
	IRewriteTarget rt = (IRewriteTarget) editor.getAdapter(IRewriteTarget.class);
	try {
		if (rt != null) {
			rt.beginCompoundChange();
		}
		widget.setRedraw(false);
		int offset = rs.updateRectangle(editor, document, selection, (String)minibufferResult, isReplace(),false);
		if (offset > 0) {
			selectAndReveal(editor, offset, offset);
		}
	} finally  {
		if (rt != null) {
			rt.endCompoundChange();
		}
		widget.setRedraw(true);
	}
	return true;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:24,代码来源:RectangleExecHandler.java


示例2: endCompoundChangeIfNeeded

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
private void endCompoundChangeIfNeeded() {
	if (fHasOpenCompoundChange) {
		ITextViewerExtension extension = (ITextViewerExtension) fCurrentTarget.getViewer();
		IRewriteTarget target = extension.getRewriteTarget();
		target.endCompoundChange();
		fHasOpenCompoundChange = false;
	}
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:9,代码来源:TweakedLinkedModeUI.java


示例3: beginCompoundChangeIfNeeded

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
private void beginCompoundChangeIfNeeded() {
	if (!fHasOpenCompoundChange) {
		ITextViewerExtension extension = (ITextViewerExtension) fCurrentTarget.getViewer();
		IRewriteTarget target = extension.getRewriteTarget();
		target.beginCompoundChange();
		fHasOpenCompoundChange = true;
	}
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:9,代码来源:TweakedLinkedModeUI.java


示例4: beginCompoundEdit

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
/**
 * Ends the compound change.
 */
private void beginCompoundEdit() {
	ITextViewer viewer= getTextViewer();
	if (fEditInProgress || viewer == null || !(viewer instanceof ITextViewerExtension))
		return;

	fEditInProgress= true;

	fStrategy.arm(viewer);

	IRewriteTarget target= ((ITextViewerExtension) viewer).getRewriteTarget();
	if (target != null) {
		target.beginCompoundChange();
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:TextViewerMoveLinesAction.java


示例5: endCompoundEdit

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
/**
 * Ends the compound change.
 */
private void endCompoundEdit() {
	ITextViewer viewer= getTextViewer();
	if (!fEditInProgress || viewer == null || !(viewer instanceof ITextViewerExtension))
		return;

	IRewriteTarget target= ((ITextViewerExtension) viewer).getRewriteTarget();
	if (target != null) {
		target.endCompoundChange();
	}

	fEditInProgress= false;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:16,代码来源:TextViewerMoveLinesAction.java


示例6: beginCompoundEdit

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
/**
 * Ends the compound change.
 */
public void beginCompoundEdit() {
	if (fEditInProgress || fEditor == null)
		return;

	fEditInProgress= true;

	fExitStrategy.arm(fEditor.getViewer());

	IRewriteTarget target= (IRewriteTarget)fEditor.getAdapter(IRewriteTarget.class);
	if (target != null) {
		target.beginCompoundChange();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:JavaMoveLinesAction.java


示例7: endCompoundEdit

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
/**
 * Ends the compound change.
 */
public void endCompoundEdit() {
	if (!fEditInProgress || fEditor == null)
		return;

	fExitStrategy.disarm();

	IRewriteTarget target= (IRewriteTarget)fEditor.getAdapter(IRewriteTarget.class);
	if (target != null) {
		target.endCompoundChange();
	}

	fResult= null;
	fEditInProgress= false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:JavaMoveLinesAction.java


示例8: doPasteWithImportsOperation

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
private void doPasteWithImportsOperation() {
	ITextEditor editor= getTextEditor();
	IJavaElement inputElement= JavaUI.getEditorInputTypeRoot(editor.getEditorInput());

	Clipboard clipboard= new Clipboard(getDisplay());
	try {
		ClipboardData importsData= (ClipboardData)clipboard.getContents(fgTransferInstance);
		if (importsData != null && inputElement instanceof ICompilationUnit && !importsData.isFromSame(inputElement)) {
			// combine operation and adding of imports
			IRewriteTarget target= (IRewriteTarget)editor.getAdapter(IRewriteTarget.class);
			if (target != null) {
				target.beginCompoundChange();
			}
			try {
				fOperationTarget.doOperation(fOperationCode);
				addImports((ICompilationUnit)inputElement, importsData);
			} catch (CoreException e) {
				JavaPlugin.log(e);
			} finally {
				if (target != null) {
					target.endCompoundChange();
				}
			}
		} else {
			fOperationTarget.doOperation(fOperationCode);
		}
	} finally {
		clipboard.dispose();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:31,代码来源:ClipboardOperationAction.java


示例9: endCompoundChange

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
private void endCompoundChange(ITextViewer viewer) {
	if (viewer instanceof ITextViewerExtension) {
		ITextViewerExtension extension= (ITextViewerExtension) viewer;
		IRewriteTarget target= extension.getRewriteTarget();
		target.endCompoundChange();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:TemplateProposal.java


示例10: beginCompoundChange

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
private void beginCompoundChange(ITextViewer viewer) {
	if (viewer instanceof ITextViewerExtension) {
		ITextViewerExtension extension= (ITextViewerExtension) viewer;
		IRewriteTarget target= extension.getRewriteTarget();
		target.beginCompoundChange();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:TemplateProposal.java


示例11: setRedraw

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
private void setRedraw(ITextViewer viewer, boolean redraw) {
if (viewer instanceof ITextViewerExtension) {
	ITextViewerExtension extension= (ITextViewerExtension) viewer;
	IRewriteTarget target= extension.getRewriteTarget();
	target.setRedraw(redraw);
}
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:SurroundWithTemplateProposal.java


示例12: undoProtect

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
/**
 * Get the undo Runnable wrappers
 * 
 * @param editor
 * @return begin and end undoProtect wrappers
 */
protected Runnable[] undoProtect(ITextEditor editor, final MacroCount keepCount) {
	Runnable[] result = new Runnable[2];
	// use widget to avoid unpleasant scrolling side effects of IRewriteTarget
	final Control widget = getTextWidget(editor);;
	final IRewriteTarget rt = (IRewriteTarget) editor.getAdapter(IRewriteTarget.class);;
	result[0] = new Runnable() {
		public void run() {
			if (rt != null) {
				rt.beginCompoundChange();
			}
			setRedraw(widget,false);
		}
	};
	result[1] = new Runnable() {
		public void run() {
			setRedraw(widget, true);
			if (rt != null) {
				rt.endCompoundChange();
			}
			if (!isInterrupted() && keepCount != null) {
				// we've finished one more loop of the main macro
				keepCount.addCounter();
			}
		}
	};
	return result;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:34,代码来源:KbdMacroExecuteHandler.java


示例13: doExecuteResult

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
/**
 * @see com.mulgasoft.emacsplus.minibuffer.IMinibufferExecutable#executeResult(org.eclipse.ui.texteditor.ITextEditor, java.lang.Object)
 */
public boolean doExecuteResult(ITextEditor editor, Object minibufferResult) {
	
	if (minibufferResult != null && ((String)minibufferResult).length() > 0) {
		String key = (String)minibufferResult;
		ITextSelection selection = getImpliedSelection(editor, getCurrentSelection(editor));
		IDocument document = getThisDocument(editor);
		// if called with ^U, then delete text as well
		boolean delete = isEditable() && getCallCount() > 1;
		String[] rect;
		// use widget to avoid unpleasant scrolling side effects of IRewriteTarget			
		Control widget = getTextWidget(editor);
		IRewriteTarget rt = (IRewriteTarget) editor.getAdapter(IRewriteTarget.class);
		try {
			if (delete) {
				// wrap in compound change and no redraw
				widget.setRedraw(false);
				if (rt != null) {
					rt.beginCompoundChange();
				}
			}
			rect = new RectangleSupport(document,editor).copyRectangle(editor, document, selection, delete);
			if (rect != null && rect.length > 0) {
				TecoRegister.getInstance().put(key,rect);
				showResultMessage(editor, String.format(COPIED, key), false);
			}
		} catch (BadLocationException e) {
			showResultMessage(editor, BAD_INSERT_LOCATION, true);
		} finally  {
			if (rt != null) {
				rt.endCompoundChange();
			}
			widget.setRedraw(true);
		}
	} else {
		showResultMessage(editor, NO_REGISTER, true);
	}
	return true;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:42,代码来源:RegisterRectangleHandler.java


示例14: getRewriteTarget

import org.eclipse.jface.text.IRewriteTarget; //导入依赖的package包/类
public IRewriteTarget getRewriteTarget() {
    return viewer.getRewriteTarget();
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:4,代码来源:ScriptConsoleViewerWrapper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LossyRetryInvocationHandler类代码示例发布时间:2022-05-22
下一篇:
Java Constraint类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap