org.eclipse.xsd.edit_2.6.0.v20120130-0943

16:49:37.627 INFO  jd.cli.Main - Decompiling org.eclipse.xsd.edit_2.6.0.v20120130-0943.jar
package org.eclipse.xsd.provider;

import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.xsd.XSDAnnotation;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class XSDAnnotationItemProvider
  extends XSDComponentItemProvider
  implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
{
  public XSDAnnotationItemProvider(AdapterFactory adapterFactory)
  {
    super(adapterFactory);
  }
  
  public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
  {
    if (itemPropertyDescriptors == null) {
      super.getPropertyDescriptors(object);
    }
    return itemPropertyDescriptors;
  }
  
  public Object getImage(Object object)
  {
    return XSDEditPlugin.INSTANCE.getImage("full/obj16/XSDAnnotation");
  }
  
  public String getText(Object object)
  {
    XSDAnnotation xsdAnnotation = (XSDAnnotation)object;
    String result = "";
    List<Element> userInformation = xsdAnnotation.getUserInformation();
    if (!userInformation.isEmpty())
    {
      Element element = (Element)userInformation.get(0);
      if (element.hasAttribute("source"))
      {
        result = element.getAttribute("source");
      }
      else
      {
        Node text = element.getFirstChild();
        while ((text instanceof Element)) {
          text = ((Element)text).getFirstChild();
        }
        if ((text != null) && (text.getNodeValue() != null))
        {
          result = text.getNodeValue();
          result = result.trim();
          if (result.length() > 50) {
            result = result.substring(0, 50) + XSDEditPlugin.INSTANCE.getString("_UI_DotDotDot_label");
          }
        }
      }
    }
    return result;
  }
  
  public void notifyChanged(Notification msg)
  {
    super.notifyChanged(msg);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAnnotationItemProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDPackage;

class XSDAttributeDeclarationItemProvider$1
  extends XSDAttributeDeclarationItemProvider.DelegatingItemPropertyDescriptor
{
  XSDAttributeDeclarationItemProvider$1(XSDAttributeDeclarationItemProvider paramXSDAttributeDeclarationItemProvider, AdapterFactory $anonymous0, String $anonymous1, String $anonymous2, EStructuralFeature $anonymous3, boolean $anonymous4, Object $anonymous5)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3, $anonymous4, $anonymous5);
  }
  
  public void setPropertyValue(Object o, Object value)
  {
    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)o;
    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
    {
      XSDAttributeDeclaration newResolvedAttributeDeclaration = 
        xsdAttributeDeclaration.resolveAttributeDeclaration(xsdAttributeDeclaration.getTargetNamespace(), (String)value);
      EditingDomain editingDomain = getEditingDomain(xsdAttributeDeclaration);
      if (editingDomain == null) {
        xsdAttributeDeclaration.setResolvedAttributeDeclaration(newResolvedAttributeDeclaration);
      } else {
        editingDomain.getCommandStack().execute(
          SetCommand.create(
          editingDomain, 
          xsdAttributeDeclaration, 
          XSDAttributeDeclarationItemProvider.xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration(), 
          newResolvedAttributeDeclaration));
      }
    }
    else
    {
      super.setPropertyValue(o, value);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeDeclarationItemProvider.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDPackage;

class XSDAttributeDeclarationItemProvider$2
  extends XSDAttributeDeclarationItemProvider.DelegatingItemPropertyDescriptor
{
  XSDAttributeDeclarationItemProvider$2(XSDAttributeDeclarationItemProvider paramXSDAttributeDeclarationItemProvider, AdapterFactory $anonymous0, String $anonymous1, String $anonymous2, EStructuralFeature $anonymous3, boolean $anonymous4, Object $anonymous5)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3, $anonymous4, $anonymous5);
  }
  
