Filtering Contributions to the Model
Standard Eclipse extension points can be used to contribute to the iSeries
Project Perspective, the two most common ones might be the eclipse.ui.popupMenus
and
the org.eclipse.ui.propertyPages extension points. Both of these
extension points support the concept of "filtering". Filtering is used
to narrow down the scope of a given contribution. For example, in the case
of iSeries Projects Perspective, you can use filtering to contribute actions
to all source physical files that happen to be local, and have a specific
name (RPGLE for example). The iSeries Projects Perspective model supports
all the base Eclipse filtering in addition to a few iSeries specific tags.
Here is a list of all supported tags (attribute values):
Base Eclipse IResource Filters:
(check the org.eclipse.ui.IResourceActionFilter
class for details on what each attribute key means)
-
name: supported by all iSeries project model objects. The
name if a local resource is the name of the underlying cached IResource
object. While the name of a remote object is the name of the cached RSE
object.
-
extension: supported by iSeries project model objects that
are only local. The extension of a local iSeries member is the actual source
type of the member. For this release, and for consistency with Eclipse,
this is only for local members.
-
path: supported by iSeries project model objects that are
only local. For this release, and for consistency with Eclipse, this is
only for local objects.
-
readOnly: supported by iSeries project model objects that
are only local.
-
projectNature: supported by all iSeries project model
objects.
-
persistentProperty: supported by iSeries project model
objects that are only local. This is because persistent properties can
only be defined on local IResources.
-
projectPersistentProperty: supported by all iSeries project
model objects.
-
sessionProperty: supported by iSeries project model objects that
are only local. This is because session properties can only be defined
on local IResources.
-
projectSessionProperty: supported by all iSeries project
model objects.
Base Eclipse IProject Filters:
(check the org.eclipse.ui.IProjectActionFilter
class for details on what each attribute key means)
-
nature: supported by all iSeries project model objects.
-
open: supported by all iSeries project model objects.
iSeries specific Resource Filters:
(check the com.ibm.etools.iseries.perspective.model.IISeriesResourceActionFilter
class
for details on what each attribute key means)
-
isLocal: supported by all iSeries project model objects.
-
isSynchronized: supported by all iSeries project model
objects.
-
isNative: supported by all iSeries project model objects.
-
isSourceFile: supported by all iSeries project model objects,
but is specific to model objects of type: com.ibm.etools.iseries.perspective.model.AbstractISeriesNativeObject.
-
isLeafObject: supported by all iSeries project model objects,
but is specific to model objects of type: com.ibm.etools.iseries.perspective.model.AbstractISeriesNativeObject.
All these values are defined in the com.ibm.etools.iseries.perspective.model.IISeriesResourceActionFilter
class as described in this
class
hierarchy.
Here is a sample on how to use filtering elements:
<!-- all resources that are source physical
files. -->
<objectContribution
objectClass="com.ibm.etools.iseries.perspective.model.AbstractISeriesResource"
id="com.ibm.etools.iseries.perspective.isv.sample3.contribution5">
<filter
name="isSourceFile"
value="true">
</filter>
<action
label="FILTER: name=isSourceFile value=true"
class="com.ibm.etools.iseries.perspective.isv.sample3.EmptyAction"
enablesFor="1"
id="emptyaction5">
</action>
</objectContribution>
The above snippet is taken from one of the samples included with the
iSeries Project perspective. You can check the Installing
and Running the Samples section for details about this sample.