blob: 998e44aac02058528ad40bce4ff5309bff4a16b3 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<TITLE>
Editors
</TITLE>
<link rel="stylesheet" type="text/css" HREF="../book.css">
</HEAD>
<BODY BGCOLOR="#ffffff">
<h1>Editors</h1>
<P >
We have seen how plug-ins can contribute an editor to the workbench, but we
haven't yet looked at the implementation of an editor.</P>
<P >There is no &quot;typical&quot; implementation pattern for an editor, because editors usually provide application-specific semantics.&nbsp;
A tool that edits and manages a particular resource type will
provide customized behavior for manipulating the data represented by the resource.</P>
<P >Editors can come in all shapes and sizes.&nbsp; If a plug-in's editor is text-based, then the editor can either use the existing default text editor, or create a customized text editor
by using the facilities provided in the platform.&nbsp; The latter approach is used by the
Java example editor.</P>
<p >
<img src="images/javaeditor.gif" alt="" border="0" width="508" height="345">
<p >
If a plug-in's editor is not text based, then a custom editor must be implemented by the plug-in. There are several approaches for building
custom editors, all of which depend on the look and behavior of the editor.
<ul>
<li>
Form-based editors can layout controls in a fashion similar to a dialog or wizard.&nbsp;
The Plug-in Development Environment (PDE) uses this approach in building its
manifest editors.&nbsp;&nbsp;</li>
<li>
Graphics intensive editors can be written using SWT level code.&nbsp; For
example, an editor could create its own SWT window for displaying the
information, or it could use a custom SWT control that is optimized for the
application.</li>
<li>
List-oriented editors can use JFace list, tree, and table viewers to manipulate
their data.</li>
</ul>
<P >
Once the implementation model for the editor has been determined, implementing the editor is much like programming a stand-alone JFace or SWT application.&nbsp;
Platform extensions are used to add actions, preferences, and wizards needed to
support the editor.&nbsp; But the internals of the editor are largely dependent
on your application design principles and internal model.
</P>
<p><a href="../hglegal.htm"><img border="0" src="../ngibmcpy.gif" alt="Copyright IBM Corporation and others 2000, 2003." border="0" width="324" height="14"></a></p>
</BODY>
</HTML>