  public void setPropertyValue(Object o, Object value)
  {
    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)o;
    if (xsdAttributeDeclaration.isAttributeDeclarationReference())
    {
      String namespace = (String)value;
      if (namespace.length() == 0) {
        namespace = null;
      }
      XSDAttributeDeclaration newResolvedAttributeDeclaration = 
        xsdAttributeDeclaration.resolveAttributeDeclaration(namespace, xsdAttributeDeclaration.getName());
      EditingDomain editingDomain = getEditingDomain(xsdAttributeDeclaration);
      if (editingDomain == null) {
        xsdAttributeDeclaration.setResolvedAttributeDeclaration(newResolvedAttributeDeclaration);
      } else {
        editingDomain.getCommandStack().execute(
          SetCommand.create(
          editingDomain, 
          xsdAttributeDeclaration, 
          XSDAttributeDeclarationItemProvider.xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration(), 
          newResolvedAttributeDeclaration));
      }
    }
    else
    {
      super.setPropertyValue(o, value);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeDeclarationItemProvider.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDForm;
import org.eclipse.xsd.XSDSchema;

class XSDAttributeDeclarationItemProvider$3
  extends XSDItemProviderAdapter.ItemPropertyDescriptorWithDefault
{
  XSDAttributeDeclarationItemProvider$3(XSDAttributeDeclarationItemProvider paramXSDAttributeDeclarationItemProvider, AdapterFactory $anonymous0, String $anonymous1, String $anonymous2, EStructuralFeature $anonymous3, boolean $anonymous4, Object $anonymous5)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3, $anonymous4, $anonymous5);
  }
  
  public Object getPropertyDefaultValue(Object o)
  {
    return 
      XSDEditPlugin.INSTANCE.getString(
      "_UI_DefaultValue_label", new Object[] { ((XSDAttributeDeclaration)o).getSchema().getAttributeFormDefault().getName() });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeDeclarationItemProvider.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.xsd.XSDAttributeDeclaration;

public class XSDAttributeDeclarationItemProvider$DelegatingItemPropertyDescriptor
  extends ItemPropertyDescriptor
{
  public XSDAttributeDeclarationItemProvider$DelegatingItemPropertyDescriptor(AdapterFactory adapterFactory, String displayName, String description, EStructuralFeature feature, boolean isSettable, Object staticImage)
  {
    super(adapterFactory, displayName, description, feature, isSettable, staticImage);
  }
  
  public Object getPropertyValue(Object object)
  {
    return super.getPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration());
  }
  
  public void setPropertyValue(Object object, Object value)
  {
    super.setPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration(), value);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeDeclarationItemProvider.DelegatingItemPropertyDescriptor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDAttributeUse;
import org.eclipse.xsd.XSDConcreteComponent;
import org.eclipse.xsd.XSDFactory;
import org.eclipse.xsd.XSDForm;
import org.eclipse.xsd.XSDPackage;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;

public class XSDAttributeDeclarationItemProvider
  extends XSDFeatureItemProvider
  implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
{
  public XSDAttributeDeclarationItemProvider(AdapterFactory adapterFactory)
  {
    super(adapterFactory);
  }
  
  public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
  {
    if (itemPropertyDescriptors == null)
    {
      super.getPropertyDescriptors(object);
      createTypeDefinitionPropertyDescriptor(object);
      createAnnotationPropertyDescriptor(object);
      createResolvedAttributeDeclarationPropertyDescriptor(object);
      createAttributeFormDefaultPropertyDescriptor(object);
    }
    return itemPropertyDescriptors;
  }
  
  protected static class DelegatingItemPropertyDescriptor
    extends ItemPropertyDescriptor
  {
    public DelegatingItemPropertyDescriptor(AdapterFactory adapterFactory, String displayName, String description, EStructuralFeature feature, boolean isSettable, Object staticImage)
    {
      super(displayName, description, feature, isSettable, staticImage);
    }
    
    public Object getPropertyValue(Object object)
    {
      return super.getPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration());
    }
    
    public void setPropertyValue(Object object, Object value)
    {
      super.setPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration(), value);
    }
  }
  
