Search in sources :

Example 1 with AddExtensionAttributeCommand

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;
}
Also used : AddExtensionElementCommand(org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionElementCommand) XSDConcreteComponent(org.eclipse.xsd.XSDConcreteComponent) XSDElementDeclaration(org.eclipse.xsd.XSDElementDeclaration) AddExtensionAttributeCommand(org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionAttributeCommand) ExtensibleAddExtensionCommand(org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand) XSDAttributeDeclaration(org.eclipse.xsd.XSDAttributeDeclaration) ExtensibleAddExtensionCommand(org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand) AddExtensionCommand(org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionCommand)

Aggregations

AddExtensionAttributeCommand (org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionAttributeCommand)1 AddExtensionCommand (org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionCommand)1 AddExtensionElementCommand (org.eclipse.wst.xsd.ui.internal.common.commands.AddExtensionElementCommand)1 ExtensibleAddExtensionCommand (org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand)1 XSDAttributeDeclaration (org.eclipse.xsd.XSDAttributeDeclaration)1 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)1 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)1