use of org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ReferenceDirectEditManager in project webtools.sourceediting by eclipse.
the class XSDBaseFieldEditPart method directEditNameField.
protected void directEditNameField() {
Object model = getModel();
IFieldFigure fieldFigure = getFieldFigure();
if (model instanceof IField) {
IField field = (IField) model;
if (field.isReference()) {
ReferenceDirectEditManager manager = null;
if (field instanceof XSDElementDeclarationAdapter) {
manager = new ElementReferenceDirectEditManager((IField) model, this, fieldFigure.getNameLabel());
} else if (field instanceof XSDAttributeDeclarationAdapter) {
manager = new AttributeReferenceDirectEditManager((IField) model, this, fieldFigure.getNameLabel());
}
if (manager != null) {
ReferenceUpdateCommand elementUpdateCommand = new ReferenceUpdateCommand();
elementUpdateCommand.setDelegate(manager);
adtDirectEditPolicy.setUpdateCommand(elementUpdateCommand);
manager.show();
}
} else {
LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, null));
NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
adtDirectEditPolicy.setUpdateCommand(wrapper);
manager.show();
}
}
}
Aggregations