Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
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
 
 package org.eclipse.emf.java.provider;
 
 
 import java.util.List;
 
 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.ViewerNotification;
This is the item provider adapter for a org.eclipse.emf.java.JParameter object.

Generated:
 
 public class JParameterItemProvider
   extends JModelElementItemProvider
   implements 
     IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
 {
  
This constructs an instance from a factory and a notifier.

Generated:
 
   public JParameterItemProvider(AdapterFactory adapterFactory)
   {
     super(adapterFactory);
   }

  
This returns the property descriptors for the adapted class.

Generated:
 
   @Override
   public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
   {
     if (itemPropertyDescriptors == null)
     {
       super.getPropertyDescriptors(object);
 
       addFinalPropertyDescriptor(object);
       addMethodPropertyDescriptor(object);
       addTypePropertyDescriptor(object);
     }
     return itemPropertyDescriptors;
   }

  
This adds a property descriptor for the Final feature.

Generated:
 
   protected void addFinalPropertyDescriptor(Object object)
   {
     itemPropertyDescriptors.add
       (createItemPropertyDescriptor
         (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
          getResourceLocator(),
          getString("_UI_JParameter_final_feature"),
          getString("_UI_PropertyDescriptor_description""_UI_JParameter_final_feature""_UI_JParameter_type"),
          true,
          false,
          false,
          ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
          null,
          null));
   }

  
This adds a property descriptor for the Method feature.

Generated:
  protected void addMethodPropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add
      (createItemPropertyDescriptor
        (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
         getResourceLocator(),
         getString("_UI_JParameter_method_feature"),
         getString("_UI_PropertyDescriptor_description""_UI_JParameter_method_feature""_UI_JParameter_type"),
         true,
         false,
         false,
         null,
         null,
         null));
  }

  
This adds a property descriptor for the Type feature.

Generated:
  protected void addTypePropertyDescriptor(Object object)
  {
    itemPropertyDescriptors.add
      (createItemPropertyDescriptor
        (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
         getResourceLocator(),
         getString("_UI_JParameter_type_feature"),
         getString("_UI_PropertyDescriptor_description""_UI_JParameter_type_feature""_UI_JParameter_type"),
         true,
         false,
         false,
         null,
         null,
         null));
  }

  
This returns JParameter.gif.

Generated:
  public Object getImage(Object object)
  {
    return overlayImage(objectgetResourceLocator().getImage("full/obj16/JParameter"));
  }

  
This returns the label text for the adapted class.

Generated:
EATM
  public String getText(Object object)
  {
    JParameter jParameter = (JParameter)object;
    return 
      (jParameter.getName() == null ? "" : jParameter.getName() + " : ") + 
        (jParameter.getType() == null ? "" : jParameter.getType().getName());
  }

  
This handles model notifications by calling updateChildren to update any cached children and by creating a viewer notification, which it passes to fireNotifyChanged.

Generated:
  public void notifyChanged(Notification notification)
  {
    updateChildren(notification);
    switch (notification.getFeatureID(JParameter.class))
    {
      case .:
        fireNotifyChanged(new ViewerNotification(notificationnotification.getNotifier(), falsetrue));
        return;
    }
    super.notifyChanged(notification);
  }
New to GrepCode? Check out our FAQ X