geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r416924 [2/2] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ org.apache.geronimo.st.v11.ui/src/org/apache/geronimo/st/v11/ui/sections/ org.apac...
Date Sat, 24 Jun 2006 14:54:15 GMT
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java?rev=416924&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java
Sat Jun 24 07:54:14 2006
@@ -0,0 +1,240 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.apache.geronimo.xml.ns.naming.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.geronimo.v11.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.ServiceRefType;
+
+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.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.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.ServiceRefType}
object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+public class ServiceRefTypeItemProvider
+  extends ItemProviderAdapter
+  implements	
+    IEditingDomainItemProvider,	
+    IStructuredItemContentProvider,	
+    ITreeItemContentProvider,	
+    IItemLabelProvider,	
+    IItemPropertySource,
+    ITableItemLabelProvider
+{
+  /**
+   * This constructs an instance from a factory and a notifier.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public ServiceRefTypeItemProvider(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);
+
+      addServiceRefNamePropertyDescriptor(object);
+    }
+    return itemPropertyDescriptors;
+  }
+
+  /**
+   * This adds a property descriptor for the Service Ref Name feature.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected void addServiceRefNamePropertyDescriptor(Object object)
+  {
+    itemPropertyDescriptors.add
+      (createItemPropertyDescriptor
+        (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+         getResourceLocator(),
+         getString("_UI_ServiceRefType_serviceRefName_feature"),
+         getString("_UI_PropertyDescriptor_description", "_UI_ServiceRefType_serviceRefName_feature",
"_UI_ServiceRefType_type"),
+         NamingPackage.Literals.SERVICE_REF_TYPE__SERVICE_REF_NAME,
+         true,
+         false,
+         false,
+         ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+         null,
+         null));
+  }
+
+  /**
+   * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate
feature for an
+   * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand}
or
+   * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Collection getChildrenFeatures(Object object)
+  {
+    if (childrenFeatures == null)
+    {
+      super.getChildrenFeatures(object);
+      childrenFeatures.add(NamingPackage.Literals.SERVICE_REF_TYPE__SERVICE_COMPLETION);
+      childrenFeatures.add(NamingPackage.Literals.SERVICE_REF_TYPE__PORT);
+    }
+    return childrenFeatures;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected EStructuralFeature getChildFeature(Object object, Object child)
+  {
+    // Check the type of the specified child object and return the proper feature to use
for
+    // adding (see {@link AddCommand}) it as a child.
+
+    return super.getChildFeature(object, child);
+  }
+
+  /**
+   * This returns ServiceRefType.gif.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Object getImage(Object object)
+  {
+    return overlayImage(object, getResourceLocator().getImage("full/obj16/ServiceRefType"));
+  }
+
+  /**
+   * This returns the label text for the adapted class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public String getText(Object object)
+  {
+    String label = ((ServiceRefType)object).getServiceRefName();
+    return label == null || label.length() == 0 ?
+      getString("_UI_ServiceRefType_type") :
+      getString("_UI_ServiceRefType_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(ServiceRefType.class))
+    {
+      case NamingPackage.SERVICE_REF_TYPE__SERVICE_REF_NAME:
+        fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(),
false, true));
+        return;
+      case NamingPackage.SERVICE_REF_TYPE__SERVICE_COMPLETION:
+      case NamingPackage.SERVICE_REF_TYPE__PORT:
+        fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(),
true, false));
+        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);
+
+    newChildDescriptors.add
+      (createChildParameter
+        (NamingPackage.Literals.SERVICE_REF_TYPE__SERVICE_COMPLETION,
+         NamingFactory.eINSTANCE.createServiceCompletionType()));
+
+    newChildDescriptors.add
+      (createChildParameter
+        (NamingPackage.Literals.SERVICE_REF_TYPE__PORT,
+         NamingFactory.eINSTANCE.createPortType()));
+  }
+
+  /**
+   * Return the resource locator for this item provider's resources.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public ResourceLocator getResourceLocator()
+  {
+    return GeronimoEMFEditPlugin.INSTANCE;
+  }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.emf.edit.provider.ITableItemLabelProvider#getColumnText(java.lang.Object,
int)
+   */
+  public String getColumnText(Object object, int columnIndex) {
+	  ServiceRefType o = (ServiceRefType) object;
+	  switch (columnIndex) {
+	  case 0:
+		  return o.getServiceRefName();
+	  }
+	  return "";
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.emf.edit.provider.ITableItemLabelProvider#getColumnImage(java.lang.Object,
int)
+   */
+  public Object getColumnImage(Object object, int columnIndex) {
+	  if (columnIndex == 0) {
+		  return getImage(object);
+	  }
+	  return null;
+  }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.v11.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ServiceRefTypeItemProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message