Java 类org.eclipse.jface.text.source.IVerticalRulerInfo 实例源码

项目:JAADAS    文件:SootAttributeRulerActionDelegate.java   
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {

    try {
        ResourceBundle rb = SootPlugin.getDefault().getResourceBundle();
        if (editor instanceof JimpleEditor){
            return new SootAttributeJimpleSelectAction(rb, null, editor, rulerInfo);
        }
        else {
            return new SootAttributeJavaSelectAction(rb, null, editor, rulerInfo);
        }
    }
    catch (Exception e){
        System.out.println("exception: "+e.getMessage());
    }
    return null;
}
项目:Source    文件:QuickFixContributionItem.java   
/**
 * Gets the {@link List} of {@link IMarker} for the current line.
 * 
 * @return the {@link List} of {@link IMarker}
 */
private List<IMarker> getMarkersForCurrentLine() {
    final List<IMarker> res = new ArrayList<IMarker>();

    final IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .getActiveEditor();
    if (activeEditor instanceof ITextEditor) {
        final IVerticalRulerInfo rulerInfo = (IVerticalRulerInfo)activeEditor.getAdapter(
                IVerticalRulerInfo.class);

        // TODO check if the last right click has been done on the ruler
        final IResource resource = getResource(activeEditor);
        if (resource != null) {
            res.addAll(getMarkers((ITextEditor)activeEditor, rulerInfo));
        }
    }

    return res;
}
项目:Source    文件:QuickFixContributionItem.java   
/**
 * 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;
}
项目:git-appraise-eclipse    文件:ReviewMarkerContributionFactory.java   
@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
  ITextEditor editor = (ITextEditor)
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  IVerticalRulerInfo rulerInfo = editor.getAdapter(IVerticalRulerInfo.class);

  try {
    List<IMarker> markers = getMarkers(editor, rulerInfo);
    additions.addContributionItem(new ReviewMarkerMenuContribution(editor, markers), null);
    if (!markers.isEmpty()) {
      additions.addContributionItem(new Separator(), null);
    }
  } catch (CoreException e) {
    AppraiseUiPlugin.logError("Error creating marker context menus", e);
  }
}
项目:Pydev    文件:DebuggerTestUtils.java   
/**
 * @return an action that can be run to create a breakpoint in the given line
 */
public PyBreakpointRulerAction createAddBreakPointAction(final int line) {
    PyBreakpointRulerAction ret = new PyBreakpointRulerAction(debugEditor, new IVerticalRulerInfo() {
        @Override
        public int getLineOfLastMouseButtonActivity() {
            return line;
        }

        @Override
        public Control getControl() {
            throw new RuntimeException("Not Implemented");
        }

        @Override
        public int getWidth() {
            throw new RuntimeException("Not Implemented");
        }

        @Override
        public int toDocumentLineNumber(int y_coordinate) {
            throw new RuntimeException("Not Implemented");
        }
    });
    ret.update();
    return ret;
}
项目:visuflow-plugin    文件:JavaToCFGHandler.java   
@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;
}
项目:git-appraise-eclipse    文件:ReviewMarkerContributionFactory.java   
private List<IMarker> getMarkers(ITextEditor editor, IVerticalRulerInfo rulerInfo)
    throws CoreException {
  List<IMarker> clickedOnMarkers = new ArrayList<IMarker>();
  for (IMarker marker : getAllMarkers(editor)) {
    if (markerHasBeenClicked(marker, rulerInfo)) {
      clickedOnMarkers.add(marker);
    }
  }

  return clickedOnMarkers;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSelectAnnotationRulerAction.java   
public JavaSelectAnnotationRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler) {
    super(bundle, prefix, editor, ruler);
    fBundle= bundle;
    fTextEditor= editor;

    fAnnotationPreferenceLookup= EditorsUI.getAnnotationPreferenceLookup();
    fStore= JavaPlugin.getDefault().getCombinedPreferenceStore();

    PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.JAVA_SELECT_MARKER_RULER_ACTION);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSelectAnnotationRulerAction.java   
public JavaSelectAnnotationRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler) {
    super(bundle, prefix, editor, ruler);
    fBundle= bundle;
    fTextEditor= editor;

    fAnnotationPreferenceLookup= EditorsUI.getAnnotationPreferenceLookup();
    fStore= JavaPlugin.getDefault().getCombinedPreferenceStore();

    PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.JAVA_SELECT_MARKER_RULER_ACTION);
}
项目:Pydev    文件:PyBreakpointRulerAction.java   
public PyBreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo ruler) {
    setInfo(ruler);
    setTextEditor(editor);
    setText("Breakpoint &Properties...");
    fAddLabel = "Add Breakpoint";
    fRemoveLabel = "Remove Breakpoint";
}
项目:visuflow-plugin    文件:ToggleJimpleBreakpointsTarget.java   
private int getLineNumber() throws BadLocationException {
    IVerticalRulerInfo ruleInfo = getTextEditor().getAdapter(IVerticalRulerInfo.class);
    int lineNumber = ruleInfo.getLineOfLastMouseButtonActivity();
    int actualLineNumber = lineNumber + 1;
    return actualLineNumber;
}
项目:visuflow-plugin    文件:UnitBreakpointPropertiesActionDelegate.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new UnitBreakpointPropertiesAction(editor, rulerInfo);
}
项目:visuflow-plugin    文件:UnitBreakpointPropertiesAction.java   
/**
 * Creates the action to enable/disable breakpoints
 */
public UnitBreakpointPropertiesAction(ITextEditor editor, IVerticalRulerInfo info) {
    super(editor, info);
    setText("Unit Breakpoint Properties");
}
项目:JAADAS    文件:SootAttributeJavaSelectAction.java   
public SootAttributeJavaSelectAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo rulerInfo) {  
    super(bundle, prefix, editor, rulerInfo);
}
项目:JAADAS    文件:SootAttributeJimpleSelectAction.java   
public SootAttributeJimpleSelectAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo rulerInfo) {    
    super(bundle, prefix, editor, rulerInfo);
}
项目:bts    文件:XtextMarkerRulerAction.java   
public XtextMarkerRulerAction(ResourceBundle bundle, String prefix, XtextEditor editor, IVerticalRulerInfo ruler) {
    super(bundle, prefix, editor, ruler);
    this.textEditor = editor;// can't access private super field
    this.ruler = ruler;
}
项目:git-appraise-eclipse    文件:ReviewMarkerContributionFactory.java   
private boolean markerHasBeenClicked(IMarker marker, IVerticalRulerInfo rulerInfo) {
  return (marker.getAttribute(IMarker.LINE_NUMBER, 0))
      == (rulerInfo.getLineOfLastMouseButtonActivity() + 1);
}
项目:chromedevtools    文件:JsBreakpointPropertiesRulerAction.java   
public JsBreakpointPropertiesRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
  super(editor, rulerInfo);
  setText(Messages.JsBreakpointPropertiesRulerAction_ItemLabel);
}
项目:chromedevtools    文件:JsBreakpointPropertiesRulerAction.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
  return new JsBreakpointPropertiesRulerAction(editor, rulerInfo);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSelectRulerAction.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new JavaSelectAnnotationRulerAction(JavaEditorMessages.getBundleForConstructedKeys(), "JavaSelectAnnotationRulerAction.", editor, rulerInfo); //$NON-NLS-1$
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSelectRulerAction.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new JavaSelectAnnotationRulerAction(JavaEditorMessages.getBundleForConstructedKeys(), "JavaSelectAnnotationRulerAction.", editor, rulerInfo); //$NON-NLS-1$
}
项目:Pydev    文件:AbstractBreakpointRulerAction.java   
protected IVerticalRulerInfo getInfo() {
    return fInfo;
}
项目:Pydev    文件:AbstractBreakpointRulerAction.java   
protected void setInfo(IVerticalRulerInfo info) {
    fInfo = info;
}
项目:Pydev    文件:PythonBreakpointPropertiesRulerAction.java   
public PythonBreakpointPropertiesRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    setInfo(rulerInfo);
    setTextEditor(editor);
    setText("Breakpoint &Properties...");
}
项目:Pydev    文件:EnableDisableBreakpointRulerAction.java   
public EnableDisableBreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    fInfo = rulerInfo;
    fTextEditor = editor;
}
项目:Pydev    文件:EnableDisableBreakpointRulerActionDelegate.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new EnableDisableBreakpointRulerAction(editor, rulerInfo);
}
项目:Pydev    文件:PythonBreakpointPropertiesRulerActionDelegate.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new PythonBreakpointPropertiesRulerAction(editor, rulerInfo);
}
项目:Pydev    文件:ManageBreakpointRulerActionDelegate.java   
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new PyBreakpointRulerAction(editor, rulerInfo);
}
项目:EclipseTracer    文件:ToggleTrackingActionDelegate.java   
ToggleBreakpointSilentAction(ITextEditor editor,
        IVerticalRulerInfo rulerInfo) {
    super(editor, rulerInfo);
}
项目:EclipseTracer    文件:ToggleTrackingActionDelegate.java   
@Override
protected IAction createAction(ITextEditor editor,
        IVerticalRulerInfo rulerInfo) {
    return new ToggleBreakpointSilentAction(editor, rulerInfo);
}