Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-text-dev] Annotations

I've spent the day on this problem to no avail. I have a preferences page based on TextEditorPreferencePage2.java in org.eclipse.ui.editors. I've walked through the code in createSourceViewer() in TextEditor.java and the AnnotationPreferences are being added to the header for my editor. Yet still no annotations of any type are displayed. However, line numbers, highlighting, etc. all from the appearance tab work fine.

My editor is quite simple. It extends TextEditor. This is the constructor:

public PrologEditor() {
        super();

        // The font is loaded from the preference store
        preferenceStore = PrologUIPlugin.getDefault().getPreferenceStore();
        setPreferenceStore(preferenceStore);

        // Create the color manager
        colorManager = new ColorManager();

sourceViewerConfig = new PrologSourceViewerConfiguration(colorManager);
        setSourceViewerConfiguration(sourceViewerConfig);

        prologDocumentProvider = new PrologDocumentProvider(colorManager);
        setDocumentProvider(prologDocumentProvider);

        setRulerContextMenuId("#PrologRulerContext");
}

And this for my breakpoints:

protected void createActions() {

        try {
                super.createActions();

                // Breakpoint setting via the ruler menu and double-click
BreakpointRulerEditorAction action = new BreakpointRulerEditorAction(PrologUIPlugin.getResourceBundle(),
                        "ToggleBreakpoint_", this, getVerticalRuler());
                setAction("ToggleBreakpoint", action);
setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, getAction("ToggleBreakpoint"));
        }
        catch(NullPointerException e) {
        }
}

Everything else is pretty vanilla. The first version was based on the Java Editor example (not the full editor). I've studied TextEditor.java and looked at JavaEditor.java, but I think the latter was written after this feature was added. Can someone give me an idea of where to look next for this problem? Or a working code example?

Many thanks,
Mary Kroening
Amzi! inc.






Back to the top