Ticket #1001002: Move the Menu to be a Portlet - Drop the menu porlet, add a menu button after the menu search box. A menu tree popup will appear when the menu button is clicked.

This commit is contained in:
Elaine Tan 2012-08-08 19:02:10 +08:00
parent 064c654e85
commit d08fb1ca6b
3 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,20 @@
-- Aug 8, 2012 6:41:15 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET IsActive='N',Updated=TO_DATE('2012-08-08 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=1000006
;
-- Aug 8, 2012 6:41:47 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET IsShowInDashboard='N',Updated=TO_DATE('2012-08-08 18:41:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=50001
;
-- Aug 8, 2012 6:42:03 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET Line=2.000000000000, ColumnNo=0, IsShowInDashboard='N',Updated=TO_DATE('2012-08-08 18:42:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=200000
;
UPDATE AD_System
SET LastMigrationScriptApplied='870_IDEMPIERE-357_MenuPortlet.sql'
WHERE LastMigrationScriptApplied<'870_IDEMPIERE-357_MenuPortlet.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -0,0 +1,20 @@
-- Aug 8, 2012 6:41:15 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET IsActive='N',Updated=TO_TIMESTAMP('2012-08-08 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=1000006
;
-- Aug 8, 2012 6:41:47 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET IsShowInDashboard='N',Updated=TO_TIMESTAMP('2012-08-08 18:41:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=50001
;
-- Aug 8, 2012 6:42:03 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET Line=2.000000000000, ColumnNo=0, IsShowInDashboard='N',Updated=TO_TIMESTAMP('2012-08-08 18:42:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DashboardContent_ID=200000
;
UPDATE AD_System
SET LastMigrationScriptApplied='870_IDEMPIERE-357_MenuPortlet.sql'
WHERE LastMigrationScriptApplied<'870_IDEMPIERE-357_MenuPortlet.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -19,8 +19,12 @@ package org.adempiere.webui.panel;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.AboutWindow; import org.adempiere.webui.window.AboutWindow;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
@ -28,6 +32,7 @@ import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center; import org.zkoss.zul.Center;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image; import org.zkoss.zul.Image;
import org.zkoss.zul.Popup;
import org.zkoss.zul.West; import org.zkoss.zul.West;
/** /**
@ -44,6 +49,8 @@ public class HeaderPanel extends Panel implements EventListener<Event>
private static final long serialVersionUID = -2351317624519209484L; private static final long serialVersionUID = -2351317624519209484L;
private Image image; private Image image;
private ToolBarButton btnMenu;
private Popup popMenu;
public HeaderPanel() public HeaderPanel()
{ {
@ -75,8 +82,23 @@ public class HeaderPanel extends Panel implements EventListener<Event>
hbox.setAlign("left"); hbox.setAlign("left");
image.setParent(hbox); image.setParent(hbox);
new MenuSearchPanel(this).setParent(hbox); new MenuSearchPanel(this).setParent(hbox);
popMenu = new Popup();
popMenu.setId("menuTreePopup");
popMenu.appendChild(new MenuTreePanel(popMenu));
popMenu.setWidth("600px");
popMenu.setHeight("500px");
popMenu.setParent(hbox);
btnMenu = new ToolBarButton();
btnMenu.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(),"Menu")));
LayoutUtils.addSclass("desktop-header-font", btnMenu);
btnMenu.setParent(hbox);
btnMenu.setPopup("menuTreePopup");
btnMenu.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("desktop-header-left", west); LayoutUtils.addSclass("desktop-header-left", west);
//the following doesn't work when declare as part of the header-left style //the following doesn't work when declare as part of the header-left style
west.setStyle("background-color: transparent; border: none;"); west.setStyle("background-color: transparent; border: none;");
@ -102,7 +124,10 @@ public class HeaderPanel extends Panel implements EventListener<Event>
w.setPage(this.getPage()); w.setPage(this.getPage());
w.doHighlighted(); w.doHighlighted();
} }
else if(event.getTarget() == btnMenu)
{
popMenu.open(btnMenu, "end_before");
}
} }
} }
} }