developerWorks: Equipping SWT Applications with Content Assistants
Nov 25, 2003, 05:30 (0 Talkback[s])
(Other stories by Berthold Daum)
WEBINAR: On-demand Event
Replace Oracle with the NoSQL Engagement Database: Why and how leading companies are making the switch REGISTER >
"The concept of content assistants is related to a specific
implementation of JFace text viewers, the class
org.eclipse.jface.text.source.SourceViewer. Instances of this class
are used throughout the Eclipse workbench to implement the various
editors. However, SourceViewers are not restricted to the Eclipse
workbench but may be used in any application that builds upon the
SWT and JFace JARs. This article demonstrates the implementation of
content assistants in the context of an Eclipse editor plug-in, and
gives some hints on how to use content assistants with 'naked'
"Let's implement a simple HTML editor. Here a content assistant
can be very helpful. For example, a content assistant could
generate typical HTML structures such as tables or links, or could
wrap selected text areas into style tags.
"To save time, we will implement this editor by using one of the
New Plug-in Project wizards to generate an appropriate editor
plug-in. Because this generated editor is an XML editor, and HTML
is an XML-based mark-up language, we only need to make some minor
modifications to convert this generated editor into an HTML editor.