Java Reference
In-Depth Information
// . . .
ViewerFilter[] outlineFilters = new ViewerFilter[1];
outlineFilters[0] = new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object
element) {
return !(element instanceof Diagram);
}
};
viewer.setFilters(outlineFilters);
// . . .
}
At this point, we can run our editor and test its functionality. We still have
some bugs to work out, but it's largely functional at this point.
Properties Revisited
The default generated properties from both EMF and GMF are simple tables,
with the exception of diagram element properties that use form-based property
sheets. The default is fine for certain property types, but it's painful to deal with
long text strings such as a requirement's description property. Even the EMF gen-
erator model's Property Multiline option is painful because you need to first
open a dialog from the Properties view. In this section, we generate a custom
property sheet tab that we can use to provide a large text area for the description
property.
To begin, open the requirements.gmfgen model and navigate to the
Property Sheet element. Create a new Custom Property Tab element and
populate it according to Table 4-19. Note that we're interested in only the
Requirement class, so we enter its domain model class and corresponding dia-
gram EditPart class.
Table 4-19
Requirements Custom Property Tab
Element
Property
Value
Gen Editor Generator
Property Sheet
Custom Property
Human Readable
Description
Tab
Label
Identifier
description
Implementation
Class
RequirementDescriptionPropertySection
Search WWH ::




Custom Search