- merge isHeading and isFieldOnly support.
This commit is contained in:
Heng Sin Low 2009-11-10 04:13:44 +00:00
parent d85ab868e5
commit b9b1017d9c
1 changed files with 34 additions and 13 deletions

View File

@ -426,14 +426,21 @@ DataStatusListener, IADTabpanel, VetoableChangeListener
editor.setGridTab(this.getGridTab()); editor.setGridTab(this.getGridTab());
field.addPropertyChangeListener(editor); field.addPropertyChangeListener(editor);
editors.add(editor); editors.add(editor);
editorIds.add(editor.getComponent().getUuid()); editorIds.add(editor.getComponent().getUuid());
Div div = new Div(); if (field.isFieldOnly())
div.setAlign("right"); {
Label label = editor.getLabel(); row.appendChild(createSpacer());
div.appendChild(label); }
if (label.getDecorator() != null) else
div.appendChild(label.getDecorator()); {
row.appendChild(div); Div div = new Div();
div.setAlign("right");
Label label = editor.getLabel();
div.appendChild(label);
if (label.getDecorator() != null)
div.appendChild(label.getDecorator());
row.appendChild(div);
}
row.appendChild(editor.getComponent()); row.appendChild(editor.getComponent());
if (field.isLongField()) { if (field.isLongField()) {
row.setSpans("1,3,1"); row.setSpans("1,3,1");
@ -463,15 +470,29 @@ DataStatusListener, IADTabpanel, VetoableChangeListener
{ {
popupMenu.addMenuListener((ContextMenuListener)editor); popupMenu.addMenuListener((ContextMenuListener)editor);
this.appendChild(popupMenu); this.appendChild(popupMenu);
if (popupMenu.isZoomEnabled() && editor instanceof IZoomableEditor) if (!field.isFieldOnly())
{ {
label.setStyle("cursor: pointer; text-decoration: underline;"); Label label = editor.getLabel();
label.addEventListener(Events.ON_CLICK, new ZoomListener((IZoomableEditor) editor)); if (popupMenu.isZoomEnabled() && editor instanceof IZoomableEditor)
{
label.setStyle("cursor: pointer; text-decoration: underline;");
label.addEventListener(Events.ON_CLICK, new ZoomListener((IZoomableEditor) editor));
}
label.setContext(popupMenu.getId());
} }
label.setContext(popupMenu.getId());
} }
} }
else if (field.isHeading())
{
//display just a label if we are "heading only"
Label label = new Label(field.getHeader());
Div div = new Div();
div.setAlign("center");
row.appendChild(createSpacer());
div.appendChild(label);
row.appendChild(div);
}
} }
} }