Search in sources :

Example 6 with ListHead

use of org.adempiere.webui.component.ListHead in project adempiere by adempiere.

the class FindWindow method initAdvanced.

/**
     * initialise Advanced Tab
     * @throws IOException 
     *
    **/
private void initAdvanced() throws IOException {
    ToolBarButton btnNew = new ToolBarButton();
    btnNew.setImage("/images/New24.png");
    btnNew.setAttribute("name", "btnNewAdv");
    btnNew.addEventListener(Events.ON_CLICK, this);
    ToolBarButton btnDelete = new ToolBarButton();
    btnDelete.setAttribute("name", "btnDeleteAdv");
    btnDelete.setImage("/images/Delete24.png");
    btnDelete.addEventListener(Events.ON_CLICK, this);
    ToolBarButton btnSave = new ToolBarButton();
    btnSave.setAttribute("name", "btnSaveAdv");
    btnSave.setImage("/images/Save24.png");
    btnSave.addEventListener(Events.ON_CLICK, this);
    fQueryName = new Combobox();
    fQueryName.setTooltiptext(m_sToolTipText);
    fQueryName.setReadonly(false);
    fQueryName.addEventListener(Events.ON_FOCUS, this);
    fQueryName.addEventListener(Events.ON_BLUR, this);
    fQueryName.addEventListener(Events.ON_SELECT, this);
    //	Get from Action
    WAppsAction action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
    Button btnOk = action.getButton();
    btnOk.setName("btnOkAdv");
    btnOk.addEventListener(Events.ON_CLICK, this);
    //	
    action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
    Button btnCancel = action.getButton();
    btnCancel.setName("btnCancel");
    btnCancel.addEventListener(Events.ON_CLICK, this);
    Panel pnlButtonRight = new Panel();
    //	Change to Standard button order
    pnlButtonRight.appendChild(btnCancel);
    pnlButtonRight.appendChild(btnOk);
    pnlButtonRight.setAlign("right");
    ToolBar toolBar = new ToolBar();
    toolBar.appendChild(btnNew);
    toolBar.appendChild(btnDelete);
    toolBar.appendChild(fQueryName);
    toolBar.appendChild(btnSave);
    toolBar.setWidth("100%");
    fQueryName.setStyle("margin-left: 3px; margin-right: 3px; position: relative; top: 5px;");
    btnSave.setDisabled(m_AD_Tab_ID <= 0);
    Hbox confirmPanel = new Hbox();
    confirmPanel.appendChild(pnlButtonRight);
    confirmPanel.setWidth("100%");
    advancedPanel = new Listbox();
    ListHead listhead = new ListHead();
    listhead.setSizable(true);
    ListHeader lstHAndOr = new ListHeader();
    lstHAndOr.setLabel(Msg.getMsg(Env.getCtx(), "And/Or"));
    lstHAndOr.setWidth("40px");
    ListHeader lstHLeftBracket = new ListHeader();
    lstHLeftBracket.setLabel("(");
    lstHLeftBracket.setWidth("20px");
    ListHeader lstHColumn = new ListHeader();
    lstHColumn.setLabel(Msg.translate(Env.getCtx(), "AD_Column_ID"));
    lstHColumn.setWidth("100px");
    ListHeader lstHOperator = new ListHeader();
    lstHOperator.setLabel(Msg.getMsg(Env.getCtx(), "Operator"));
    ListHeader lstHQueryValue = new ListHeader();
    lstHQueryValue.setLabel(Msg.getMsg(Env.getCtx(), "QueryValue"));
    lstHQueryValue.setWidth("170px");
    ListHeader lstHQueryTo = new ListHeader();
    lstHQueryTo.setLabel(Msg.getMsg(Env.getCtx(), "QueryValue2"));
    lstHQueryTo.setWidth("170px");
    ListHeader lstHRightBracket = new ListHeader();
    lstHRightBracket.setLabel(")");
    lstHRightBracket.setWidth("20px");
    listhead.appendChild(lstHAndOr);
    listhead.appendChild(lstHLeftBracket);
    listhead.appendChild(lstHColumn);
    listhead.appendChild(lstHOperator);
    listhead.appendChild(lstHQueryValue);
    listhead.appendChild(lstHQueryTo);
    listhead.appendChild(lstHRightBracket);
    advancedPanel.appendChild(listhead);
    advancedPanel.setVflex(true);
    Borderlayout layout = new Borderlayout();
    layout.setStyle("height: 100%; width: 99%; position: relative;");
    winAdvanced.appendChild(layout);
    North north = new North();
    layout.appendChild(north);
    north.appendChild(toolBar);
    Center center = new Center();
    layout.appendChild(center);
    center.appendChild(advancedPanel);
    center.setFlex(true);
    South south = new South();
    layout.appendChild(south);
    south.appendChild(confirmPanel);
    winAdvanced.setHeight("100%");
    winAdvanced.setWidth("100%");
    winAdvanced.addEventListener(Events.ON_OK, this);
}
Also used : Hbox(org.zkoss.zul.Hbox) Center(org.zkoss.zkex.zul.Center) ToolBarButton(org.adempiere.webui.component.ToolBarButton) Combobox(org.adempiere.webui.component.Combobox) South(org.zkoss.zkex.zul.South) Borderlayout(org.zkoss.zkex.zul.Borderlayout) WAppsAction(org.adempiere.webui.component.WAppsAction) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Button(org.adempiere.webui.component.Button) ToolBarButton(org.adempiere.webui.component.ToolBarButton) ListHead(org.adempiere.webui.component.ListHead) ToolBar(org.adempiere.webui.component.ToolBar) ListHeader(org.adempiere.webui.component.ListHeader) North(org.zkoss.zkex.zul.North) Listbox(org.adempiere.webui.component.Listbox)

