Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<copyright> Copyright (c) 2002-2007 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: XSDAttributeGroupDefinitionItemProvider.java,v 1.7 2007/03/22 02:06:23 davidms Exp $
 
 package org.eclipse.xsd.provider;
 
 
 import java.util.List;
 
 
This is the item provider adpater for a org.eclipse.xsd.XSDAttributeGroupDefinition object.
 
   implements 
 {
  
This constructs an instance from a factory and a notifier.
 
   {
     super(adapterFactory);
   }

  
This returns the property descriptors for the adapted class.
 
   @Override
   {
     if ( == null)
     {
       super.getPropertyDescriptors(object);
 
       // This is for the attributeWildcard feature.
       //
         (new ItemPropertyDescriptor
            ..getString("_UI_AttributeWildcard_label"),
            ..getString("_UI_AttributeWildcardOfAttributeGroup_description"),
            false));
 
       // This is for the annotation feature.
       //
         (new ItemPropertyDescriptor
            ..getString("_UI_Annotation_label"),
            ..getString("_UI_AnnotationOfAttributeGroup_description"),
            false));
 
       // This is for the resolvedAttributeGroupDefinition feature.
       //
         (new ItemPropertyDescriptor
            ..getString("_UI_ResolvedAttributeGroupDefinition_label"),
            ..getString("_UI_ResolvedAttributeGroupDefinition_description"),
            false));
     }
  }

  
  public Collection<? extends EStructuralFeaturegetChildrenFeatures(Object object)
  {
    if ( == null)
    {
      super.getChildrenFeatures(object);
    }
    return ;
  }
  protected EStructuralFeature getChildFeature(Object objectObject child)
  {
    EObject refObject = (EObject)child;
    if (refObject instanceof XSDAttributeDeclaration)
    {
      // TODO: check that this is what you want.
    }
    return super.getChildFeature(objectchild);
  }

  
This returns XSDAttributeGroupDefinition.gif.
  public Object getImage(Object object)
  {
    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = ((XSDAttributeGroupDefinition)object);
    XSDAttributeGroupDefinition resolvedAttributeGroupDefinition = xsdAttributeGroupDefinition.getResolvedAttributeGroupDefinition();
    return 
        (resolvedAttributeGroupDefinition.getContainer() == null ?
          "full/obj16/XSDAttributeGroupUnresolved" :
          xsdAttributeGroupDefinition.getResolvedAttributeGroupDefinition() == xsdAttributeGroupDefinition ?
            "full/obj16/XSDAttributeGroupDefinition" :
            "full/obj16/XSDAttributeGroupUse");
  }
  public String getText(Object object)
  {
    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = ((XSDAttributeGroupDefinition)object);
    String result =  
      xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ?
        xsdAttributeGroupDefinition.getQName() :
        xsdAttributeGroupDefinition.getName();
    return result == null ? ..getString("_UI_Absent_label") : result;
  }

  
This handles notification by calling fireNotifyChanged.
  public void notifyChanged(Notification msg
  {
    if (
       )
    {
      fireNotifyChanged(msg);
      return;
    }
    super.notifyChanged(msg);
  }

  
This adds org.eclipse.emf.edit.command.CommandParameters describing the children that can be created under this object.
  protected void collectNewChildDescriptors(Collection<ObjectnewChildDescriptorsObject object)
  {
    super.collectNewChildDescriptors(newChildDescriptorsobject);
    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinitionobject;
    if (!xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
    {
      // annotation
      //
      newChildDescriptors.add
        (createChildParameter
           .createXSDAnnotation()));
      // attribute declaration under attribute use
      //
      XSDAttributeDeclaration xsdAttributeDeclaration = createAttributeDeclaration(xsdAttributeGroupDefinition);
      newChildDescriptors.add
        (createChildParameter
           createAttributeUse(xsdAttributeDeclarationfalse)));
      // attribute declaration reference under attribute use
      //
      newChildDescriptors.add
        (createChildParameter
           createAttributeUse(xsdAttributeGroupDefinition.resolveAttributeDeclaration(""), true)));
      // attribute group definition reference
      //
      newChildDescriptors.add
        (createChildParameter
          createAttributeGroupDefinitionReference(xsdAttributeGroupDefinition.resolveAttributeGroupDefinition(""))));
      // attribute wildcard
      //
      newChildDescriptors.add
        (createChildParameter
           .createXSDWildcard()));
    }
  }
New to GrepCode? Check out our FAQ X