![]() |
You can choose to reuse the markers defined as part of Eclipse or
define your own. New marker types can either
build on existing maker definitions and behavior, or be implemented as
specialized markers where all behavior is implemented as part of your tool
logic.
This marker example defines a new marker type (com.ibm.lab.soln.resource.recentEdits
)
that builds on both the existing Eclipse bookmark and problem marker
types. This means that this kind of marker will automatically be visible in
the Bookmarks and Tasks views. The recentEdit markers are created for
resources that have been recently modified.
The plug-in also extends the org.eclipse.ui.startup
extension point so that it may add the resource change listener
used to create recent edit markers.
The plugin.xml
defines the marker extensions and the code
is provided in the
com.ibm.lab.soln.resources.markers
package.
To run the example, launch the run-time instance of Eclipse (Run > Run As > Run-time Workbench).
com.ibm.lab.soln.dialogs
project
loaded, you can open the Soln: Basic Preference Page
and
view or modify the setting that determines how many recentEdits markers
to keep active and if these recentEdits markers should be saved in the workspace (custom logic will use the IMarker.TRANSIENT
attribute to override the <persistent value="true" />
setting in the marker extension):com.ibm.lab.soln.dialogs
plug-in is not available,
a hard-coded value of four is used as the recentEdits marker limit and the marker extension definition is used to determine if the marker is persistent.com.ibm.lab.soln.resources
plug-in includes an
org.eclipse.ui.startup extension, this means the plug-in starts when
Eclipse starts. Because of this you may already have recentEdits
markers showing in the Bookmarks and Tasks views:This change will remove the recentEdit markers from the Tasks view. They will only be shown in the Bookmarks view.
RecentEditsRCL
)
is used to detect file modifications and the RecentEdits
class manages the recentEdits markers. com.ibm.lab.soln.dialogs
project
loaded, you can open the properties page Soln: File Properties
,
and view or modify the setting that determines if a recentEdits marker
will be created for the file:This example includes a marker extension and several pop-up action contributions that demonstrate how natures and builders can be used to customize projects and process resources. the use of the workspace API. The extension definition can be found in the plugin.xml. The classes that use this extension are shown below.
Extension / Object | Implementation |
---|---|
Marker extension: recentEdits |
A marker is defined; there is no implementation class. |
Resource Change Listener | The resource change listener is implemented by the RecentEditsRCL
class. |
Recent Edits Manager | The recent edits manager is implemented by the RecentEdits
class. |
When the nature is configured as part of a project it adds the
builder. The builder implements a simple resource transformation by
reacting to new or modified .readme
files and creating
associated .html
files. This processing is implemented by
the ReadmeVisitor
class.
© Copyright International Business Machines Corporation, 2003.
All rights reserved.