IDEMPIERE-1643 Adding a status bar for FindWindow

This commit is contained in:
Murilo Habermann Torquato 2018-07-11 18:21:03 +02:00
parent 6bbd9da275
commit cce8a17248
1 changed files with 27 additions and 2 deletions

View File

@ -71,6 +71,7 @@ import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.factory.ButtonFactory; import org.adempiere.webui.factory.ButtonFactory;
import org.adempiere.webui.panel.StatusBarPanel;
import org.adempiere.webui.part.MultiTabPart; import org.adempiere.webui.part.MultiTabPart;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.util.ZKUpdateUtil;
@ -236,6 +237,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
private static final String ON_POST_VISIBLE_ATTR = "onPostVisible.Event.Posted"; private static final String ON_POST_VISIBLE_ATTR = "onPostVisible.Event.Posted";
/** START DEVCOFFEE **/
private StatusBarPanel statusBar = new StatusBarPanel();
/** END DEVCOFFEE **/
/** /**
* FindPanel Constructor * FindPanel Constructor
* @param targetWindowNo targetWindowNo * @param targetWindowNo targetWindowNo
@ -622,6 +627,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
winMain.addTab(tabPanel, Msg.getMsg(Env.getCtx(), "Advanced").replaceAll("&", ""), false, false); winMain.addTab(tabPanel, Msg.getMsg(Env.getCtx(), "Advanced").replaceAll("&", ""), false, false);
initSimple(); initSimple();
initAdvanced(); initAdvanced();
/** START DEVCOFFEE **/
layout.appendChild(statusBar);
/** START DEVCOFFEE **/
} // initPanel } // initPanel
@ -801,6 +809,11 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
gridFieldList = null; gridFieldList = null;
m_total = getNoOfRecords(null, false); m_total = getNoOfRecords(null, false);
/** START DEVCOFFEE **/
// Get Total
setStatusDB (m_total);
statusBar.setStatusLine("");
/** END DEVCOFFEE **/
} // initFind } // initFind
/** /**
@ -2568,6 +2581,18 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
public boolean isValid() public boolean isValid()
{ {
return isvalid; return isvalid;
} }
/** START DEVCOFFEE **/
/**
* Display current count
* @param currentCount String representation of current/total
*/
private void setStatusDB (int currentCount)
{
StringBuilder text = new StringBuilder(" ").append(currentCount).append(" / ").append(m_total).append(" ");
statusBar.setStatusDB(text.toString());
} // setDtatusDB
/** END DEVCOFFEE **/
} // FindPanel } // FindPanel