Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Enhancements to WPE Property Pages
Contents
Note
Information contained in this document is based upon features and code that are not yet finalized, and thus subject to change before WTP3.0GA. By M6, however, the code and this document should be solidified, and safe to adopt.
Introduction
In this release we have made changes to the way the Web Page Editor (WPE) tabbed property pages are handled. The main goals were to:
- Replace the usage of deprecated
org.eclipse.wst.common.ui.properties.*
extension-points for tabbed properties and moving to the Platform'sorg.eclipse.ui.views.properties.tabbed.*
extension-points. Support fororg.eclipse.jst.pagedesigner.propertySections
extension-point has also been removed. - Unified meta data. The previous version made use of a meta data format that was not in the standard form for WTP JSF tooling. There was also meta data in the "CMRegistry Config Files" that was duplicated in the standard meta data. The CMCRegistry extension-point, and all associated classes and meta data, are now deprecated and unused.
- Other incremental improvements
Quick Edit Tab
In the prior release, in order to have dialog field editing for a particular tag attribute, it was necessary to create a section class and register it using the org.eclipse.jst.pagedesigner.propertySections
extension-point. This extension-point was very similar to the, now deprecated and removed, org.eclipse.wst.common.ui.properties.propertySections
extension-point. In this release, we believe we have made it far simpler for a developer.
To specify the attributes for a tag that you would like displayed in the Quick Edit tab, classes are no longer required to be supplied. This is now done by simply specifying the attributes through meta data.
Here is the eCore model that defines the meta data:
If the section type is not specified, ATTRIBUTE is assumed.
Below shows how the JSF HTML messages tag meta data has a "quick-edit-tab" trait, to display 3 attributes:
<trait id="quick-edit-tab"> <value xsi:type="qe:QuickEditTabSections"> <section id="id"/> <section id="layout"/> <section id="style"/> </value> </trait>
To allow for more complicated scenarios, one can use a type of "SECTION". This allows any org.eclipse.ui.views.properties.tabbed.ISection
class registered with org.eclipse.ui.views.properties.tabbed.propertySections to be used, as long as it was defined against the WPE tabbed property contibuterId of "org.eclipse.jst.pagedesigner.tabPropertyContributor". Please note that any filters and positioning information in the extension is ignored; the trait value defines the position and inclusion for a tag.
Here is an example of using a mix of sections to define the JSF HTML commandButton tag's Quick Edit tab section:
<trait id="quick-edit-tab"> <value xsi:type="qe:QuickEditTabSections"> <section id="id"/> <section id="value"/> <section id="action"/> <section id="actionListener"/> <section id="type"/> <section id="style"/> <section id="section.general.commandButton.listener" type="SECTION"/> </value> </trait>
To define Quick Edit meta data, first add the namespace attribute to the md:metadatamodel tag of your meta data file.
xmlns:qe="http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore"
Attributes Tab
Meta data can be supplied to specify the categorization of the attributes in the Attributes tab. Unlike the Quick Edit tab, all attributes of a tag as defined by that tags content model, are displayed.
To specify a category for an attribute, supply a "category" trait like below:
<trait id="category"> <value>someCategoryName</value> </trait>
ITagAttributeCellEditorFactories
Which dialog fields for the Quick Edit tab, and which Cell Editors for the Attributes tab get created for a particular tag attribute, depends on it's attribute value type as defined by that attribute's "attribute-value-runtime-type" trait.
A default factory has been provided for the known types, but a developer may provide their own types which would require a factory, or they may wish to override the default factory. This mechanism is not new to this release, but it has been changed to support the new meta data.
To define your own factory, one would create an implementation of org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory
and register it using the org.eclipse.jst.pagedesigner.pageDesignerExtension.tagAttributeCellEditorFactory
extension-point. In the prior release one would use, the now deprecated and unused, org.eclipse.jst.pagedesigner.pageDesignerExtension.attributeCellEditorFactory
.
CMRegistry Meta Data
In the prior release, "configFiles" were used to provide tag library meta data that was specific to the WPE property pages. In order to ease the transition for any current adopters, a temporary "translator" has been provided to make available existing CMRegistry config meta data in "standard" meta data form. The configFile attribute value types have been mapped as close as possible to the known org.eclipse.jst.jsf.AttributeValueRuntimeType
extensions.
The org.eclipse.jst.pagedesigner.cmRegistry
extension-point and related code is now deprecated, and adopters should plan on migrating all their data to org.eclipse.jst.jsf.common.standardMetaDataFiles before WTP3.0GA in June 2008. At that time, the temporary translator code may no longer be included in the build.