Reputation: 1334
I'm developing an Eclipse plug-in, mostly as a learning exercise, in which I have a wizard page. In this wizard page I would like to have a small text area that behaves like a code editor with the appropriate content assist and information hovers etc, much like the breakpoint properties wizard has for adding conditions.
I'm new to plug-in development and I may not have quite picked up the vocabulary, so I'm not having much luck searching for examples. Can someone please point me in the right direction?
Upvotes: 0
Views: 46
Reputation: 21025
I assume that you are looking for an embeddable Java source editor - and with that you hit a difficult topic.
The source viewer mentioned by Chris Gerken is called JDISourceViewer
. It is instantiated and configured in JavaBreakpointConditionEditor::createControl
.
If you cannot find the mentioned classes, or if you want to experiment with them, then open the Plug-ins view, find the org.eclipse.jdt.debug.ui
plug-in and select Import As > Source Project from the context menu.
Unfortunately - in the beginning - the (Java) editors weren't designed to be embedded outside of the editor area and many editor participants (e.g. actions, formatter, etc) still expect an IEditorPart
. Hence it is a quirky and complicated endeavour to use an editor in a dialog or the like.
Moreover, the Java source editing infrastructure is not exposed as public API. It isn't meant to be used by clients and can change at any time without prior notice. You will see respective warnings in yoyur code. For a learning exercise, however, that shouldn't matter much.
Upvotes: 2