Example 7 with ListHead

use of org.adempiere.webui.component.ListHead in project adempiere by adempiere.

the class AboutWindow method createTrace.

private Tabpanel createTrace() {
    Tabpanel tabPanel = new Tabpanel();
    Vbox vbox = new Vbox();
    vbox.setParent(tabPanel);
    vbox.setWidth("100%");
    vbox.setHeight("100%");
    Hbox hbox = new Hbox();
    bErrorsOnly = new Checkbox();
    bErrorsOnly.setLabel(Msg.getMsg(Env.getCtx(), "ErrorsOnly"));
    //default only show error
    bErrorsOnly.setChecked(true);
    bErrorsOnly.addEventListener(Events.ON_CHECK, this);
    hbox.appendChild(bErrorsOnly);
    btnDownload = new Button(Msg.getMsg(Env.getCtx(), "SaveFile"));
    btnDownload.addEventListener(Events.ON_CLICK, this);
    hbox.appendChild(btnDownload);
    btnErrorEmail = new Button(Msg.getMsg(Env.getCtx(), "SendEMail"));
    btnErrorEmail.addEventListener(Events.ON_CLICK, this);
    hbox.appendChild(btnErrorEmail);
    vbox.appendChild(hbox);
    Vector<String> columnNames = CLogErrorBuffer.get(true).getColumnNames(Env.getCtx());
    logTable = new Listbox();
    ListHead listHead = new ListHead();
    listHead.setParent(logTable);
    listHead.setSizable(true);
    for (Object obj : columnNames) {
        ListHeader header = new ListHeader(obj.toString());
        header.setWidth("100px");
        listHead.appendChild(header);
    }
    vbox.appendChild(logTable);
    logTable.setWidth("480px");
    logTable.setHeight("310px");
    logTable.setVflex(false);
    updateLogTable();
    return tabPanel;
}
Also used : Hbox(org.zkoss.zul.Hbox) ToolBarButton(org.adempiere.webui.component.ToolBarButton) Button(org.adempiere.webui.component.Button) Checkbox(org.adempiere.webui.component.Checkbox) ListHead(org.adempiere.webui.component.ListHead) ListHeader(org.adempiere.webui.component.ListHeader) Listbox(org.adempiere.webui.component.Listbox) Tabpanel(org.adempiere.webui.component.Tabpanel) Vbox(org.zkoss.zul.Vbox)

Example 8 with ListHead

use of org.adempiere.webui.component.ListHead in project adempiere by adempiere.

the class ADSortTab method init.

/**
	 * 	Static Layout
	 * 	@throws Exception
	 */
