From 7f24893ba3f0313e0efb261d8aeb58d6b687bf3d Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 14 May 2009 08:38:37 +0000 Subject: [PATCH] https://sourceforge.net/tracker/?func=detail&aid=2790994&group_id=176962&atid=955896 - Implemented basic theme support, added new ZK_THEME key - Added content for www.testadempiere.com - default css move from default.css.dsp to /theme/default/css/theme.css.dsp - load calc.js and layout.js using lang-addon.xml instead - Implemented gradient background for selected window tab ( the vertical tab ) - Fixed combobox look and feel - Vertical tab will take less space now if the label is short, for e.g the tab for sales order window. --- .../WEB-INF/src/metainfo/zk/lang-addon.xml | 19 +- .../org/adempiere/webui/AdempiereWebUI.java | 2 +- .../src/org/adempiere/webui/WLogin.java | 84 +++++-- .../webui/component/ADButtonTabList.java | 25 +- .../adempiere/webui/panel/ADWindowPanel.java | 18 +- .../adempiere/webui/panel/HeaderPanel.java | 8 +- .../org/adempiere/webui/panel/LoginPanel.java | 131 ++++++---- .../org/adempiere/webui/panel/RolePanel.java | 234 +++++++++++------- .../src/org/adempiere/webui/theme/ITheme.java | 58 +++++ .../adempiere/webui/window/AboutWindow.java | 8 +- .../adempiere/webui/window/LoginWindow.java | 31 ++- .../zkmax/zul/render/Combobox2Default.java | 79 ------ zkwebui/index.zul | 7 +- zkwebui/theme.zs | 2 + .../default/css/theme.css.dsp} | 123 ++++++++- .../theme/default/images/adtab-left-bg.png | Bin 0 -> 306 bytes .../theme/default/images/adtab-right-bg.png | Bin 0 -> 306 bytes zkwebui/theme/default/images/header-bg.png | Bin 0 -> 281 bytes zkwebui/theme/default/images/header-logo.png | Bin 0 -> 1848 bytes zkwebui/theme/default/images/icon.png | Bin 0 -> 1060 bytes zkwebui/theme/default/images/login-box-bg.png | Bin 0 -> 382 bytes .../theme/default/images/login-box-footer.png | Bin 0 -> 1772 bytes .../theme/default/images/login-box-header.png | Bin 0 -> 1488 bytes zkwebui/theme/default/images/login-logo.png | Bin 0 -> 15813 bytes zkwebui/theme/default/login-info.zul | 71 ++++++ zkwebui/theme/default/login-left.zul | 15 ++ zkwebui/theme/default/login-links.zul | 38 +++ zkwebui/theme/default/vendor-logo.zul | 21 ++ zkwebui/theme/default/version-info.zul | 71 ++++++ 29 files changed, 760 insertions(+), 285 deletions(-) create mode 100644 zkwebui/WEB-INF/src/org/adempiere/webui/theme/ITheme.java delete mode 100644 zkwebui/WEB-INF/src/org/zkoss/zkmax/zul/render/Combobox2Default.java create mode 100644 zkwebui/theme.zs rename zkwebui/{css/default.css.dsp => theme/default/css/theme.css.dsp} (59%) create mode 100644 zkwebui/theme/default/images/adtab-left-bg.png create mode 100644 zkwebui/theme/default/images/adtab-right-bg.png create mode 100644 zkwebui/theme/default/images/header-bg.png create mode 100755 zkwebui/theme/default/images/header-logo.png create mode 100755 zkwebui/theme/default/images/icon.png create mode 100644 zkwebui/theme/default/images/login-box-bg.png create mode 100644 zkwebui/theme/default/images/login-box-footer.png create mode 100644 zkwebui/theme/default/images/login-box-header.png create mode 100755 zkwebui/theme/default/images/login-logo.png create mode 100644 zkwebui/theme/default/login-info.zul create mode 100644 zkwebui/theme/default/login-left.zul create mode 100644 zkwebui/theme/default/login-links.zul create mode 100644 zkwebui/theme/default/vendor-logo.zul create mode 100644 zkwebui/theme/default/version-info.zul diff --git a/zkwebui/WEB-INF/src/metainfo/zk/lang-addon.xml b/zkwebui/WEB-INF/src/metainfo/zk/lang-addon.xml index 4c75955e2a..fae963ea49 100644 --- a/zkwebui/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/zkwebui/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -2,9 +2,9 @@ - + ADempiere WebUI - + xul/html - + org.adempiere.webui.AdempiereWebUI - 1.0 - - - + 3.5 + + + + diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index f990f21d89..fef4bb9678 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -64,7 +64,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWebClient public static final String APP_NAME = "Adempiere"; - public static final String UID = "1.0"; + public static final String UID = "3.5"; private WLogin loginDesktop; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/WLogin.java b/zkwebui/WEB-INF/src/org/adempiere/webui/WLogin.java index 07b476197e..b616a127f8 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/WLogin.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/WLogin.java @@ -1,6 +1,6 @@ /****************************************************************************** - * Product: Posterita Ajax UI * - * Copyright (C) 2007 Posterita Ltd. All Rights Reserved. * + * Copyright (C) 2008 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * @@ -10,18 +10,23 @@ * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * Posterita Ltd., 3, Draper Avenue, Quatre Bornes, Mauritius * - * or via info@posterita.org or http://www.posterita.org/ * *****************************************************************************/ package org.adempiere.webui; import org.adempiere.webui.part.AbstractUIPart; +import org.adempiere.webui.theme.ITheme; import org.adempiere.webui.window.LoginWindow; +import org.compiere.model.MSysConfig; import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.metainfo.PageDefinition; import org.zkoss.zkex.zul.Borderlayout; import org.zkoss.zkex.zul.Center; +import org.zkoss.zkex.zul.East; +import org.zkoss.zkex.zul.North; +import org.zkoss.zkex.zul.South; +import org.zkoss.zkex.zul.West; import org.zkoss.zul.Vbox; /** @@ -33,41 +38,84 @@ import org.zkoss.zul.Vbox; */ public class WLogin extends AbstractUIPart { - private IWebClient app; + + private IWebClient app; private Borderlayout layout; - + public WLogin(IWebClient app) { this.app = app; } - + protected Component doCreatePart(Component parent) { + String theme = MSysConfig.getValue(ITheme.ZK_THEME, ITheme.ZK_THEME_DEFAULT); + layout = new Borderlayout(); if (parent != null) layout.setParent(parent); else layout.setPage(page); - Center c = new Center(); - c.setParent(layout); - c.setBorder("none"); - c.setFlex(true); - c.setAutoscroll(true); - + LayoutUtils.addSclass(ITheme.LOGIN_WINDOW_CLASS, layout); + + Center center = new Center(); + center.setParent(layout); + center.setBorder("none"); + center.setFlex(true); + center.setAutoscroll(true); + center.setStyle("border: none; background-color: transparent;"); + Vbox vb = new Vbox(); - vb.setParent(c); + vb.setParent(center); vb.setHeight("100%"); vb.setWidth("100%"); vb.setPack("center"); vb.setAlign("center"); - LayoutUtils.addSclass("login", vb); - + vb.setStyle("background-color: transparent;"); + LoginWindow loginWindow = new LoginWindow(app); loginWindow.setParent(vb); - + + try { + String right = ITheme.THEME_PATH_PREFIX + theme + ITheme.LOGIN_RIGHT_PANEL_ZUL; + PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(right); + East east = new East(); + east.setSclass(ITheme.LOGIN_EAST_PANEL_CLASS); + addContent(east, pageDefintion); + } catch (Exception e) {} + + try { + String left = ITheme.THEME_PATH_PREFIX + theme + ITheme.LOGIN_LEFT_PANEL_ZUL; + PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(left); + West west = new West(); + west.setSclass(ITheme.LOGIN_WEST_PANEL_CLASS); + addContent(west, pageDefintion); + } catch (Exception e){} + + try { + String top = ITheme.THEME_PATH_PREFIX + theme + ITheme.LOGIN_TOP_PANEL_ZUL; + PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(top); + North north = new North(); + north.setSclass(ITheme.LOGIN_NORTH_PANEL_CLASS); + addContent(north, pageDefintion); + } catch (Exception e) {} + + try { + String bottom = ITheme.THEME_PATH_PREFIX + theme + ITheme.LOGIN_BOTTOM_PANEL_ZUL; + PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(bottom); + South south = new South(); + south.setSclass(ITheme.LOGIN_SOUTH_PANEL_CLASS); + addContent(south, pageDefintion); + } catch (Exception e) {} + return layout; } + private void addContent(Component parent, PageDefinition page) { + layout.appendChild(parent); + Executions.createComponents(page, parent, null); + } + public void detach() { layout.detach(); layout = null; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADButtonTabList.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADButtonTabList.java index 81f1bdc66a..3fcc7aa7fb 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADButtonTabList.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADButtonTabList.java @@ -1,5 +1,6 @@ /****************************************************************************** * Copyright (C) 2008 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * @@ -60,12 +61,14 @@ public class ADButtonTabList extends Panel implements IADTabList, EventListener } public synchronized void refresh() { - List childs = getChildren(); + List childs = getChildren(); int childCount = childs.size(); for (int c = childCount - 1; c >=0; c--) { removeChild((Component) childs.get(c)); } Object[] items = listItems.toArray(); + int tabWidth = 100; + List