Java Reference
In-Depth Information
</propertySection>
</propertySections>
</extension>
The generated class extends the runtime's
AdvancedPropertySection
class. This provides the same table style of property view we're trying to replace,
so we can delete the class content and have it extend the provided
AbstractBasicTextPropertySection
class, as shown here. This class pro-
vides a simple text field with code that sets up a forms-based property sheet, just
as we wanted. Some changes we've made include the use of a text area and not
a single line text field. Also, we have overridden the
unwrap()
method to iden-
tify our
Requirement
s class or edit part properly, ensuring that the sheet will
work when selections are made in both the diagram and tree view.
/**
* @generated NOT
*/
public class
RequirementDescriptionPropertySection
extends
AbstractBasicTextPropertySection {
@Override
protected
String getPropertyChangeCommandName() {
return
"RequirementDescriptionChangeCommand";
}
@Override
protected
String getPropertyNameLabel() {
return
"";
}
@Override
protected
String getPropertyValueString() {
String description = ((Requirement)
getEObject()).getDescription();
return
description ==
null
? "" : description;
}
@Override
protected void
setPropertyValue(EObject object, Object value) {
((Requirement) getEObject()).setDescription((String) value);
}
protected
Text createTextWidget(Composite parent) {
Text text = getWidgetFactory().createText(parent,
StringStatics.BLANK,
SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
FormData data =
new
FormData();
Search WWH ::
Custom Search