private void init() throws Exception {
    this.setStyle("height: 100%; width: 100%;");
    //
    noLabel.setValue("No");
    yesLabel.setValue("Yes");
    //yesList.setHeight("100%");
    //noList.setHeight("100%");
    yesList.setVflex(true);
    noList.setVflex(true);
    EventListener mouseListener = new EventListener() {

        public void onEvent(Event event) throws Exception {
            if (Events.ON_DOUBLE_CLICK.equals(event.getName())) {
                migrateValueAcrossLists(event);
            }
        }
    };
    yesList.addDoubleClickListener(mouseListener);
    noList.addDoubleClickListener(mouseListener);
    //
    EventListener actionListener = new EventListener() {

        public void onEvent(Event event) throws Exception {
            migrateValueAcrossLists(event);
        }
    };
    yesList.setSeltype("multiple");
    noList.setSeltype("multiple");
    bAdd.setImage(ServletFns.resolveThemeURL("~./images/Detail24.png"));
    bAdd.addEventListener(Events.ON_CLICK, actionListener);
    bRemove.setImage(ServletFns.resolveThemeURL("~./images/Parent24.png"));
    bRemove.addEventListener(Events.ON_CLICK, actionListener);
    EventListener crossListMouseListener = new DragListener();
    yesList.addOnDropListener(crossListMouseListener);
    noList.addOnDropListener(crossListMouseListener);
    yesList.setItemDraggable(true);
    noList.setItemDraggable(true);
    actionListener = new EventListener() {

        public void onEvent(Event event) throws Exception {
            migrateValueWithinYesList(event);
        }
    };
    bUp.setImage(ServletFns.resolveThemeURL("~./images/Previous24.png"));
    bUp.addEventListener(Events.ON_CLICK, actionListener);
    bDown.setImage(ServletFns.resolveThemeURL("~./images/Next24.png"));
    bDown.addEventListener(Events.ON_CLICK, actionListener);
    EventListener yesListMouseMotionListener = new EventListener() {

        public void onEvent(Event event) throws Exception {
            if (event instanceof DropEvent) {
                DropEvent me = (DropEvent) event;
                ListItem startItem = (ListItem) me.getDragged();
                ListItem endItem = (ListItem) me.getTarget();
                if (startItem.getListbox() == endItem.getListbox() && startItem.getListbox() == yesList) {
                    int startIndex = yesList.getIndexOfItem(startItem);
                    int endIndex = yesList.getIndexOfItem(endItem);
                    Object endElement = yesModel.getElementAt(endIndex);
                    Object element = yesModel.getElementAt(startIndex);
                    yesModel.removeElement(element);
                    endIndex = yesModel.indexOf(endElement);
                    yesModel.add(endIndex, element);
                    yesList.setSelectedIndex(endIndex);
                    if (yesList.getSelectedItem() != null) {
                        AuFocus focus = new AuFocus(yesList.getSelectedItem());
                        Clients.response(focus);
                    }
                    setIsChanged(true);
                }
            }
        }
    };
    yesList.addOnDropListener(yesListMouseMotionListener);
    ListHead listHead = new ListHead();
    listHead.setParent(yesList);
    ListHeader listHeader = new ListHeader();
    listHeader.appendChild(yesLabel);
    listHeader.setParent(listHead);
    listHead = new ListHead();
    listHead.setParent(noList);
    listHeader = new ListHeader();
    listHeader.appendChild(noLabel);
    listHeader.setParent(listHead);
    Span span = new Span();
    span.setParent(this);
    span.setStyle("height: 99%; display: inline-block; width: 40%;");
    span.appendChild(noList);
    Vbox vbox = new Vbox();
    vbox.appendChild(bAdd);
    vbox.appendChild(bRemove);
    span = new Span();
    span.setParent(this);
    span.setStyle("height: 99%; display: inline-block; width: 46px");
    span.appendChild(vbox);
    span = new Span();
    span.setParent(this);
    span.setStyle("height: 99%; display: inline-block; width: 40%");
    span.appendChild(yesList);
    vbox = new Vbox();
    vbox.appendChild(bUp);
    vbox.appendChild(bDown);
    span = new Span();
    span.setParent(this);
    span.setStyle("height: 99%; display: inline-block; width: 46px");
    span.appendChild(vbox);
}
Also used : DropEvent(org.zkoss.zk.ui.event.DropEvent) Span(org.zkoss.zhtml.Span) SQLException(java.sql.SQLException) AuFocus(org.zkoss.zk.au.out.AuFocus) ListHead(org.adempiere.webui.component.ListHead) ListDataEvent(org.zkoss.zul.event.ListDataEvent) Event(org.zkoss.zk.ui.event.Event) DropEvent(org.zkoss.zk.ui.event.DropEvent) ListHeader(org.adempiere.webui.component.ListHeader) EventListener(org.zkoss.zk.ui.event.EventListener) ListItem(org.adempiere.webui.component.ListItem) Vbox(org.zkoss.zul.Vbox)

Aggregations

ListHead (org.adempiere.webui.component.ListHead)8 ListHeader (org.adempiere.webui.component.ListHeader)5 Test (org.junit.Test)3 Button (org.adempiere.webui.component.Button)2 Listbox (org.adempiere.webui.component.Listbox)2 ToolBarButton (org.adempiere.webui.component.ToolBarButton)2 Hbox (org.zkoss.zul.Hbox)2 Vbox (org.zkoss.zul.Vbox)2 SQLException (java.sql.SQLException)1 Checkbox (org.adempiere.webui.component.Checkbox)1 Combobox (org.adempiere.webui.component.Combobox)1 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)1 ListItem (org.adempiere.webui.component.ListItem)1 Panel (org.adempiere.webui.component.Panel)1 Tabpanel (org.adempiere.webui.component.Tabpanel)1 ToolBar (org.adempiere.webui.component.ToolBar)1 WAppsAction (org.adempiere.webui.component.WAppsAction)1 ApplicationException (org.adempiere.webui.exception.ApplicationException)1 Span (org.zkoss.zhtml.Span)1 AuFocus (org.zkoss.zk.au.out.AuFocus)1