KickJava   Java API By Example, From Geeks To Geeks.

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


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: IItemPropertyDescriptor.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  * This interface extends IPropertyDescriptor so that the methods of {@link IItemPropertySource} can be delegated to the descriptor.
25  * This allows the implementing class to completely encapsulate the work associated with supporting a particular property sheet property.
26  */

27 public interface IItemPropertyDescriptor
28 {
29   /**
30    * This fetches this descriptor's property from the object.
31    * Sometimes it's necessary to update the contents of the cell editor during this call,
32    * i.e., the call is used as a notification that this descriptor is being used to edit another object.
33    */

34   public Object JavaDoc getPropertyValue(Object JavaDoc object);
35
36   /**
37    * This determines whether this descriptor's property for the object is set.
38    * I'm not sure right now what this is used for? I should find out.
39    */

40   public boolean isPropertySet(Object JavaDoc object);
41
42   /**
43    * This determines whether this descriptor's property for the object supports set (and reset).
44    */

45   public boolean canSetProperty(Object JavaDoc object);
46
47   /**
48    * This resets this descriptor's property for the object.
49    */

50   public void resetPropertyValue(Object JavaDoc object);
51
52   /**
53    * This sets this descriptor's property for the object to the given value.
54    */

55   public void setPropertyValue(Object JavaDoc object, Object JavaDoc value);
56
57   /**
58    * Returns the name of the category to which this property belongs.
59    */

60   String JavaDoc getCategory(Object JavaDoc object);
61
62   /**
63    * Returns a brief description of this property.
64    */

65   String JavaDoc getDescription(Object JavaDoc object);
66
67   /**
68    * Returns the display name for this property.
69    */

70   String JavaDoc getDisplayName(Object JavaDoc object);
71
72   /**
73    * Returns a list of filter types to which this property belongs.
74    */

75   String JavaDoc[] getFilterFlags(Object JavaDoc object);
76
77   /*
78    * Returns the help context ids for this property.
79    */

80   Object JavaDoc getHelpContextIds(Object JavaDoc object);
81
82   /**
83    * Returns the id for this property.
84    */

85   String JavaDoc getId(Object JavaDoc object);
86
87   /**
88    * Returns the label provider for this property.
89    */

90   IItemLabelProvider getLabelProvider(Object JavaDoc object);
91
92   /**
93    * Returns whether this property descriptor and the given one are compatible.
94    */

95   boolean isCompatibleWith(Object JavaDoc object, Object JavaDoc anotherObject, IItemPropertyDescriptor anotherPropertyDescriptor);
96
97   /**
98    * Returns the feature.
99    */

100   public Object JavaDoc getFeature(Object JavaDoc object);
101
102   /**
103    * Returns whether this property represents multiple values. This may not be the same as the feature's getMany(), as
104    * the property may allows editing only a single value of a multi-vlaued feature.
105    */

106   public boolean isMany(Object JavaDoc object);
107
108   public Collection JavaDoc getChoiceOfValues(Object JavaDoc object);
109
110   /**
111    * This interface may be implemented by item property descriptors to allow an object to be provided as an override for
112    * whatever would usually be the owner of any commands created to set the property's value. This is typically used
113    * when a wrapper is being displayed in place of a real model object, so that commands will be created by the wrapper.
114    */

115   public interface OverrideableCommandOwner
116   {
117     /**
118      * Sets the object to use as the owner of commands created to set the property's value.
119      */

120     public void setCommandOwner(Object JavaDoc override);
121
122     /**
123      * Returns the override command owner set via {@link setCommandOwner setCommandOwner}.
124      */

125     public Object JavaDoc getCommandOwner();
126   }
127 }
128
Popular Tags