Java Reference
In-Depth Information
If we launch the runtime workbench and open one of our existing
.requirements
models, we will see that our editor now has two pages: one the
familiar Selection page, the other our new Diagram page. Although it's working,
we need to fix a few more items, including the Properties view, which currently
does not respond to diagram selections. Also, you'll notice that the diagram tool-
bar is missing and that the Outline view has no diagram overview.
Properties View
The explanation for the Properties view not working is obvious. GMF editors use
the tabbed properties by default, but EMF uses the “classic” view. We can update
the
RequirementsEditor
to implement
ITabbedPropertySheet
PageContributor
, add method
getContributorId()
, and update
getPropertySheetPage()
. Note that we need to change the type of
propertySheetPage
to
PropertiesBrowserPage
.
/**
* This is the property sheet page.
* Modified to support tabbed properties.
*
* @generated
NOT
*/
protected PropertiesBrowserPage propertySheetPage;
/**
* This accesses a cached version of the property sheet.
* Modified to support tabbed properties view.
*
* @generated
NOT
*/
public
IPropertySheetPage getPropertySheetPage() {
if (propertySheetPage == null) {
propertySheetPage =
new
PropertiesBrowserPage(this) {
public void
setActionBars(IActionBars actionBars) {
super.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
}
return
propertySheetPage;
}
public
String getContributorId() {
return
diagramEditor.getContributorId();
}
This fixes our diagram page but breaks our tree selection page. The reason
is that the contribution to the
*.tabbed.propertySections
extension-point
Search WWH ::
Custom Search