KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > sdo > provider > EChangeSummaryItemProvider


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2003-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: EChangeSummaryItemProvider.java,v 1.8 2005/06/08 06:17:15 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.sdo.provider;
18
19
20 import java.util.List JavaDoc;
21
22 import org.eclipse.emf.common.notify.AdapterFactory;
23 import org.eclipse.emf.common.notify.Notification;
24 import org.eclipse.emf.common.util.ResourceLocator;
25 import org.eclipse.emf.ecore.change.provider.ChangeDescriptionItemProvider;
26 import org.eclipse.emf.ecore.sdo.EChangeSummary;
27 import org.eclipse.emf.ecore.sdo.SDOPackage;
28 import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
29 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
30 import org.eclipse.emf.edit.provider.IItemLabelProvider;
31 import org.eclipse.emf.edit.provider.IItemPropertySource;
32 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
33 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
34 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
35
36
37 import org.eclipse.emf.edit.provider.ViewerNotification;
38
39 /**
40  * This is the item provider adapter for a {@link org.eclipse.emf.ecore.sdo.EChangeSummary} object.
41  * <!-- begin-user-doc -->
42  * <!-- end-user-doc -->
43  * @generated
44  */

45 public class EChangeSummaryItemProvider
46   extends ChangeDescriptionItemProvider
47   implements
48     IEditingDomainItemProvider,
49     IStructuredItemContentProvider,
50     ITreeItemContentProvider,
51     IItemLabelProvider,
52     IItemPropertySource
53 {
54   /**
55    * This constructs an instance from a factory and a notifier.
56    * <!-- begin-user-doc -->
57    * <!-- end-user-doc -->
58    * @generated
59    */

60   public EChangeSummaryItemProvider(AdapterFactory adapterFactory)
61   {
62     super(adapterFactory);
63   }
64
65   /**
66    * This returns the property descriptors for the adapted class.
67    * <!-- begin-user-doc -->
68    * <!-- end-user-doc -->
69    * @generated
70    */

71   public List JavaDoc getPropertyDescriptors(Object JavaDoc object)
72   {
73     if (itemPropertyDescriptors == null)
74     {
75       super.getPropertyDescriptors(object);
76
77       addLoggingPropertyDescriptor(object);
78     }
79     return itemPropertyDescriptors;
80   }
81
82   /**
83    * This adds a property descriptor for the Logging feature.
84    * <!-- begin-user-doc -->
85    * <!-- end-user-doc -->
86    * @generated
87    */

88   protected void addLoggingPropertyDescriptor(Object JavaDoc object)
89   {
90     itemPropertyDescriptors.add
91       (createItemPropertyDescriptor
92         (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
93          getResourceLocator(),
94          getString("_UI_ChangeSummary_logging_feature"),
95          getString("_UI_PropertyDescriptor_description", "_UI_ChangeSummary_logging_feature", "_UI_ChangeSummary_type"),
96          SDOPackage.eINSTANCE.getChangeSummary_Logging(),
97          false,
98          ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
99          null,
100          null));
101   }
102
103   /**
104    * This returns the label text for the adapted class.
105    * <!-- begin-user-doc -->
106    * <!-- end-user-doc -->
107    * @generated NOT
108    */

109   public String JavaDoc getText(Object JavaDoc object)
110   {
111     EChangeSummary eChangeSummary = (EChangeSummary)object;
112     // return getString("_UI_EChangeSummary_type") + " " + eChangeSummary.isLogging();
113
// EATM NL
114
return "Changes - logging=" + eChangeSummary.isLogging();
115   }
116
117   /**
118    * This handles model notifications by calling {@link #updateChildren} to update any cached
119    * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
120    * <!-- begin-user-doc -->
121    * <!-- end-user-doc -->
122    * @generated
123    */

124   public void notifyChanged(Notification notification)
125   {
126     updateChildren(notification);
127
128     switch (notification.getFeatureID(EChangeSummary.class))
129     {
130       case SDOPackage.ECHANGE_SUMMARY__LOGGING:
131         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
132         return;
133     }
134     super.notifyChanged(notification);
135   }
136
137   /**
138    * Return the resource locator for this item provider's resources.
139    * <!-- begin-user-doc -->
140    * <!-- end-user-doc -->
141    * @generated
142    */

143   public ResourceLocator getResourceLocator()
144   {
145     return SDOEditPlugin.INSTANCE;
146   }
147
148 }
149
Popular Tags