diff options
author | nitind | 2007-12-18 19:00:51 +0000 |
---|---|---|
committer | nitind | 2007-12-18 19:00:51 +0000 |
commit | a8917434f20ed2c52ffb7c2b301f5d03a252233b (patch) | |
tree | f042ccbd0325f7329123ed79310e1e5fac73d14c /bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java | |
parent | f211095b13d23eaa11a67673e5918bafd532cae0 (diff) | |
download | webtools.sourceediting-200712181901.tar.gz webtools.sourceediting-200712181901.tar.xz webtools.sourceediting-200712181901.zip |
This commit was manufactured by cvs2svn to create tag 'v200712181901'.v200712181901
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java')
-rw-r--r-- | bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java | 177 |
1 files changed, 0 insertions, 177 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java deleted file mode 100644 index 081788de7f..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java +++ /dev/null @@ -1,177 +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.adapters; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.xsd.XSDAttributeDeclaration; -import org.eclipse.xsd.XSDAttributeGroupContent; -import org.eclipse.xsd.XSDAttributeGroupDefinition; -import org.eclipse.xsd.XSDAttributeUse; -import org.eclipse.xsd.XSDComplexTypeDefinition; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDModelGroup; -import org.eclipse.xsd.XSDModelGroupDefinition; -import org.eclipse.xsd.XSDParticle; -import org.eclipse.xsd.XSDSimpleTypeDefinition; -import org.eclipse.xsd.XSDWildcard; - -public class XSDVisitorForFields extends XSDVisitor -{ - public XSDVisitorForFields() - { - } - - public List concreteComponentList = new ArrayList(); - public List thingsWeNeedToListenTo = new ArrayList(); - - public void visitComplexTypeDefinition(XSDComplexTypeDefinition type) - { - if (type.getAttributeContents() != null) - { - for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); ) - { - XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next(); - if (attrGroupContent instanceof XSDAttributeUse) - { - XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent; - - visitAttributeDeclaration(attrUse.getContent()); - -// if (attrUse.getAttributeDeclaration() != attrUse.getContent()) -// { -// visitAttributeDeclaration(attrUse.getContent()); -// } -// else -// { -// thingsWeNeedToListenTo.add(attrUse.getAttributeDeclaration()); -// concreteComponentList.add(attrUse.getAttributeDeclaration()); -// } - } - else if (attrGroupContent instanceof XSDAttributeGroupDefinition) - { - XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)attrGroupContent; - thingsWeNeedToListenTo.add(attrGroup); - if (attrGroup.isAttributeGroupDefinitionReference()) - { - attrGroup = attrGroup.getResolvedAttributeGroupDefinition(); - visitAttributeGroupDefinition(attrGroup); - } - } - } - } - if (type.getAttributeWildcard() != null) - { - thingsWeNeedToListenTo.add(type.getAttributeWildcard()); - concreteComponentList.add(type.getAttributeWildcard()); - } - super.visitComplexTypeDefinition(type); - } - - public void visitComplexTypeContent(XSDSimpleTypeDefinition content) - { - thingsWeNeedToListenTo.add(content); - - super.visitComplexTypeContent(content); - } - - - public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef) - { - if (modelGroupDef.isModelGroupDefinitionReference()) - { - // if it's a reference we need to listen to the reference incase it changes - thingsWeNeedToListenTo.add(modelGroupDef); - } - // listen to definition incase it changes - XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition(); - thingsWeNeedToListenTo.add(resolvedModelGroupDef); - super.visitModelGroupDefinition(modelGroupDef); - } - - public void visitModelGroup(XSDModelGroup modelGroup) - { - super.visitModelGroup(modelGroup); - thingsWeNeedToListenTo.add(modelGroup); - } - - public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup) - { - for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); ) - { - Object o = it.next(); - if (o instanceof XSDAttributeUse) - { - XSDAttributeUse attributeUse = (XSDAttributeUse)o; - concreteComponentList.add(attributeUse.getAttributeDeclaration()); - thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration()); - } - else if (o instanceof XSDAttributeGroupDefinition) - { - XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o; - thingsWeNeedToListenTo.add(attrGroup); - if (attrGroup.isAttributeGroupDefinitionReference()) - { - attrGroup = attrGroup.getResolvedAttributeGroupDefinition(); - visitAttributeGroupDefinition(attrGroup); - } - } - } - } - - public void visitParticle(XSDParticle particle) - { - thingsWeNeedToListenTo.add(particle); - super.visitParticle(particle); - } - - public void visitWildcard(XSDWildcard wildcard) - { - concreteComponentList.add(wildcard); - } - - public void visitElementDeclaration(XSDElementDeclaration element) - { - if (element.isElementDeclarationReference()) - { - thingsWeNeedToListenTo.add(element); - thingsWeNeedToListenTo.add(element.getResolvedElementDeclaration()); - // now, add the reference as a field - concreteComponentList.add(element); - } - else - { - concreteComponentList.add(element.getResolvedElementDeclaration()); - // note... we intentionally ommit the call to super.visitElementDeclaration() - // since we don't want to delve down deeper than the element - } - } - - public void visitAttributeDeclaration(XSDAttributeDeclaration attr) - { - if (attr.isAttributeDeclarationReference()) - { - thingsWeNeedToListenTo.add(attr); - thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration()); - concreteComponentList.add(attr); - } - else - { - concreteComponentList.add(attr.getResolvedAttributeDeclaration()); - thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration()); - } - } -}
\ No newline at end of file |