Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<copyright> Copyright (c) 2002-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 - Initial API and implementation </copyright> $Id: XSDSemanticItemProviderAdapterFactory.java,v 1.6 2006/12/29 18:32:33 marcelop Exp $
 
 package org.eclipse.xsd.provider;
 
 
 import java.util.List;
 
 
 
 
 {
   {
     super();
   }
 
   @Override
   {
     // if (xsdSchemaItemProvider == null)
     {
        = 
         new XSDSchemaItemProvider(this)
         {
           protected List<Objectchildren;
 
           @Override
           public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
           {
             return Collections.emptyList();
           }
 
           @Override
           public Collection<?> getChildren(Object object)
           {
             if ( == null)
             {
               final XSDSchema xsdSchema = (XSDSchema)object;
               class ChildItemProvider extends ItemProvider
               {
                 Collection<?> children;
                 public ChildItemProvider(String labelObject imageCollection<?> children)
                 {
                   super(labelimagexsdSchema);
                   this. = children;
                 }
                 @Override
                 public boolean hasChildren(Object o)
                 {
                   return !.isEmpty();
                 }
                 @Override
                 public Collection<?> getChildren(Object o)
                 {
                   return ;
                 }
               }
 
                = new ArrayList<Object>();
               .add
                 (new ChildItemProvider
                   (..getString("_UI_Elements_label"), 
                     ..getImage("full/obj16/XSDElementDeclaration"),
                     xsdSchema.getElementDeclarations()));
               .add
                 (new ChildItemProvider
                   (..getString("_UI_Attributes_label"),
                    ..getImage("full/obj16/XSDAttributeDeclaration"),
                    xsdSchema.getAttributeDeclarations()));
              .add
                (new ChildItemProvider
                  (..getString("_UI_AttributeGroups_label"), 
                    ..getImage("full/obj16/XSDAttributeGroupDefinition"),
                    xsdSchema.getAttributeGroupDefinitions()));
              .add
                (new ChildItemProvider
                  (..getString("_UI_Types_label"), 
                    ..getImage("full/obj16/XSDTypeDefinition"),
                    xsdSchema.getTypeDefinitions()));
              .add
                (new ChildItemProvider
                  (..getString("_UI_ModelGroups_label"), 
                    ..getImage("full/obj16/XSDModelGroupDefinition"),
                    xsdSchema.getModelGroupDefinitions()));
              .add
                (new ChildItemProvider
                  (..getString("_UI_Notations_label"), 
                    ..getImage("full/obj16/XSDNotationDeclaration"),
                    xsdSchema.getNotationDeclarations()));
              .add
                (new ChildItemProvider
                  (..getString("_UI_IdentityConstraints_label"), 
                    ..getImage("full/obj16/XSDIdentityConstraintDefinitionKey"),
                    xsdSchema.getIdentityConstraintDefinitions()));
              .add
                (new ChildItemProvider
                  (..getString("_UI_Annotations_label"), 
                    ..getImage("full/obj16/XSDAnnotation"),
                    xsdSchema.getAnnotations()));
            }
            return ;
          }
          @Override
          public void notifyChanged(final Notification msg)
          {
            class CagetoryNotification extends NotificationImpl
            {
              protected Object category;
              public CagetoryNotification(Object category)
              {
                super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
                this. = category;
              }
              @Override
              public Object getNotifier()
              {
                return ;
              }
              @Override
              public Object getFeature()
              {
                return msg.getFeature();
              }
            }
            if (msg.getFeature() == .getXSDSchema_ElementDeclarations())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(0)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_AttributeDeclarations())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(1)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_AttributeGroupDefinitions())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(2)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_TypeDefinitions())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(3)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_ModelGroupDefinitions())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(4)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_NotationDeclarations())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(5)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_IdentityConstraintDefinitions())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(6)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_Annotations())
            {
              this.fireNotifyChanged(new CagetoryNotification(.get(7)));
              return;
            }
            else if (msg.getFeature() == .getXSDSchema_SchemaLocation())
            {
              this.fireNotifyChanged(msg);
              return;
            }
            super.notifyChanged(msg);
          }
        };
    }
    return ;
  }
  {
    if ( == null)
    {
        new XSDElementDeclarationItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(0);
            }
            else
            {
              return result;
            }
          }
          @Override
          public String getText(Object object)
          {
            XSDElementDeclaration xsdElementDeclaration = ((XSDElementDeclaration)object);
            XSDElementDeclaration resolvedXSDElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
            return resolvedXSDElementDeclaration.getName();
          }
        };
    }
  }
  {
    {
        new XSDAttributeDeclarationItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(1);
            }
            return result;
          }
          @Override
          public String getText(Object object)
          {
            XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
            XSDAttributeDeclaration resolvedXSDAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
            String result = resolvedXSDAttributeDeclaration.getName();
            return result == null ? ..getString("_UI_Absent_label") : result;
          }
        };
    }
  }
  {
    {
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(2);
            }
            else
            {
              return result;
            }
          }
        };
    }
  }
  {
    {
        new XSDComplexTypeDefinitionItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(3);
            }
            else
            {
              return result;
            }
          }
          @Override
          public String getText(Object object)
          {
            return getText(objectfalse);
          }
        };
    }
  }
  {
    {
        new XSDSimpleTypeDefinitionItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(3);
            }
            else
            {
              return result;
            }
          }
          @Override
          public String getText(Object object)
          {
            return getText(objectfalse);
          }
        };
    }
  }
  {
    {
        new XSDModelGroupDefinitionItemProvider(this)
        {
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(4);
            }
            else
            {
              return result;
            }
          }
        };
    }
  }
  {
    {
        new XSDNotationDeclarationItemProvider(this)
        {
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(5);
            }
            else
            {
              return result;
            }
          }
        };
    }
  }
  {
    if ( == null)
    {
        new XSDAnnotationItemProvider(this)
        {
          @Override
          public Object getParent(Object object)
          {
            Object result = super.getParent(object);
            if (result instanceof XSDSchema)
            {
              return ((List<?>)new AdapterFactoryItemDelegator(XSDSemanticItemProviderAdapterFactory.this).getChildren(result)).get(7);
            }
            else
            {
              return result;
            }
          }
        };
    }
  }
  {
    if ( == null)
    {
        new XSDParticleItemProvider(this)
        {
          @Override
          protected XSDParticleContent getDelegate(XSDParticle xsdParticle)
          {
            return xsdParticle.getTerm();
          }
        };
    }
  }
  {
    if ( == null)
    {
        new XSDModelGroupItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
              .add(1, .getXSDModelGroup_Particles());
            }
            return ;
          }
        };
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
        new XSDEnumerationFacetItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
        };
    }
  }
  {
    if ( == null)
    {
        new XSDPatternFacetItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
        };
    } 
  }
  {
    if ( == null)
    {
        new XSDAttributeUseItemProvider(this)
        {
          @Override
          public XSDAttributeDeclaration getDelegate(XSDAttributeUse xsdAttributeUse)
          {
            return xsdAttributeUse.getAttributeDeclaration();
          }
        };
    }
  }
  {
    if ( == null)
    {
        new XSDWildcardItemProvider(this)
        {
          @Override
          public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
          {
            if ( == null)
            {
              super.getChildrenFeatures(object);
            }
            return ;
          }
          @Override
          public String getText(Object object)
          {
            XSDWildcard xsdWildcard = (XSDWildcard)object;
            if (. == xsdWildcard.getNamespaceConstraintCategory())
            {
              return "any";
            }
            else if (. == xsdWildcard.getNamespaceConstraintCategory())
            {
              return "not " + xsdWildcard.getStringNamespaceConstraint();
            }
            else
            {
              return xsdWildcard.getStringNamespaceConstraint();
            }
          }
        };
    }
  }
  {
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
  }
  {
    if ( == null)
    {
    }
    return ;
  }
  {
    if ( == null)
    {
    }
    return ;
  }

  
This creates an adapter for a org.eclipse.xsd.XSDDiagnostic.
  {
    if ( == null)
    {
    }
  }

  
This creates an adapter for a org.eclipse.xsd.XSDMinFacet.
  {
    if ( == null)
    {
    }
  }

  
This creates an adapter for a org.eclipse.xsd.XSDMaxFacet.
  {
    if ( == null)
    {
    }
  }