  protected void createNamePropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new DelegatingItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Name_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_Name_description"), 
      xsdPackage.getXSDNamedComponent_Name(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE)
      {
        public void setPropertyValue(Object o, Object value)
        {
          XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)o;
          if (xsdAttributeDeclaration.isAttributeDeclarationReference())
          {
            XSDAttributeDeclaration newResolvedAttributeDeclaration = 
              xsdAttributeDeclaration.resolveAttributeDeclaration(xsdAttributeDeclaration.getTargetNamespace(), (String)value);
            EditingDomain editingDomain = getEditingDomain(xsdAttributeDeclaration);
            if (editingDomain == null) {
              xsdAttributeDeclaration.setResolvedAttributeDeclaration(newResolvedAttributeDeclaration);
            } else {
              editingDomain.getCommandStack().execute(
                SetCommand.create(
                editingDomain, 
                xsdAttributeDeclaration, 
                XSDAttributeDeclarationItemProvider.xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration(), 
                newResolvedAttributeDeclaration));
            }
          }
          else
          {
            super.setPropertyValue(o, value);
          }
        }
      });
  }
  
  protected void createTargetNamespacePropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new DelegatingItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_TargetNamespace_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_TargetNamespace_description"), 
      xsdPackage.getXSDNamedComponent_TargetNamespace(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE)
      {
        public void setPropertyValue(Object o, Object value)
        {
          XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)o;
          if (xsdAttributeDeclaration.isAttributeDeclarationReference())
          {
            String namespace = (String)value;
            if (namespace.length() == 0) {
              namespace = null;
            }
            XSDAttributeDeclaration newResolvedAttributeDeclaration = 
              xsdAttributeDeclaration.resolveAttributeDeclaration(namespace, xsdAttributeDeclaration.getName());
            EditingDomain editingDomain = getEditingDomain(xsdAttributeDeclaration);
            if (editingDomain == null) {
              xsdAttributeDeclaration.setResolvedAttributeDeclaration(newResolvedAttributeDeclaration);
            } else {
              editingDomain.getCommandStack().execute(
                SetCommand.create(
                editingDomain, 
                xsdAttributeDeclaration, 
                XSDAttributeDeclarationItemProvider.xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration(), 
                newResolvedAttributeDeclaration));
            }
          }
          else
          {
            super.setPropertyValue(o, value);
          }
        }
      });
  }
  
  protected void createAttributeFormDefaultPropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new XSDItemProviderAdapter.ItemPropertyDescriptorWithDefault(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Form_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_FormOfAttribute_description"), 
      xsdPackage.getXSDFeature_Form(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE)
      {
        public Object getPropertyDefaultValue(Object o)
        {
          return 
            XSDEditPlugin.INSTANCE.getString(
            "_UI_DefaultValue_label", new Object[] { ((XSDAttributeDeclaration)o).getSchema().getAttributeFormDefault().getName() });
        }
      });
  }
  
  protected void createLexicalValuePropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new DelegatingItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_LexicalValue_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_LexicalValueOfAttribute_description"), 
      xsdPackage.getXSDFeature_LexicalValue(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE));
  }
  
  protected void createConstraintPropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new DelegatingItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Constraint_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_ConstraintOfAttribute_description"), 
      xsdPackage.getXSDFeature_Constraint(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE));
  }
  
  protected void createScopePropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new DelegatingItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Scope_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_ScopeOfAttribute_description"), 
      xsdPackage.getXSDFeature_Scope(), 
      false, 
      null));
  }
  
  protected void createTypeDefinitionPropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new DelegatingItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_TypeDefinition_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_TypeDefinition_description"), 
      xsdPackage.getXSDAttributeDeclaration_TypeDefinition(), 
      false, 
      null));
  }
  
  protected void createAnnotationPropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Annotation_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_AnnotationOfAttribute_description"), 
      xsdPackage.getXSDAttributeDeclaration_Annotation(), 
      false));
  }
  
  protected void createResolvedAttributeDeclarationPropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_ResolveAttributeDeclaration_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_ResolveAttributeDeclaration_description"), 
      xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration(), 
      false));
  }
  
  public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object)
  {
    if (childrenFeatures == null)
    {
      super.getChildrenFeatures(object);
      childrenFeatures.add(xsdPackage.getXSDAttributeDeclaration_AnonymousTypeDefinition());
      childrenFeatures.add(xsdPackage.getXSDAttributeDeclaration_Annotation());
    }
    return childrenFeatures;
  }
  
  public Object getImage(Object object)
  {
    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)object;
    XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
    return 
      XSDEditPlugin.INSTANCE.getImage(
      
      xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration ? 
      "full/obj16/XSDAttributeDeclaration" : resolvedAttributeDeclaration.getContainer() == null ? "full/obj16/XSDAttributeUnresolved" : 
      "full/obj16/XSDAttributeUse");
  }
  
  public String getText(Object object)
  {
    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)object;
    XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
    String name = 
      xsdAttributeDeclaration != resolvedAttributeDeclaration ? 
      xsdAttributeDeclaration.getQName() : 
      xsdAttributeDeclaration.getName();
    
    StringBuffer result = new StringBuffer();
    if (name == null) {
      result.append(XSDEditPlugin.INSTANCE.getString("_UI_Absent_label"));
    } else {
      result.append(name);
    }
    if ((resolvedAttributeDeclaration.getAnonymousTypeDefinition() == null) && (resolvedAttributeDeclaration.getTypeDefinition() != null))
    {
      result.append(" : ");
      result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
    }
    return result.toString();
  }
  
  public void notifyChanged(Notification msg)
  {
    XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)msg.getNotifier();
    if ((msg.getFeature() == xsdPackage.getXSDAttributeDeclaration_TypeDefinition()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeDeclaration_AnonymousTypeDefinition()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeDeclaration_Annotation()))
    {
      fireNotifyChanged(msg);
      
      XSDConcreteComponent container = xsdAttributeDeclaration.getContainer();
      if ((container instanceof XSDAttributeUse)) {
        ((ItemProviderAdapter)adapterFactory.adapt(container, IItemLabelProvider.class)).fireNotifyChanged(
          new ENotificationImpl(
          (InternalEObject)container, 
          msg.getEventType(), 
          (EStructuralFeature)msg.getFeature(), 
          msg.getOldValue(), 
          msg.getNewValue(), 
          msg.getPosition()));
      }
      return;
    }
    super.notifyChanged(msg);
  }
  
  protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
  {
    super.collectNewChildDescriptors(newChildDescriptors, object);
    XSDAttributeDeclaration ad = (XSDAttributeDeclaration)object;
    if (!ad.isAttributeDeclarationReference())
    {
      newChildDescriptors.add(createChildParameter(xsdPackage.getXSDAttributeDeclaration_Annotation(), xsdFactory.createXSDAnnotation()));
      
      addSimpleTypeDefinitionChildParameters(newChildDescriptors, ad, xsdPackage.getXSDAttributeDeclaration_AnonymousTypeDefinition(), true, true, true);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeDeclarationItemProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;

public class XSDAttributeGroupContentItemProvider
  extends XSDItemProviderAdapter
  implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
{
  public XSDAttributeGroupContentItemProvider(AdapterFactory adapterFactory)
  {
    super(adapterFactory);
  }
  
  public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
  {
    if (itemPropertyDescriptors == null) {
      super.getPropertyDescriptors(object);
    }
    return itemPropertyDescriptors;
  }
  
  public void notifyChanged(Notification msg)
  {
    super.notifyChanged(msg);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeGroupContentItemProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDAttributeGroupDefinition;
import org.eclipse.xsd.XSDFactory;
import org.eclipse.xsd.XSDPackage;

public class XSDAttributeGroupDefinitionItemProvider
  extends XSDRedefinableComponentItemProvider
  implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
{
  public XSDAttributeGroupDefinitionItemProvider(AdapterFactory adapterFactory)
  {
    super(adapterFactory);
  }
  
  public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
  {
    if (itemPropertyDescriptors == null)
    {
      super.getPropertyDescriptors(object);
      
      itemPropertyDescriptors.add(
        new ItemPropertyDescriptor(
        ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
        XSDEditPlugin.INSTANCE.getString("_UI_AttributeWildcard_label"), 
        XSDEditPlugin.INSTANCE.getString("_UI_AttributeWildcardOfAttributeGroup_description"), 
        xsdPackage.getXSDAttributeGroupDefinition_AttributeWildcardContent(), 
        false));
      
      itemPropertyDescriptors.add(
        new ItemPropertyDescriptor(
        ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
        XSDEditPlugin.INSTANCE.getString("_UI_Annotation_label"), 
        XSDEditPlugin.INSTANCE.getString("_UI_AnnotationOfAttributeGroup_description"), 
        xsdPackage.getXSDAttributeGroupDefinition_Annotation(), 
        false));
      
      itemPropertyDescriptors.add(
        new ItemPropertyDescriptor(
        ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
        XSDEditPlugin.INSTANCE.getString("_UI_ResolvedAttributeGroupDefinition_label"), 
        XSDEditPlugin.INSTANCE.getString("_UI_ResolvedAttributeGroupDefinition_description"), 
        xsdPackage.getXSDAttributeGroupDefinition_ResolvedAttributeGroupDefinition(), 
        false));
    }
    return itemPropertyDescriptors;
  }
  
  public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object)
  {
    if (childrenFeatures == null)
    {
      super.getChildrenFeatures(object);
      childrenFeatures.add(xsdPackage.getXSDAttributeGroupDefinition_Annotation());
      childrenFeatures.add(xsdPackage.getXSDAttributeGroupDefinition_Contents());
      childrenFeatures.add(xsdPackage.getXSDAttributeGroupDefinition_AttributeWildcardContent());
    }
    return childrenFeatures;
  }
  
  protected EStructuralFeature getChildFeature(Object object, Object child)
  {
    EObject refObject = (EObject)child;
    if ((refObject instanceof XSDAttributeDeclaration)) {
      return xsdPackage.getXSDAttributeGroupDefinition_Contents();
    }
    return super.getChildFeature(object, child);
  }
  
  public Object getImage(Object object)
  {
    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)object;
    XSDAttributeGroupDefinition resolvedAttributeGroupDefinition = xsdAttributeGroupDefinition.getResolvedAttributeGroupDefinition();
    return 
      XSDEditPlugin.INSTANCE.getImage(
      
      xsdAttributeGroupDefinition.getResolvedAttributeGroupDefinition() == xsdAttributeGroupDefinition ? 
      "full/obj16/XSDAttributeGroupDefinition" : resolvedAttributeGroupDefinition.getContainer() == null ? "full/obj16/XSDAttributeGroupUnresolved" : 
      "full/obj16/XSDAttributeGroupUse");
  }
  
  public String getText(Object object)
  {
    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)object;
    String result = 
      xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ? 
      xsdAttributeGroupDefinition.getQName() : 
      xsdAttributeGroupDefinition.getName();
    return result == null ? XSDEditPlugin.INSTANCE.getString("_UI_Absent_label") : result;
  }
  
  public void notifyChanged(Notification msg)
  {
    if ((msg.getFeature() == xsdPackage.getXSDAttributeGroupDefinition_Contents()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeGroupDefinition_AttributeUses()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeGroupDefinition_AttributeWildcardContent()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeGroupDefinition_Annotation()))
    {
      fireNotifyChanged(msg);
      return;
    }
    super.notifyChanged(msg);
  }
  
  protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
  {
    super.collectNewChildDescriptors(newChildDescriptors, object);
    XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)object;
    if (!xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
    {
      newChildDescriptors.add(
        createChildParameter(
        xsdPackage.getXSDAttributeGroupDefinition_Annotation(), 
        xsdFactory.createXSDAnnotation()));
      
      XSDAttributeDeclaration xsdAttributeDeclaration = createAttributeDeclaration(xsdAttributeGroupDefinition);
      newChildDescriptors.add(
        createChildParameter(
        xsdPackage.getXSDAttributeGroupDefinition_Contents(), 
        createAttributeUse(xsdAttributeDeclaration, false)));
      
      newChildDescriptors.add(
        createChildParameter(
        xsdPackage.getXSDAttributeGroupDefinition_Contents(), 
        createAttributeUse(xsdAttributeGroupDefinition.resolveAttributeDeclaration(""), true)));
      
      newChildDescriptors.add(
        createChildParameter(
        xsdPackage.getXSDAttributeGroupDefinition_Contents(), 
        createAttributeGroupDefinitionReference(xsdAttributeGroupDefinition.resolveAttributeGroupDefinition(""))));
      
      newChildDescriptors.add(
        createChildParameter(
        xsdPackage.getXSDAttributeGroupDefinition_AttributeWildcardContent(), 
        xsdFactory.createXSDWildcard()));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeGroupDefinitionItemProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import java.util.Collection;
import java.util.Collections;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandWrapper;

class XSDAttributeUseItemProvider$1
  extends CommandWrapper
{
  XSDAttributeUseItemProvider$1(XSDAttributeUseItemProvider paramXSDAttributeUseItemProvider, Command $anonymous0, Object paramObject)
  {
    super($anonymous0);
  }
  
  private Collection<?> affectedObjects = Collections.EMPTY_SET;
  
  public void execute()
  {
    super.execute();
    affectedObjects = Collections.singleton(val$object);
  }
  
  public void undo()
  {
    super.undo();
    affectedObjects = super.getAffectedObjects();
  }
  
  public void redo()
  {
    super.redo();
    affectedObjects = Collections.singleton(val$object);
  }
  
  public Collection<?> getAffectedObjects()
  {
    return affectedObjects;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.xsd.provider.XSDAttributeUseItemProvider.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.xsd.provider;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandWrapper;
import org.eclipse.emf.common.command.UnexecutableCommand;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.CommandParameter;
import org.eclipse.emf.edit.command.CreateChildCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedImage;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptorDecorator;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDAttributeUse;
import org.eclipse.xsd.XSDAttributeUseCategory;
import org.eclipse.xsd.XSDPackage;

public class XSDAttributeUseItemProvider
  extends XSDComponentItemProvider
  implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
{
  public XSDAttributeUseItemProvider(AdapterFactory adapterFactory)
  {
    super(adapterFactory);
  }
  
  protected XSDAttributeDeclaration getDelegate(XSDAttributeUse xsdAttributeUse)
  {
    return xsdAttributeUse.getContent();
  }
  
  public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
  {
    itemPropertyDescriptors = null;
    super.getPropertyDescriptors(object);
    
    XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)object;
    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
    if (xsdAttributeDeclaration != null) {
      for (IItemPropertyDescriptor delegatedItemPropertyDescriptor : itemDelegator.getPropertyDescriptors(xsdAttributeDeclaration))
      {
        Object feature = delegatedItemPropertyDescriptor.getFeature(object);
        if ((feature != XSDPackage.eINSTANCE.getXSDFeature_Constraint()) && 
          (feature != XSDPackage.eINSTANCE.getXSDFeature_Value()) && 
          (feature != XSDPackage.eINSTANCE.getXSDFeature_LexicalValue())) {
          itemPropertyDescriptors.add(new ItemPropertyDescriptorDecorator(xsdAttributeDeclaration, delegatedItemPropertyDescriptor));
        }
      }
    }
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Required_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_Required_description"), 
      xsdPackage.getXSDAttributeUse_Required(), 
      true, 
      ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE));
    
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Use_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_Use_description"), 
      xsdPackage.getXSDAttributeUse_Use(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE));
    
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_LexicalValue_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_LexicalValueOfAttributeUse_description"), 
      xsdPackage.getXSDAttributeUse_LexicalValue(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE));
    
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_Constraint_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_ConstraintOfAttributeUse_description"), 
      xsdPackage.getXSDAttributeUse_Constraint(), 
      true, 
      ItemPropertyDescriptor.TEXT_VALUE_IMAGE));
    
    itemPropertyDescriptors.add(
      new ItemPropertyDescriptor(
      ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 
      XSDEditPlugin.INSTANCE.getString("_UI_AttributeDeclaration_label"), 
      XSDEditPlugin.INSTANCE.getString("_UI_AttributeDeclaration_description"), 
      xsdPackage.getXSDAttributeUse_AttributeDeclaration(), 
      false));
    
    return itemPropertyDescriptors;
  }
  
  public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object)
  {
    if (childrenFeatures == null)
    {
      super.getChildrenFeatures(object);
      childrenFeatures.clear();
    }
    return childrenFeatures;
  }
  
  public Collection<?> getChildren(Object object)
  {
    XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)object;
    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
    if (xsdAttributeDeclaration != null) {
      return itemDelegator.getChildren(xsdAttributeDeclaration);
    }
    return Collections.EMPTY_LIST;
  }
  
  public boolean hasChildren(Object object)
  {
    XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)object;
    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
    
    return (xsdAttributeDeclaration != null) && (itemDelegator.hasChildren(xsdAttributeDeclaration));
  }
  
  public Object getImage(Object object)
  {
    XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)object;
    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
    if (xsdAttributeDeclaration != null)
    {
      Collection<Object> images = new ArrayList();
      images.add(itemDelegator.getImage(xsdAttributeDeclaration));
      if (XSDAttributeUseCategory.REQUIRED_LITERAL != xsdAttributeUse.getUse())
      {
        String imageName = 
          "full/obj16/XSDOccurrence" + (
          
          XSDAttributeUseCategory.REQUIRED_LITERAL == xsdAttributeUse.getUse() ? 
          "One" : XSDAttributeUseCategory.PROHIBITED_LITERAL == xsdAttributeUse.getUse() ? "Zero" : 
          "ZeroToOne");
        images.add(XSDEditPlugin.INSTANCE.getImage(imageName));
      }
      return new ComposedImage(images);
    }
    return XSDEditPlugin.INSTANCE.getImage("full/obj16/XSDAttributeUse");
  }
  
  public String getText(Object object)
  {
    return getText(object, true);
  }
  
  public String getText(Object object, boolean showType)
  {
    XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)object;
    XSDAttributeDeclaration xsdAttributeDeclaration = getDelegate(xsdAttributeUse);
    StringBuffer result = new StringBuffer();
    if (xsdAttributeDeclaration != null) {
      result.append(itemDelegator.getText(xsdAttributeDeclaration));
    }
    if (xsdAttributeUse.isSetConstraint())
    {
      if (result.length() != 0) {
        result.append("  ");
      }
      result.append('<');
      result.append(xsdAttributeUse.getConstraint());
      result.append("=\"");
      result.append(xsdAttributeUse.getLexicalValue());
      result.append("\">");
    }
    return result.toString();
  }
  
  public void notifyChanged(Notification msg)
  {
    if ((msg.getFeature() == xsdPackage.getXSDAttributeUse_Required()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeUse_LexicalValue()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeUse_Constraint()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeUse_AttributeDeclaration()) || 
      (msg.getFeature() == xsdPackage.getXSDAttributeUse_Use()))
    {
      fireN
1 2 3 4 5 6 7 8 9

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd