From 453696f06c02e4a4ada9ee01a2803c992052d9e1 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Sat, 4 Oct 2008 00:08:49 +0000 Subject: [PATCH] * sync with branches/adempiere341 revision 6584 --- .../WEB-INF/src/org/adempiere/webui/IDesktop.java | 6 ++++++ .../src/org/adempiere/webui/apps/wf/WFPanel.java | 2 ++ .../webui/component/ADTreeOnDropListener.java | 12 +++++++----- .../src/org/adempiere/webui/component/Datebox.java | 1 + .../src/org/adempiere/webui/component/NumberBox.java | 11 ++++++++++- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/IDesktop.java b/zkwebui/WEB-INF/src/org/adempiere/webui/IDesktop.java index 72b690137b..7782ab1869 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/IDesktop.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/IDesktop.java @@ -109,4 +109,10 @@ public interface IDesktop { * @param task_ID */ public void openTask(int task_ID); + + /** + * + * @param workflow_ID + */ + public void openWorkflow(int workflow_ID); } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java index bf6da96831..03fac59146 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java @@ -238,6 +238,8 @@ public class WFPanel extends Panel implements EventListener SessionManager.getAppDesktop().openProcessDialog(wfn.getAD_Process_ID(), false); } else if (wfn.getAD_Task_ID() > 0) { SessionManager.getAppDesktop().openTask(wfn.getAD_Task_ID()); + } else if (wfn.getAD_Workflow_ID() > 0) { + SessionManager.getAppDesktop().openWorkflow(wfn.getAD_Workflow_ID()); } else { throw new ApplicationException("Action not yet implemented: " + wfn.getAction()); } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java index 272f094fee..27cc96cba0 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java @@ -124,7 +124,13 @@ public class ADTreeOnDropListener implements EventListener { private void moveNode(SimpleTreeNode movingNode, SimpleTreeNode toNode, boolean moveInto) { SimpleTreeNode newParent; - int index; + int index; + + // remove + SimpleTreeNode oldParent = treeModel.getParent(movingNode); + treeModel.removeNode(movingNode); + + //get new index if (!moveInto) { newParent = treeModel.getParent(toNode); @@ -136,10 +142,6 @@ public class ADTreeOnDropListener implements EventListener { index = 0; // the first node } - // remove - SimpleTreeNode oldParent = treeModel.getParent(movingNode); - treeModel.removeNode(movingNode); - // insert treeModel.addNode(newParent, movingNode, index); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/Datebox.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/Datebox.java index 5765bd3e3c..9ada25a158 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/Datebox.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/Datebox.java @@ -30,6 +30,7 @@ public class Datebox extends org.zkoss.zul.Datebox public void setEnabled(boolean enabled) { this.setReadonly(!enabled); + this.setButtonVisible(enabled); } public boolean isEnabled() diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index 7918cf64e4..9b9ef1e290 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -50,6 +50,8 @@ public class NumberBox extends Div private Decimalbox decimalBox = null; private Button btn; + + private Popup popup; /** * @@ -72,7 +74,7 @@ public class NumberBox extends Div btn = new Button(); btn.setImage("/images/Calculator16.png"); - Popup popup = getCalculatorPopup(); + popup = getCalculatorPopup(); btn.setSclass("editor-button"); btn.setPopup(popup); btn.setStyle("text-align: center;"); @@ -346,6 +348,13 @@ public class NumberBox extends Div { decimalBox.setReadonly(!enabled); btn.setEnabled(enabled); + if (enabled) + btn.setPopup(popup); + else + { + Popup p = null; + btn.setPopup(p); + } } /**