geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r356274 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src: ./ org/ org/apache/ org/apache/geronimo/ org/apache/geronimo/xml/ org/apache/geronimo/xml/ns/ org/apache/geronimo/xml/ns/nam...
Date Mon, 12 Dec 2005 16:24:56 GMT
Author: sppatel
Date: Mon Dec 12 08:24:52 2005
New Revision: 356274

URL: http://svn.apache.org/viewcvs?rev=356274&view=rev
Log:
emf.edit changes

Added:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/NamingItemProviderAdapterFactory.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceRefTypeItemProvider.java

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/NamingItemProviderAdapterFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/NamingItemProviderAdapterFactory.java?rev=356274&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/NamingItemProviderAdapterFactory.java
(added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/NamingItemProviderAdapterFactory.java
Mon Dec 12 08:24:52 2005
@@ -0,0 +1,558 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.xml.ns.naming.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.geronimo.xml.ns.naming.util.NamingAdapterFactory;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to
{@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class NamingItemProviderAdapterFactory extends NamingAdapterFactory implements ComposeableAdapterFactory,
IChangeNotifier, IDisposable
+{
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String copyright = "";
+
+  /**
+   * This keeps track of the root adapter factory that delegates to this adapter factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected ComposedAdapterFactory parentAdapterFactory;
+
+  /**
+   * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+  /**
+   * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected Collection supportedTypes = new ArrayList();
+
+  /**
+   * This constructs an instance.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated NOT
+   */
+  public NamingItemProviderAdapterFactory()
+  {
+    supportedTypes.add(IEditingDomainItemProvider.class);
+    supportedTypes.add(IStructuredItemContentProvider.class);
+    supportedTypes.add(ITreeItemContentProvider.class);
+    supportedTypes.add(IItemLabelProvider.class);
+    supportedTypes.add(IItemPropertySource.class);		
+    supportedTypes.add(ITableItemLabelProvider.class);
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.CssType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected CssTypeItemProvider cssTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.CssType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createCssTypeAdapter()
+  {
+    if (cssTypeItemProvider == null)
+    {
+      cssTypeItemProvider = new CssTypeItemProvider(this);
+    }
+
+    return cssTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.DocumentRoot}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected DocumentRootItemProvider documentRootItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.DocumentRoot}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createDocumentRootAdapter()
+  {
+    if (documentRootItemProvider == null)
+    {
+      documentRootItemProvider = new DocumentRootItemProvider(this);
+    }
+
+    return documentRootItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.EjbLocalRefType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected EjbLocalRefTypeItemProvider ejbLocalRefTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.EjbLocalRefType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createEjbLocalRefTypeAdapter()
+  {
+    if (ejbLocalRefTypeItemProvider == null)
+    {
+      ejbLocalRefTypeItemProvider = new EjbLocalRefTypeItemProvider(this);
+    }
+
+    return ejbLocalRefTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.EjbRefType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected EjbRefTypeItemProvider ejbRefTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.EjbRefType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createEjbRefTypeAdapter()
+  {
+    if (ejbRefTypeItemProvider == null)
+    {
+      ejbRefTypeItemProvider = new EjbRefTypeItemProvider(this);
+    }
+
+    return ejbRefTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.GbeanLocatorType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected GbeanLocatorTypeItemProvider gbeanLocatorTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.GbeanLocatorType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createGbeanLocatorTypeAdapter()
+  {
+    if (gbeanLocatorTypeItemProvider == null)
+    {
+      gbeanLocatorTypeItemProvider = new GbeanLocatorTypeItemProvider(this);
+    }
+
+    return gbeanLocatorTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.GbeanRefType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected GbeanRefTypeItemProvider gbeanRefTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.GbeanRefType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createGbeanRefTypeAdapter()
+  {
+    if (gbeanRefTypeItemProvider == null)
+    {
+      gbeanRefTypeItemProvider = new GbeanRefTypeItemProvider(this);
+    }
+
+    return gbeanRefTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.MessageDestinationType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected MessageDestinationTypeItemProvider messageDestinationTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.MessageDestinationType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createMessageDestinationTypeAdapter()
+  {
+    if (messageDestinationTypeItemProvider == null)
+    {
+      messageDestinationTypeItemProvider = new MessageDestinationTypeItemProvider(this);
+    }
+
+    return messageDestinationTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.PortCompletionType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected PortCompletionTypeItemProvider portCompletionTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.PortCompletionType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createPortCompletionTypeAdapter()
+  {
+    if (portCompletionTypeItemProvider == null)
+    {
+      portCompletionTypeItemProvider = new PortCompletionTypeItemProvider(this);
+    }
+
+    return portCompletionTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.PortType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected PortTypeItemProvider portTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.PortType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createPortTypeAdapter()
+  {
+    if (portTypeItemProvider == null)
+    {
+      portTypeItemProvider = new PortTypeItemProvider(this);
+    }
+
+    return portTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.ResourceEnvRefType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected ResourceEnvRefTypeItemProvider resourceEnvRefTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.ResourceEnvRefType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createResourceEnvRefTypeAdapter()
+  {
+    if (resourceEnvRefTypeItemProvider == null)
+    {
+      resourceEnvRefTypeItemProvider = new ResourceEnvRefTypeItemProvider(this);
+    }
+
+    return resourceEnvRefTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.ResourceLocatorType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected ResourceLocatorTypeItemProvider resourceLocatorTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.ResourceLocatorType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createResourceLocatorTypeAdapter()
+  {
+    if (resourceLocatorTypeItemProvider == null)
+    {
+      resourceLocatorTypeItemProvider = new ResourceLocatorTypeItemProvider(this);
+    }
+
+    return resourceLocatorTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.ResourceRefType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected ResourceRefTypeItemProvider resourceRefTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.ResourceRefType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createResourceRefTypeAdapter()
+  {
+    if (resourceRefTypeItemProvider == null)
+    {
+      resourceRefTypeItemProvider = new ResourceRefTypeItemProvider(this);
+    }
+
+    return resourceRefTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.ServiceCompletionType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected ServiceCompletionTypeItemProvider serviceCompletionTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.ServiceCompletionType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createServiceCompletionTypeAdapter()
+  {
+    if (serviceCompletionTypeItemProvider == null)
+    {
+      serviceCompletionTypeItemProvider = new ServiceCompletionTypeItemProvider(this);
+    }
+
+    return serviceCompletionTypeItemProvider;
+  }
+
+  /**
+   * This keeps track of the one adapter used for all {@link org.apache.geronimo.xml.ns.naming.ServiceRefType}
instances.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected ServiceRefTypeItemProvider serviceRefTypeItemProvider;
+
+  /**
+   * This creates an adapter for a {@link org.apache.geronimo.xml.ns.naming.ServiceRefType}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter createServiceRefTypeAdapter()
+  {
+    if (serviceRefTypeItemProvider == null)
+    {
+      serviceRefTypeItemProvider = new ServiceRefTypeItemProvider(this);
+    }
+
+    return serviceRefTypeItemProvider;
+  }
+
+  /**
+   * This returns the root adapter factory that contains this factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public ComposeableAdapterFactory getRootAdapterFactory()
+  {
+    return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+  }
+
+  /**
+   * This sets the composed adapter factory that contains this factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
+  {
+    this.parentAdapterFactory = parentAdapterFactory;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isFactoryForType(Object type)
+  {
+    return supportedTypes.contains(type) || super.isFactoryForType(type);
+  }
+
+  /**
+   * This implementation substitutes the factory itself as the key for the adapter.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Adapter adapt(Notifier notifier, Object type)
+  {
+    return super.adapt(notifier, this);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object adapt(Object object, Object type)
+  {
+    if (isFactoryForType(type))
+    {
+      Object adapter = super.adapt(object, type);
+      if (!(type instanceof Class) || (((Class)type).isInstance(adapter)))
+      {
+        return adapter;
+      }
+    }
+
+    return null;
+  }
+
+  /**
+   * This adds a listener.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void addListener(INotifyChangedListener notifyChangedListener)
+  {
+    changeNotifier.addListener(notifyChangedListener);
+  }
+
+  /**
+   * This removes a listener.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void removeListener(INotifyChangedListener notifyChangedListener)
+  {
+    changeNotifier.removeListener(notifyChangedListener);
+  }
+
+  /**
+   * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void fireNotifyChanged(Notification notification)
+  {
+    changeNotifier.fireNotifyChanged(notification);
+
+    if (parentAdapterFactory != null)
+    {
+      parentAdapterFactory.fireNotifyChanged(notification);
+    }
+  }
+
+  /**
+   * This disposes all of the item providers created by this factory. 
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void dispose()
+  {
+    if (cssTypeItemProvider != null) cssTypeItemProvider.dispose();
+    if (documentRootItemProvider != null) documentRootItemProvider.dispose();
+    if (ejbLocalRefTypeItemProvider != null) ejbLocalRefTypeItemProvider.dispose();
+    if (ejbRefTypeItemProvider != null) ejbRefTypeItemProvider.dispose();
+    if (gbeanLocatorTypeItemProvider != null) gbeanLocatorTypeItemProvider.dispose();
+    if (gbeanRefTypeItemProvider != null) gbeanRefTypeItemProvider.dispose();
+    if (messageDestinationTypeItemProvider != null) messageDestinationTypeItemProvider.dispose();
+    if (portCompletionTypeItemProvider != null) portCompletionTypeItemProvider.dispose();
+    if (portTypeItemProvider != null) portTypeItemProvider.dispose();
+    if (resourceEnvRefTypeItemProvider != null) resourceEnvRefTypeItemProvider.dispose();
+    if (resourceLocatorTypeItemProvider != null) resourceLocatorTypeItemProvider.dispose();
+    if (resourceRefTypeItemProvider != null) resourceRefTypeItemProvider.dispose();
+    if (serviceCompletionTypeItemProvider != null) serviceCompletionTypeItemProvider.dispose();
+    if (serviceRefTypeItemProvider != null) serviceRefTypeItemProvider.dispose();
+  }
+
+}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceRefTypeItemProvider.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceRefTypeItemProvider.java?rev=356274&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceRefTypeItemProvider.java
(added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceRefTypeItemProvider.java
Mon Dec 12 08:24:52 2005
@@ -0,0 +1,381 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.xml.ns.naming.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.geronimo.deployment.model.edit.GeronimoEMFEditPlugin;
+
+import org.apache.geronimo.xml.ns.naming.NamingFactory;
+import org.apache.geronimo.xml.ns.naming.NamingPackage;
+import org.apache.geronimo.xml.ns.naming.ResourceRefType;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+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.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.apache.geronimo.xml.ns.naming.ResourceRefType} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ * 
+ * @generated
+ */
+public class ResourceRefTypeItemProvider extends ItemProviderAdapter implements
+		IEditingDomainItemProvider, IStructuredItemContentProvider,
+		ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource,
+		ITableItemLabelProvider {
+	/**
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public static final String copyright = "";
+
+	/**
+	 * This constructs an instance from a factory and a notifier. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public ResourceRefTypeItemProvider(AdapterFactory adapterFactory) {
+		super(adapterFactory);
+	}
+
+	/**
+	 * This returns the property descriptors for the adapted class. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public List getPropertyDescriptors(Object object) {
+		if (itemPropertyDescriptors == null) {
+			super.getPropertyDescriptors(object);
+
+			addRefNamePropertyDescriptor(object);
+			addDomainPropertyDescriptor(object);
+			addServerPropertyDescriptor(object);
+			addApplicationPropertyDescriptor(object);
+			addModulePropertyDescriptor(object);
+			addTypePropertyDescriptor(object);
+			addNamePropertyDescriptor(object);
+			addResourceLinkPropertyDescriptor(object);
+			addTargetNamePropertyDescriptor(object);
+			addUrlPropertyDescriptor(object);
+		}
+		return itemPropertyDescriptors;
+	}
+
+	/**
+	 * This adds a property descriptor for the Ref Name feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addRefNamePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_refName_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_refName_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_RefName(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Domain feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addDomainPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_domain_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_domain_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Domain(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Server feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addServerPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_server_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_server_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Server(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Application feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addApplicationPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_application_feature"),
+				getString("_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_application_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Application(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Module feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addModulePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_module_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_module_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Module(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Type feature. <!-- begin-user-doc
+	 * --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addTypePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_type_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_type_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Type(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+	 * --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addNamePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_name_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_name_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Name(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Resource Link feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addResourceLinkPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_resourceLink_feature"),
+				getString("_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_resourceLink_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_ResourceLink(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Target Name feature. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addTargetNamePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_targetName_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_targetName_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_TargetName(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+	 * --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void addUrlPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add(createItemPropertyDescriptor(
+				((ComposeableAdapterFactory) adapterFactory)
+						.getRootAdapterFactory(), getResourceLocator(),
+				getString("_UI_ResourceRefType_url_feature"), getString(
+						"_UI_PropertyDescriptor_description",
+						"_UI_ResourceRefType_url_feature",
+						"_UI_ResourceRefType_type"), NamingPackage.eINSTANCE
+						.getResourceRefType_Url(), true,
+				ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+	}
+
+	/**
+	 * This returns ResourceRefType.gif. <!-- begin-user-doc --> <!--
+	 * end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public Object getImage(Object object) {
+		return getResourceLocator().getImage("full/obj16/ResourceRefType");
+	}
+
+	/**
+	 * This returns the label text for the adapted class. <!-- begin-user-doc
+	 * --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public String getText(Object object) {
+		String label = ((ResourceRefType) object).getName();
+		return label == null || label.length() == 0 ? getString("_UI_ResourceRefType_type")
+				: getString("_UI_ResourceRefType_type") + " " + label;
+	}
+
+	/**
+	 * This handles model notifications by calling {@link #updateChildren} to
+	 * update any cached children and by creating a viewer notification, which
+	 * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+	 * end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public void notifyChanged(Notification notification) {
+		updateChildren(notification);
+
+		switch (notification.getFeatureID(ResourceRefType.class)) {
+		case NamingPackage.RESOURCE_REF_TYPE__REF_NAME:
+		case NamingPackage.RESOURCE_REF_TYPE__DOMAIN:
+		case NamingPackage.RESOURCE_REF_TYPE__SERVER:
+		case NamingPackage.RESOURCE_REF_TYPE__APPLICATION:
+		case NamingPackage.RESOURCE_REF_TYPE__MODULE:
+		case NamingPackage.RESOURCE_REF_TYPE__TYPE:
+		case NamingPackage.RESOURCE_REF_TYPE__NAME:
+		case NamingPackage.RESOURCE_REF_TYPE__RESOURCE_LINK:
+		case NamingPackage.RESOURCE_REF_TYPE__TARGET_NAME:
+		case NamingPackage.RESOURCE_REF_TYPE__URL:
+			fireNotifyChanged(new ViewerNotification(notification, notification
+					.getNotifier(), false, true));
+			return;
+		}
+		super.notifyChanged(notification);
+	}
+
+	/**
+	 * This adds to the collection of
+	 * {@link org.eclipse.emf.edit.command.CommandParameter}s describing all of
+	 * the children that can be created under this object. <!-- begin-user-doc
+	 * --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	protected void collectNewChildDescriptors(Collection newChildDescriptors,
+			Object object) {
+		super.collectNewChildDescriptors(newChildDescriptors, object);
+	}
+
+	/**
+	 * Return the resource locator for this item provider's resources. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public ResourceLocator getResourceLocator() {
+		return GeronimoEMFEditPlugin.INSTANCE;
+	}
+
+	/**
+	 * This does the same thing as ITableLabelProvider.getColumnText.
+	 */
+	public String getColumnText(Object object, int columnIndex) {
+		ResourceRefType o = (ResourceRefType) object;
+		switch(columnIndex) {
+		case 0:
+			return o.getRefName();
+		case 1:
+			if(o.eIsSet(NamingPackage.eINSTANCE.getResourceRefType_ResourceLink())) {
+				return o.getResourceLink();
+			}
+			break;
+		case 2:
+			if(o.eIsSet(NamingPackage.eINSTANCE.getResourceRefType_TargetName())) {
+				return o.getTargetName();
+			}
+			break;
+		}
+		return "";
+	}
+
+	/**
+	 * This does the same thing as ITableLabelProvider.getColumnImage.
+	 */
+	public Object getColumnImage(Object object, int columnIndex) {
+		if (columnIndex == 0) {
+			return getResourceLocator().getImage("full/obj16/ResourceRefType");
+		}
+		return null;
+	}
+
+}



Mime
View raw message