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