IDEMPIERE-2039 Performance tuning: Remove use of echo event for the opening of new window.

This commit is contained in:
Heng Sin Low 2014-07-03 16:37:08 +08:00
parent fab10a699a
commit f42303a6b8
2 changed files with 3 additions and 19 deletions

View File

@ -142,6 +142,7 @@ public class ADWindowContent extends AbstractADWindowContent
LayoutUtils.addSclass("adwindow-status", statusBar);
contentArea = new Div();
contentArea.setRenderdefer(50);
contentArea.setParent(layout);
contentArea.setVflex("1");
contentArea.setHflex("1");

View File

@ -40,7 +40,6 @@ import org.zkoss.image.AImage;
import org.zkoss.util.media.AMedia;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Iframe;
import org.zkoss.zul.Tab;
@ -53,7 +52,6 @@ import org.zkoss.zul.Tabpanels;
*/
public abstract class TabbedDesktop extends AbstractDesktop {
private static final String IN_PROGRESS_IMAGE = "~./zk/img/progress3.gif";
protected WindowContainer windowContainer;
public TabbedDesktop() {
@ -162,17 +160,10 @@ public abstract class TabbedDesktop extends AbstractDesktop {
String id = AdempiereIdGenerator.escapeId(adWindow.getTitle());
tabPanel.setId(id+"_"+adWindow.getADWindowContent().getWindowNo());
final Tab tab = windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
tab.setImage(IN_PROGRESS_IMAGE);
tab.setClosable(false);
final OpenWindowRunnable runnable = new OpenWindowRunnable(adWindow, tab, tabPanel, callback);
tabPanel.addEventListener("onOpenWindow", new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
runnable.run();
}
});
preOpenNewTab();
Events.echoEvent(new Event("onOpenWindow", tabPanel));
runnable.run();
}
/**
@ -254,17 +245,10 @@ public abstract class TabbedDesktop extends AbstractDesktop {
final DesktopTabpanel tabPanel = new DesktopTabpanel();
final Tab tab = windowContainer.insertAfter(windowContainer.getSelectedTab(), tabPanel, wnd.getTitle(), true, true);
tab.setImage(IN_PROGRESS_IMAGE);
tab.setClosable(false);
final OpenWindowRunnable runnable = new OpenWindowRunnable(wnd, tab, tabPanel, null);
tabPanel.addEventListener("onOpenWindow", new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
runnable.run();
}
});
preOpenNewTab();
Events.echoEvent(new Event("onOpenWindow", tabPanel));
runnable.run();
}
/**
@ -395,7 +379,6 @@ public abstract class TabbedDesktop extends AbstractDesktop {
@Override
public void run() {
if (adWindow.createPart(tabPanel) != null ) {
tab.setImage(null);
tab.setClosable(true);
if (adWindow.getMImage() != null) {
try {