KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > edit > provider > ItemPropertyDescriptorDecorator


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-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: ItemPropertyDescriptorDecorator.java,v 1.3 2005/06/08 06:17:05 nickb Exp $
16  */

17 package org.eclipse.emf.edit.provider;
18
19
20 import java.util.Collection JavaDoc;
21
22
23 /**
24  */

25 public class ItemPropertyDescriptorDecorator implements IItemPropertyDescriptor
26 {
27   protected Object JavaDoc object;
28   protected IItemPropertyDescriptor itemPropertyDescriptor;
29
30   /**
31    */

32   public ItemPropertyDescriptorDecorator(Object JavaDoc object, IItemPropertyDescriptor itemPropertyDescriptor)
33   {
34     this.object = object;
35     this.itemPropertyDescriptor = itemPropertyDescriptor;
36   }
37
38   /**
39    * This returns the group of propertiesk into which this one should be placed.
40    */

41   public String JavaDoc getCategory(Object JavaDoc thisObject)
42   {
43     return itemPropertyDescriptor.getCategory(object);
44   }
45
46   /**
47    * This returns the description to be displayed in the property sheet when this property is selected.
48    */

49   public String JavaDoc getDescription(Object JavaDoc thisObject)
50   {
51     return itemPropertyDescriptor.getDescription(object);
52   }
53
54   /**
55    * This returns the name of the property to be displayed in the property sheet.
56    */

57   public String JavaDoc getDisplayName(Object JavaDoc thisObject)
58   {
59     return itemPropertyDescriptor.getDisplayName(object);
60   }
61
62   /**
63    * This returns the flags used as filters in the property sheet.
64    */

65   public String JavaDoc[] getFilterFlags(Object JavaDoc thisObject)
66   {
67     return itemPropertyDescriptor.getFilterFlags(object);
68   }
69
70   /**
71    * This returns the interface name of this property.
72    * This is the key that is passed around and must uniquely identifiy this descriptor.
73    */

74   public String JavaDoc getId(Object JavaDoc thisObject)
75   {
76     return itemPropertyDescriptor.getId(object);
77   }
78
79   public Object JavaDoc getHelpContextIds(Object JavaDoc thisObject)
80   {
81     return itemPropertyDescriptor.getHelpContextIds(object);
82   }
83
84   /**
85    * This does the delegated job of getting the label provider for the given object
86    */

87   public IItemLabelProvider getLabelProvider(Object JavaDoc thisObject)
88   {
89     return itemPropertyDescriptor.getLabelProvider(object);
90   }
91
92   /**
93    * This indicates whether these two property descriptors are equal.
94    * It's not really clear to me how this is meant to be used,
95    * but it's a little bit like an equals test.
96    */

97   public boolean isCompatibleWith(Object JavaDoc object, Object JavaDoc anotherObject, IItemPropertyDescriptor anotherItemPropertyDescriptor)
98   {
99     return itemPropertyDescriptor.isCompatibleWith(object, anotherObject, anotherItemPropertyDescriptor);
100   }
101
102   /**
103    * This does the delegated job of getting the property value from the given object
104    */

105   public Object JavaDoc getPropertyValue(Object JavaDoc thisObject)
106   {
107     return itemPropertyDescriptor.getPropertyValue(object);
108   }
109
110   /**
111    * This does the delegated job of determining whether the property value from the given object is set.
112    */

113   public boolean isPropertySet(Object JavaDoc thisObject)
114   {
115     return itemPropertyDescriptor.isPropertySet(object);
116   }
117
118   /**
119    * This does the delegated job of determining whether the property value from the given object supports set (and reset).
120    */

121   public boolean canSetProperty(Object JavaDoc thisObject)
122   {
123     return itemPropertyDescriptor.canSetProperty(object);
124   }
125
126   /**
127    * This does the delegated job of resetting property value back to it's default value.
128    */

129   public void resetPropertyValue(Object JavaDoc thisObject)
130   {
131     itemPropertyDescriptor.resetPropertyValue(object);
132   }
133
134   /**
135    * This does the delegated job of setting the property to the given value.
136    */

137   public void setPropertyValue(Object JavaDoc thisObject, Object JavaDoc value)
138   {
139     itemPropertyDescriptor.setPropertyValue(object, value);
140   }
141
142   public Object JavaDoc getFeature(Object JavaDoc thisObject)
143   {
144     return itemPropertyDescriptor.getFeature(object);
145
146   }
147
148   public Collection JavaDoc getChoiceOfValues(Object JavaDoc thisObject)
149   {
150     return itemPropertyDescriptor.getChoiceOfValues(object);
151   }
152
153   /**
154    * This does the delegated job of determing whether the property represents multiple values.
155    */

156   public boolean isMany(Object JavaDoc thisObject)
157   {
158     return itemPropertyDescriptor.isMany(thisObject);
159   }
160 }
161
Popular Tags