Project: JDT
Bug 25793 [rulers][api] Provide simpler way to add a decorator to a composite ruler
Reported: 2002-11-06 14:11:24 | Status: verified fixed

Would like something like: /** * Decorates the given java editor part with the given vertical ruler column * implementation. The vertical ruler is placed in the last position to the * right of the java editor's current vertical rulers. */ JavaUI.addDecorator(IEditorPart javaEditor, IVerticalRulerColumn myVerticalRulerColumn); /** * Removes the given vertical ruler column from the given java editor. */ JavaUI.removeDecorator(IEditorPart javaEditor, IVerticalRulerColumn myVerticalRulerColumn); We need this in order to add a vertical ruler column to annotate a java editor with our own line-based text data. Currently, this can sort of be done using this approach, though it has the strong disadvantage of assuming an internal implementation: // assume ieditorpart instanceof JavaEditor StatusTextEditor statustexteditor = (StatusTextEditor) ieditorpart; CompositeRuler compositeruler = (CompositeRuler)statustexteditor.getAdapter (IVerticalRulerInfo.class); int index = 1; // should be 2 if line numbers are showing compositeruler.addDecorator(index, new MyRulerColumn());

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java