01: package net.xoetrope.builder.editor.components.swing;
02:
03: import net.xoetrope.builder.editor.components.PropertyHelper;
04: import net.xoetrope.swing.XLabel;
05: import net.xoetrope.xui.XPage;
06: import net.xoetrope.xui.XProjectManager;
07: import net.xoetrope.xui.XTextRenderer;
08:
09: /**
10: * A helper for the XLabel types
11: * <p> Copyright (c) Xoetrope Ltd., 2002-2003</p>
12: * <p> $Revision: 1.19 $</p>
13: */
14: public class XLabelHelper extends PropertyHelper {
15: protected String extraProperties[] = { "Content", "MouseHandler",
16: "Alignment", "Opaque" };
17:
18: private String alignmentOptions[] = { "Left", "Right", "Center" };
19: private int alignmentOptionIds[] = { XTextRenderer.LEFT,
20: XTextRenderer.RIGHT, XTextRenderer.CENTER };
21:
22: public XLabelHelper() {
23: className = XLabel.class.toString();
24: componentType = XPage.LABEL;
25: extraPropertyNames = extraProperties;
26: setListOptions("Alignment", "Alignment", alignmentOptions,
27: alignmentOptionIds);
28: }
29:
30: /**
31: * Is the property read-only?
32: * @param obj the name of the selected property
33: * @return true if the property is read-only
34: */
35: public boolean isReadOnly(Object obj) {
36: if (obj.toString().compareTo("Opaque") == 0)
37: if (XProjectManager.getCurrentProject()
38: .getResourceManager().getPackageName().compareTo(
39: XPage.XUI_AWT_PACKAGE) == 0)
40: return true;
41:
42: return false;
43: }
44: }
|