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


Java IVerticalRulerInfo.getLineOfLastMouseButtonActivity方法代码示例

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


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

示例1: getMarkers

import org.eclipse.jface.text.source.IVerticalRulerInfo; //导入方法依赖的package包/类
/**
 * Gets the {@link List} of {@link IMarker} for the current line of the given {@link ITextEditor}.
 * 
 * @param editor
 *            the {@link ITextEditor}
 * @param rulerInfo
 *            the {@link IVerticalRulerInfo}
 * @return the {@link List} of {@link IMarker} for the current line of the given {@link ITextEditor}
 */
protected List<IMarker> getMarkers(final ITextEditor editor, final IVerticalRulerInfo rulerInfo) {
	final List<IMarker> res = new ArrayList<IMarker>();

	final IDocument document = (IDocument)editor.getDocumentProvider().getDocument(editor
			.getEditorInput());
	if (document != null) {
		final AbstractMarkerAnnotationModel model = getAnnotationModel(editor);
		if (model != null) {
			final int activeLine = rulerInfo.getLineOfLastMouseButtonActivity();
			res.addAll(getMarkers(document, model, activeLine));
		}
	}

	return res;
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:25,代码来源:QuickFixContributionItem.java

示例2: execute

import org.eclipse.jface.text.source.IVerticalRulerInfo; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
	IFileEditorInput input = (IFileEditorInput) part.getEditorInput();
	IFile file = input.getFile();
	if (part instanceof ITextEditor) {
		final ITextEditor editor = (ITextEditor) part;
		IVerticalRulerInfo ruleInfo = editor.getAdapter(IVerticalRulerInfo.class);
		IDocumentProvider provider = editor.getDocumentProvider();
		IDocument document = provider.getDocument(editor.getEditorInput());
		int lineNumber = ruleInfo.getLineOfLastMouseButtonActivity();
		String className = file.getName().substring(0, file.getName().lastIndexOf('.'));
		HashMap<VFUnit, VFMethod> resultantUnit = getSelectedUnit(className, document, lineNumber);
		List<VFNode> unit = new ArrayList<>();
		if (resultantUnit.size() > 0) {
			if (event.getCommand().getId().equals("JavaHandler.NavigateToJimple")) {
				NavigationHandler handler = new NavigationHandler();
				handler.highlightJimpleSource(new ArrayList<>(resultantUnit.keySet()));
			} else {
				for (VFUnit vfUnit : resultantUnit.keySet()) {
					unit.add(new VFNode(vfUnit, 0));
				}
				try {
					ServiceUtil.getService(DataModel.class).filterGraph(unit, true, true, null);

				} catch (Exception e) {
					e.printStackTrace();
				}
			}

		}

		// call graph highlighting code here
	} else {
		logger.error("Editor not a  Text Editor");
	}
	return null;
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:39,代码来源:JavaToCFGHandler.java

示例3: getLineNumber

import org.eclipse.jface.text.source.IVerticalRulerInfo; //导入方法依赖的package包/类
private int getLineNumber() throws BadLocationException {
	IVerticalRulerInfo ruleInfo = getTextEditor().getAdapter(IVerticalRulerInfo.class);
	int lineNumber = ruleInfo.getLineOfLastMouseButtonActivity();
	int actualLineNumber = lineNumber + 1;
	return actualLineNumber;
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:7,代码来源:ToggleJimpleBreakpointsTarget.java

示例4: markerHasBeenClicked

import org.eclipse.jface.text.source.IVerticalRulerInfo; //导入方法依赖的package包/类
private boolean markerHasBeenClicked(IMarker marker, IVerticalRulerInfo rulerInfo) {
  return (marker.getAttribute(IMarker.LINE_NUMBER, 0))
      == (rulerInfo.getLineOfLastMouseButtonActivity() + 1);
}
 
开发者ID:google,项目名称:git-appraise-eclipse,代码行数:5,代码来源:ReviewMarkerContributionFactory.java


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