Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


developerWorks: Equipping SWT Applications with Content Assistants

Nov 25, 2003, 05:30 (0 Talkback[s])
(Other stories by Berthold Daum)

"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' SourceViewers.

"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. Let's begin..."

Complete Story

Related Stories: