Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2005-02-25 19:12:08 +0000
committernitind2005-02-25 19:12:08 +0000
commit98b633fe963c79a039b412e8724c854383a79209 (patch)
tree0db112160d8f3a1c6d0b39803bc2e686815ed491 /bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
parentc25f3c483fa12121f9644ede17b92c45bf38dfc7 (diff)
downloadwebtools.sourceediting-20050225_1500.tar.gz
webtools.sourceediting-20050225_1500.tar.xz
webtools.sourceediting-20050225_1500.zip
This commit was manufactured by cvs2svn to create tag 'v20050225_1500'.v20050225_1500
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java')
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java102
1 files changed, 0 insertions, 102 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
deleted file mode 100644
index 2d5ed5c029..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.refactor.delete;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class GlobalAttributeGroupCleanup extends BaseGlobalCleanup
-{
- /**
- * Constructor for GlobalAttributeGroupCleanup.
- * @param deletedItem
- */
- public GlobalAttributeGroupCleanup(XSDConcreteComponent deletedItem)
- {
- super(deletedItem);
- }
-
-
- protected String replacementName = null;
-
- protected String getReplacementElementName()
- {
- if (replacementName == null)
- {
- TypesHelper helper = new TypesHelper(schema);
-
- List elements = helper.getGlobalAttributeGroups();
-
- String deletedName = getDeletedQName();
- for (Iterator i = elements.iterator(); i.hasNext();)
- {
- String name = (String) i.next();
- if (!name.equals(deletedName))
- {
- replacementName = name;
- break;
- }
- }
- }
- return replacementName;
- }
-
- /**
- * @see org.eclipse.wst.xsd.ui.internal.refactor.XSDVisitor#visitComplexTypeDefinition(XSDComplexTypeDefinition)
- */
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- super.visitComplexTypeDefinition(type);
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroupDef = (XSDAttributeGroupDefinition) attrGroupContent;
-
- if (deletedItem.equals(attrGroupDef.getResolvedAttributeGroupDefinition()))
- {
- if (getReplacementElementName() != null)
- {
- // String msg = XSDPlugin.getSchemaString("_INFO_RESET_ATTRIBUTE_GROUP_REFERENCE") + " <" + getReplacementElementName() + ">";
- String msg = "Reset attribute group reference " + " <" + getReplacementElementName() + ">";
- addMessage(msg, attrGroupDef);
- attrGroupDef.getElement().setAttribute(XSDConstants.REF_ATTRIBUTE, getReplacementElementName());
- }
- else
- {
- // remove the attribute group reference
- String name = getNamedComponentName(type);
- // String msg = XSDPlugin.getSchemaString("_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE") + " <" + name + ">";
- String msg = "Remove attribute group reference " + " <" + name + ">";
-
- addMessage(msg, attrGroupDef.getContainer());
-
- childrenToRemove.add(attrGroupDef.getElement());
- }
- }
- }
- }
- }
-
- }
-
-}

Back to the top