From 89382502cd458f0a17a12ea9ed82431eb8d57b78 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 3 Dec 2008 02:48:02 +0000 Subject: [PATCH] Implemented pressed state for toolbar button. --- .../webui/component/ToolBarButton.java | 18 ++-- .../webui/panel/AbstractADWindowPanel.java | 25 ++++-- zkwebui/css/default.css.dsp | 85 +------------------ 3 files changed, 32 insertions(+), 96 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java index ddb408f55e..5df587f1b7 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java @@ -25,7 +25,7 @@ public class ToolBarButton extends org.zkoss.zul.Toolbarbutton { private static final long serialVersionUID = 0L; - + private String name; public ToolBarButton() {} @@ -42,14 +42,14 @@ public class ToolBarButton extends org.zkoss.zul.Toolbarbutton } public void setPressed(boolean pressed) { - if (!isDisabled()) { - if (pressed) - setSclass("depressed"); - else { - if (this.getSclass() != null && this.getSclass().indexOf("depressed") >= 0) - this.setSclass(this.getSclass().replace("depressed", "")); - } - } + if (!isDisabled()) { + if (pressed) { + this.setSclass("depressed"); + } else { + if (this.getSclass() != null && this.getSclass().indexOf("depressed") >= 0) + this.setSclass(this.getSclass().replace("depressed", "")); + } + } } public ToolBarButton(String name) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index d1bf445c32..24d57c35ab 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -565,7 +565,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To curTab.getAD_Table_ID(), record_ID, null); curTab.loadAttachments(); // reload - //aAttachment.setPressed(m_curTab.hasAttachment()); + toolbar.getButton("Attachment").setPressed(curTab.hasAttachment()); } /** @@ -729,6 +729,14 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To toolbar.enableTabNavigation(curTabIndex > 0, curTabIndex < (adTab.getTabCount() - 1)); + + toolbar.getButton("Attachment").setPressed(curTab.hasAttachment()); + if (isFirstTab()) + { + toolbar.getButton("HistoryRecords").setPressed(!curTab.isOnlyCurrentRows()); + } + toolbar.getButton("Find").setPressed(curTab.isQueryActive()); + //TODO: personal lock } public void dataStatusChanged(DataStatusEvent e) @@ -1008,6 +1016,14 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To * @see ToolbarListener#onSave() */ public void onSave() + { + onSave(true); + } + + /** + * @param onSaveEvent + */ + private void onSave(boolean onSaveEvent) { if (curTab.isSortTab()) { @@ -1024,7 +1040,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To return; } } - boolean retValue = curTab.dataSave(true); + boolean retValue = curTab.dataSave(onSaveEvent); if (!retValue) { @@ -1224,8 +1240,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To return; } - //TODO: cmd_save(false) -> onSave ? - //onSave(); + onSave(false); // int table_ID = curTab.getAD_Table_ID(); int record_ID = curTab.getRecord_ID(); @@ -1256,7 +1271,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To return; } - //TODO: cmd_save(false); -> onSave ? + onSave(false); // Query MQuery query = new MQuery(curTab.getTableName()); diff --git a/zkwebui/css/default.css.dsp b/zkwebui/css/default.css.dsp index aa07e7e865..38efba3c0c 100644 --- a/zkwebui/css/default.css.dsp +++ b/zkwebui/css/default.css.dsp @@ -30,11 +30,11 @@ html,body { -moz-opacity: 0.2; } -.depressed { +.depressed img { border-style: inset; border-width: 1px; - border-color: #CCCCCC; - background-color: #E4E3DC; + border-color: #9CBDFF; + background-color: #C4DCFB; -moz-border-radius: 5px; padding: 1px 4px 1px 4px; } @@ -76,85 +76,6 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { background-color: white; } -<%-- desktop tabbox --%> -.desktop-tb { - position:absolute; -} - -td.tab-desktop-tb-first1 { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-first2.gif')}); - width: 1px; height: 1px; -} -td.tab-desktop-tb-first2 { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-first2.gif')}); - width: 3px; height: 1px; -} -td.tab-desktop-tb-last1 { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-last1.gif')}); - width: 3px; height: 1px; -} -td.tab-desktop-tb-last2 { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-last1.gif')}); - width: 1px; height: 1px; -} - -td.tab-desktop-tb-tl-sel { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-tl-sel.gif')}); - width: 5px; height: 6px; -} -td.tab-desktop-tb-tl-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-tl-uns.gif')}); - width: 5px; height: 6px; -} -td.tab-desktop-tb-tm-sel { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-tm-sel.gif')}); - height: 6px; -} -td.tab-desktop-tb-tm-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-tm-uns.gif')}); - height: 6px; -} -td.tab-desktop-tb-tr-sel { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-tr-sel.gif')}); - width: 5px; height: 6px; -} -td.tab-desktop-tb-tr-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-tr-uns.gif')}); - width: 5px; height: 6px; -} - -td.tab-desktop-tb-ml-sel { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-ml-sel.gif')}); - width: 5px; -} -td.tab-desktop-tb-ml-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-ml-uns.gif')}); - width: 5px; -} -td.tab-desktop-tb-mm-sel, td.tab-desktop-tb-mm-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-white.gif')}); -} -td.tab-desktop-tb-mr-sel { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-mr-sel.gif')}); - width: 5px; -} -td.tab-desktop-tb-mr-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-mr-uns.gif')}); - width: 5px; -} - -td.tab-desktop-tb-bl-sel, td.tab-desktop-tb-bm-sel, td.tab-desktop-tb-br-sel { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-white.gif')}); - width: 5px; height: 1px; -} -td.tab-desktop-tb-bl-uns, td.tab-desktop-tb-bm-uns, td.tab-desktop-tb-br-uns { - background-image: url(${c:encodeURL('~./zul/img/tab/lite-last1.gif')}); - width: 5px; height: 1px; -} - -tr.tab-desktop-tb-m { - height: 21px; -} .desktop-tabpanel { margin: 0; padding: 0;