org.eclipse.jface.text.source.IVerticalRulerInfo Java Examples

The following examples show how to use org.eclipse.jface.text.source.IVerticalRulerInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GroovyViewer.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public void dispose() {
    final ProvidedGroovyRepositoryStore store = RepositoryManager.getInstance()
            .getRepositoryStore(ProvidedGroovyRepositoryStore.class);
    GroovyFileStore fStore = store.getChild(GroovyFileStore.EXPRESSION_SCRIPT_NAME, true);
    if (fStore != null) {
        fStore.delete();
    }
    final IColumnSupport columSupport = (IColumnSupport) editor.getAdapter(IColumnSupport.class);
    if (columSupport != null) {
        columSupport.dispose();
    }
    final CompositeRuler verticalRuler = (CompositeRuler) editor.getAdapter(IVerticalRulerInfo.class);
    if (verticalRuler != null && verticalRuler.getControl() != null) {
        verticalRuler.getControl().dispose();
    }
    editor.dispose();
}
 
Example #2
Source File: DebuggerTestUtils.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @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;
}
 
Example #3
Source File: SootAttributeRulerActionDelegate.java    From JAADAS with GNU General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #4
Source File: ReviewMarkerContributionFactory.java    From git-appraise-eclipse with Eclipse Public License 1.0 6 votes vote down vote up
@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);
  }
}
 
Example #5
Source File: ReviewMarkerContributionFactory.java    From git-appraise-eclipse with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #6
Source File: JavaSelectAnnotationRulerAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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);
}
 
Example #7
Source File: PyBreakpointRulerAction.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public PyBreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo ruler) {
    setInfo(ruler);
    setTextEditor(editor);
    setText("Breakpoint &Properties...");
    fAddLabel = "Add Breakpoint";
    fRemoveLabel = "Remove Breakpoint";
}
 
Example #8
Source File: AbstractBreakpointRulerAction.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
protected IVerticalRulerInfo getInfo() {
    return fInfo;
}
 
Example #9
Source File: ManageBreakpointRulerActionDelegate.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new PyBreakpointRulerAction(editor, rulerInfo);
}
 
Example #10
Source File: PythonBreakpointPropertiesRulerActionDelegate.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new PythonBreakpointPropertiesRulerAction(editor, rulerInfo);
}
 
Example #11
Source File: EnableDisableBreakpointRulerActionDelegate.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    return new EnableDisableBreakpointRulerAction(editor, rulerInfo);
}
 
Example #12
Source File: EnableDisableBreakpointRulerAction.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
public EnableDisableBreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    fInfo = rulerInfo;
    fTextEditor = editor;
}
 
Example #13
Source File: PythonBreakpointPropertiesRulerAction.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
public PythonBreakpointPropertiesRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
    setInfo(rulerInfo);
    setTextEditor(editor);
    setText("Breakpoint &Properties...");
}
 
Example #14
Source File: AbstractBreakpointRulerAction.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
protected void setInfo(IVerticalRulerInfo info) {
    fInfo = info;
}
 
Example #15
Source File: XtextMarkerRulerAction.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
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;
}
 
Example #16
Source File: JavaSelectRulerAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
	return new JavaSelectAnnotationRulerAction(JavaEditorMessages.getBundleForConstructedKeys(), "JavaSelectAnnotationRulerAction.", editor, rulerInfo); //$NON-NLS-1$
}
 
Example #17
Source File: ReviewMarkerContributionFactory.java    From git-appraise-eclipse with Eclipse Public License 1.0 4 votes vote down vote up
private boolean markerHasBeenClicked(IMarker marker, IVerticalRulerInfo rulerInfo) {
  return (marker.getAttribute(IMarker.LINE_NUMBER, 0))
      == (rulerInfo.getLineOfLastMouseButtonActivity() + 1);
}
 
Example #18
Source File: OverrideIndicatorRulerAction.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
protected IVerticalRuler getVerticalRuler() {
	IVerticalRuler verticalRuler = (IVerticalRuler) editor.getAdapter(IVerticalRulerInfo.class);
	return verticalRuler;
}
 
Example #19
Source File: SootAttributeJimpleSelectAction.java    From JAADAS with GNU General Public License v3.0 4 votes vote down vote up
public SootAttributeJimpleSelectAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo rulerInfo) {	
	super(bundle, prefix, editor, rulerInfo);
}
 
Example #20
Source File: SootAttributeJavaSelectAction.java    From JAADAS with GNU General Public License v3.0 4 votes vote down vote up
public SootAttributeJavaSelectAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo rulerInfo) {	
	super(bundle, prefix, editor, rulerInfo);
}