diff options
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java')
-rw-r--r-- | bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java deleted file mode 100644 index a6f9641561..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.editor; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.gef.commands.Command; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDConstants; - -public class XSDSubstitutionGroupEditManager extends XSDElementReferenceEditManager -{ - - public XSDSubstitutionGroupEditManager(IFile currentFile, XSDSchema[] schemas) - { - super(currentFile, schemas); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) - { - XSDElementDeclaration concreteComponent = null; - if (referencingObject instanceof Adapter) - { - Adapter adapter = (Adapter)referencingObject; - if (adapter.getTarget() instanceof XSDElementDeclaration) - { - concreteComponent = (XSDElementDeclaration)adapter.getTarget(); - } - } - else if (referencingObject instanceof XSDConcreteComponent) - { - concreteComponent = (XSDElementDeclaration) referencingObject; - } - if (concreteComponent != null) - { - if (component.isNew()) - { - XSDElementDeclaration elementDec = null; - if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME) - { - AddXSDElementCommand command = new AddXSDElementCommand(Messages._UI_ACTION_ADD_ELEMENT, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - elementDec = (XSDElementDeclaration) command.getAddedComponent(); - } - if (elementDec != null) - { - Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, elementDec.getQName(concreteComponent.getSchema())); - command.execute(); - } - } - else - { - Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, ((XSDElementDeclaration)component.getObject()).getQName(concreteComponent.getSchema())); - command.execute(); - } - } - } -} |