use of org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionAttributeCommand in project webtools.sourceediting by eclipse.
the class ExtensionsSection method getAddExtensionCommand.
protected AddExtensionCommand getAddExtensionCommand(Object o) {
AddExtensionCommand addExtensionCommand = null;
if (o instanceof XSDElementDeclaration) {
XSDElementDeclaration element = (XSDElementDeclaration) o;
ExtensibleAddExtensionCommand extensibleAddExtensionCommand = getExtensionsSchemasRegistry().getAddExtensionCommand(element.getTargetNamespace());
if (extensibleAddExtensionCommand != null) {
extensibleAddExtensionCommand.setInputs((XSDConcreteComponent) input, element);
addExtensionCommand = extensibleAddExtensionCommand;
} else {
addExtensionCommand = new AddExtensionElementCommand(Messages._UI_ACTION_ADD_APPINFO_ELEMENT, (XSDConcreteComponent) input, element);
}
} else if (o instanceof XSDAttributeDeclaration) {
XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) o;
addExtensionCommand = new AddExtensionAttributeCommand(Messages._UI_ACTION_ADD_APPINFO_ATTRIBUTE, (XSDConcreteComponent) input, attribute);
}
return addExtensionCommand;
}
Aggregations