01: /*
02: * Created on 5 mai 2005
03: *
04: */
05: package org.openwfe.gpe.model;
06:
07: import org.eclipse.ui.views.properties.IPropertyDescriptor;
08: import org.eclipse.ui.views.properties.TextPropertyDescriptor;
09:
10: /**
11: * @author Christelle
12: *
13: * TODO To change the template for this generated type comment go to
14: * Window - Preferences - Java - Code Style - Code Templates
15: */
16: public class DefinedComposite extends Composite {
17:
18: public static String name = "Process-Definition";
19: private String privateName = "";
20:
21: protected static IPropertyDescriptor[] descriptors;
22:
23: public static final String PRIVATENAME = "privateName"; //$NON-NLS-1$
24: static {
25: descriptors = new IPropertyDescriptor[] { new TextPropertyDescriptor(
26: PRIVATENAME, "name"), };
27: }
28:
29: public String getName() {
30: if (!(privateName.equalsIgnoreCase("")))
31: return name + ": " + privateName;
32: return name;
33: }
34:
35: public void setName(String s) {
36: name = s;
37: }
38:
39: /**
40: * @return Returns the privateName.
41: */
42: public String getPrivateName() {
43: return privateName;
44: }
45:
46: /**
47: * @param privateName The privateName to set.
48: */
49: public void setPrivateName(String privateName) {
50: this .privateName = privateName;
51: }
52:
53: public IPropertyDescriptor[] getPropertyDescriptors() {
54: return descriptors;
55: }
56:
57: public Object getPropertyValue(Object propName) {
58: if (PRIVATENAME.equals(propName))
59: return getPrivateName();
60: return super .getPropertyValue(propName);
61: }
62:
63: public void setPropertyValue(Object id, Object value) {
64: if (id == PRIVATENAME)
65: setPrivateName((String) value);
66: }
67: }
|