![]() | The Java Developer's Guide to Eclipse |
Chapter 18 showed you how to create views. The view provided in the
com.ibm.jdg2e.view.simplemodel project demonstrates many of the implementation options that
exist, including techniques for integrating the view with other Eclipse capabilities such as the common
Properties dialog.
You may also wish to review these other view-related example plug-ins:
These are located in the
com.ibm.jdg2e.view.basic,
com.ibm.jdg2e.view.files,
and com.ibm.jdg2e.view.marker projects, respectively.
com.ibm.jdg2e.simplemodel is in your workspace. 
You are now ready to explore the function provided in this view. This includes a demonstration of many of the capabilities of Eclipse for viewers, dialogs, action contributions and view interaction.
com.ibm.jdg2e.simplemodel project.
The adapter factory and IPropertySource implementation are
reviewed there.
The Eclipse Properties Dialog is opened with a reference to the viewer, this allows the dialog to ask if there are any properties pages defined (by extension) for the object selected in the viewer. The plug-in manifest file for this project defines such a page.
and sort
the model conent. (Yes, the icons are not gorgeous, we just reused images from Eclipse.)
to remove locations; if you remove them all you can use the
Reset Locations List action
on the pull-down meun to bring back the default location list.The actions on the ILocation Object Contribution menu are of interest here.
These actions are contributed as popup menu object contributions. The
plug-in manifest file can be reviewed to see how the rules
were defined. This is possible because the target ILocation object implements
the IActionFilter interface. This support is reviewed as part of the
Simple Model (RoadTrip Locations)
plug-in project.
The Simple Model View (RoadTrip Locations) plug-in includes contributions and API demonstrations that help you understand how a view using a viewer to display content can be integrated with many of the reusable components in Eclipse. The implementation of this function can be found in the plug-in manifest file and one or more of the classes included in this plug-in.
The plug-in manifest file defines the extension definition
for the Locations (Basic View) and an extension to the Eclipse Resource perspective to have the
view opened up on top of the Tasks view. Extensions for the Location object contributions (actions),
New Location wizard and Location property page are also included.
The table below shows the key classes from the com.ibm.jdg2e.view.simplemodel
package that are used to implement the view part and its associated JFace viewer user interface.
| Class (All) | Description |
LocationsView |
This class implements the view's user interface and function. This includes the logic required to open the Properties dialog. |
LocationsContentProvider |
Used to obtain model content for the JFace viewer used in the view's user interface. |
LocationsTableLabelProvider |
Used to display content for the ILocation objects shown in the JFace table viewer used in the view. |
PoliticalFilter |
Controls the display of content in the viewer. |
PoliticalSorter |
Allows the viewer content to be sorted by political type and then location name. |
LocationPropertyPage |
Used to display content for the ILocation object in the Properties dialog. |
LocationsObjectAction |
Action contribution that is available in the view. The plug-in manifest file
action contribution definitions target ILocation objects with specific attributes. |
LocationPropertyPage |
Property page that is shown when the common Properties dialog is opened for an ILocation object. |
NewLocation |
Wizard used to create new location model instances. Available on the File > New menu and directly by an action in the view. |
© Copyright International Business Machines Corporation, 2003, 2004, 2006. All Rights Reserved.
Code or samples provided herein are provided without warranty of any kind.