* layout performance improvement

* minor fix in WEditorPopupMenu
This commit is contained in:
Heng Sin Low 2008-11-22 18:04:16 +00:00
parent 6e8d9480c8
commit c18698e47c
2 changed files with 8 additions and 14 deletions

View File

@ -73,16 +73,19 @@ public class GridPanel extends Borderlayout implements EventListener
private GridTabListItemRenderer renderer; private GridTabListItemRenderer renderer;
private South south;
public GridPanel() public GridPanel()
{ {
super(); this(0);
listbox = new Listbox();
} }
public GridPanel(int windowNo) public GridPanel(int windowNo)
{ {
this.windowNo = windowNo; this.windowNo = windowNo;
listbox = new Listbox(); listbox = new Listbox();
south = new South();
this.appendChild(south);
} }
public void init(GridTab gridTab) public void init(GridTab gridTab)
@ -225,21 +228,11 @@ public class GridPanel extends Borderlayout implements EventListener
paging.setPageSize(pageSize); paging.setPageSize(pageSize);
paging.setTotalSize(tableModel.getRowCount()); paging.setTotalSize(tableModel.getRowCount());
paging.setDetailed(true); paging.setDetailed(true);
South south = new South();
south.appendChild(paging); south.appendChild(paging);
this.appendChild(south);
paging.addEventListener(ZulEvents.ON_PAGING, this); paging.addEventListener(ZulEvents.ON_PAGING, this);
//workaround for layout problem
this.setVisible(false);
Clients.response(new AuEcho(this, "postRender", null));
}
}
public void postRender()
{
this.setVisible(true);
this.getParent().invalidate(); this.getParent().invalidate();
} }
}
private void updateModel() { private void updateModel() {
listModel = new GridTableListModel((GridTable)tableModel, windowNo); listModel = new GridTableListModel((GridTable)tableModel, windowNo);

View File

@ -121,6 +121,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener
public void addMenuListener(ContextMenuListener listener) public void addMenuListener(ContextMenuListener listener)
{ {
if (!menuListeners.contains(listener))
menuListeners.add(listener); menuListeners.add(listener);
} }