Search in sources :

Example 1 with ToolBar

use of org.adempiere.webui.component.ToolBar 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 2 with ToolBar

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

the class WPreference method init.

private void init() {
    ThemeUtils.addSclass("ad-wpreference", this);
    Div div = new Div();
    autoCommit = new WYesNoEditor("AutoCommit", Msg.getMsg(Env.getCtx(), "AutoCommit", true), null, false, false, true);
    div.appendChild(autoCommit.getComponent());
    autoCommit.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "AutoCommit", false));
    autoCommit.getComponent().setAttribute("zk_component_ID", "Preference_autoCommit");
    autoCommit.getComponent().setAttribute("zk_component_prefix", "Preference_");
    this.appendChild(div);
    autoNew = new WYesNoEditor("AutoNew", Msg.getMsg(Env.getCtx(), "AutoNew", true), null, false, false, true);
    autoNew.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "AutoNew", false));
    autoNew.getComponent().setAttribute("zk_component_ID", "Preference_autoNew");
    autoNew.getComponent().setAttribute("zk_component_prefix", "Preference_");
    div = new Div();
    div.appendChild(autoNew.getComponent());
    this.appendChild(div);
    tabCollapsible = new WYesNoEditor("WindowTabCollapsible", Msg.getMsg(Env.getCtx(), "WindowTabCollapsible", true), null, false, false, true);
    tabCollapsible.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "WindowTabCollapsible", false));
    tabCollapsible.getComponent().setAttribute("zk_component_ID", "Preference_tabCollapsible");
    tabCollapsible.getComponent().setAttribute("zk_component_prefix", "Preference_");
    div = new Div();
    div.appendChild(tabCollapsible.getComponent());
    this.appendChild(div);
    div = new Div();
    Label label = new Label(Msg.getMsg(Env.getCtx(), "WindowTabPlacement", true));
    label.setTooltiptext(Msg.getMsg(Env.getCtx(), "WindowTabPlacement", false));
    div.appendChild(label);
    div.appendChild(new Space());
    tabPlacement = new Combobox();
    tabPlacement.appendItem(Msg.getMsg(Env.getCtx(), "Left", true), "Left");
    tabPlacement.appendItem(Msg.getMsg(Env.getCtx(), "Right", true), "Right");
    tabPlacement.setAttribute("zk_component_ID", "Preference_tabPlacement");
    tabPlacement.setAttribute("zk_component_prefix", "Preference_");
    div.appendChild(tabPlacement);
    this.appendChild(div);
    div = new Div();
    label = new Label(Msg.getMsg(Env.getCtx(), "Theme", true));
    label.setTooltiptext(Msg.getMsg(Env.getCtx(), "SelectTheme", false));
    div.appendChild(label);
    div.appendChild(new Space());
    selectedTheme = new WTableDirEditor("AD_Theme_ID", true, false, true, MLookupFactory.get(Env.getCtx(), 0, 0, MColumn.getColumn_ID(MTheme.Table_Name, MTheme.COLUMNNAME_AD_Theme_ID), DisplayType.TableDir));
    selectedTheme.getComponent().addEventListener(Events.ON_CHANGE, this);
    selectedTheme.getComponent().setAttribute("zk_component_ID", "Preference_SetTheme");
    selectedTheme.getComponent().setAttribute("zk_component_prefix", "Preference_");
    div.appendChild(selectedTheme.getComponent());
    this.appendChild(div);
    Separator separator = new Separator();
    separator.setSpacing("20px");
    div = new Div();
    div.appendChild(separator);
    this.appendChild(div);
    ToolBar toolbar = new ToolBar();
    toolbar.setAlign("end");
    this.appendChild(toolbar);
    ToolBarButton btn = new ToolBarButton("");
    btn.setName("btnSave");
    btn.setImage(ServletFns.resolveThemeURL("~./images/Save24.png"));
    btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Save"));
    btn.addEventListener(Events.ON_CLICK, this);
    toolbar.appendChild(btn);
    UserPreference preference = SessionManager.getSessionApplication().getUserPreference();
    if (Integer.parseInt(preference.getProperty(UserPreference.P_ZK_THEME_PREFERENCE)) > 0) {
        m_preferredTheme_ID = Integer.parseInt(preference.getProperty(UserPreference.P_ZK_THEME_PREFERENCE));
    }
    autoCommit.setValue(preference.getProperty(UserPreference.P_AUTO_COMMIT));
    autoNew.setValue(preference.getProperty(UserPreference.P_AUTO_NEW));
    tabCollapsible.setValue(preference.getProperty(UserPreference.P_WINDOW_TAB_COLLAPSIBLE));
    tabPlacement.setValue(preference.getProperty(UserPreference.P_WINDOW_TAB_PLACEMENT));
    selectedTheme.setValue(m_preferredTheme_ID);
}
Also used : Div(org.zkoss.zul.Div) Space(org.zkoss.zul.Space) WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) ToolBarButton(org.adempiere.webui.component.ToolBarButton) Combobox(org.adempiere.webui.component.Combobox) WYesNoEditor(org.adempiere.webui.editor.WYesNoEditor) Label(org.adempiere.webui.component.Label) ToolBar(org.adempiere.webui.component.ToolBar) UserPreference(org.adempiere.webui.util.UserPreference) Separator(org.zkoss.zul.Separator)

Example 3 with ToolBar

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

the class WBrowser method setupToolBar.

/**
	 * Add Components to tool bar
	 */
private void setupToolBar() {
    try {
        toolsBar = new ToolBar();
        WAppsAction action = new WAppsAction(ConfirmPanel.A_REFRESH, null, ConfirmPanel.A_REFRESH);
        bSearch = action.getButton();
        action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
        bOk = action.getButton();
        action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
        bCancel = action.getButton();
        action = new WAppsAction(ConfirmPanel.A_ZOOM, null, ConfirmPanel.A_ZOOM);
        bZoom = action.getButton();
        action = new WAppsAction(ConfirmPanel.A_EXPORT, null, ConfirmPanel.A_EXPORT);
        bExport = action.getButton();
        action = new WAppsAction(ConfirmPanel.A_DELETE, null, ConfirmPanel.A_DELETE);
        bDelete = action.getButton();
        action = new WAppsAction("SelectAll", null, Msg.getMsg(Env.getCtx(), "SelectAll"));
        bSelectAll = action.getButton();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ToolBar(org.adempiere.webui.component.ToolBar) WAppsAction(org.adempiere.webui.component.WAppsAction) SQLException(java.sql.SQLException) AdempiereException(org.adempiere.exceptions.AdempiereException)

Example 4 with ToolBar

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

the class WBrowser method initComponents.

/**
	 * Initialize View Components
	 */
private void initComponents() {
    toolsBar = new ToolBar();
    bZoom = new Button();
    bExport = new Button();
    bDelete = new Button();
    tabsPanel = new Tabbox();
    searchTab = new Borderlayout();
    collapsibleSeach = new North();
    topPanel = new Hbox();
    searchGrid = new WBrowserSearch(getWindowNo(), getAD_Browse_ID(), BrowserSearch.COLUMNS_2);
    detail = new WBrowserTable(this);
    detail.addEventListener(Events.ON_SELECT, this);
    bCancel = new Button();
    bOk = new Button();
    detailPanel = new Borderlayout();
    Borderlayout mainLayout = new Borderlayout();
    setupToolBar();
    bSelectAll.setLabel(Msg.getMsg(Env.getCtx(), "SelectAll").replaceAll("[&]", ""));
    bSelectAll.setEnabled(false);
    bSelectAll.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            selectedRows();
        }
    });
    toolsBar.appendChild(bSelectAll);
    //TODO: victor.perez@e-evolution.com pending print functionality
    /*bPrint.setLabel("Print");

		bPrint.addActionListener(new EventListener() {
			@Override
			public void onEvent(Event event) throws Exception {
				bPrintActionPerformed(event);
			}
		});

		toolsBar.appendChild(bPrint);*/
    bZoom.setLabel(Msg.getMsg(Env.getCtx(), "Zoom").replaceAll("[&]", ""));
    bZoom.setEnabled(false);
    bZoom.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            cmd_Zoom();
        }
    });
    //Only enable if exist a reference
    if (AD_Window_ID > 0)
        toolsBar.appendChild(bZoom);
    bExport.setLabel(Msg.getMsg(Env.getCtx(), "Export"));
    bExport.setEnabled(false);
    bExport.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            cmd_Export();
        }
    });
    toolsBar.appendChild(bExport);
    bDelete.setLabel(Msg.getMsg(Env.getCtx(), "Delete").replaceAll("[&]", ""));
    bDelete.setEnabled(false);
    bDelete.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            cmd_deleteSelection();
        }
    });
    if (isDeleteable())
        toolsBar.appendChild(bDelete);
    m_frame.setWidth("100%");
    m_frame.setHeight("100%");
    m_frame.setStyle("position: absolute; padding: 0; margin: 0");
    m_frame.appendChild(mainLayout);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.setStyle("position: absolute");
    North north = new North();
    north.appendChild(toolsBar);
    mainLayout.appendChild(north);
    searchTab = new Borderlayout();
    searchTab.setWidth("99.4%");
    searchTab.setHeight("99.4%");
    searchTab.setStyle("background-color: transparent");
    topPanel = new Hbox();
    topPanel.setStyle("background-color: transparent");
    bSearch.setLabel(Msg.getMsg(Env.getCtx(), "StartSearch"));
    bSearch.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            cmd_Search();
        }
    });
    Vbox vbox = new Vbox();
    vbox.appendChild(topPanel);
    vbox.appendChild(bSearch);
    vbox.setAlign("center");
    vbox.setWidth("100%");
    vbox.setStyle("background-color: transparent");
    Div div = new Div();
    div.appendChild(vbox);
    div.setWidth("100%");
    div.setHeight("100%");
    collapsibleSeach.setTitle(Msg.getMsg(Env.getCtx(), ("SearchCriteria")));
    collapsibleSeach.setCollapsible(true);
    collapsibleSeach.setAutoscroll(true);
    collapsibleSeach.appendChild(div);
    collapsibleSeach.setStyle("overflow-y:auto");
    collapsibleSeach.setStyle("background-color: transparent");
    collapsibleSeach.setStyle("border: none");
    searchTab.appendChild(collapsibleSeach);
    detail.setWidth("100%");
    //detail.setHeight("100%");
    Center dCenter = new Center();
    dCenter.appendChild(detail);
    dCenter.setBorder("none");
    detail.setVflex(true);
    detail.setFixedLayout(true);
    dCenter.setHflex("true");
    dCenter.setVflex("true");
    dCenter.setAutoscroll(true);
    detailPanel.setHeight("100%");
    detailPanel.setWidth("100%");
    detailPanel.appendCenter(detail);
    //		Div dv = new Div();
    div.appendChild(detailPanel);
    div.setHeight("100%");
    div.setWidth("100%");
    searchTab.appendCenter(detailPanel);
    Hbox hbox = new Hbox();
    //		bCancel.setLabel(Msg.getMsg(Env.getCtx(), "Cancel").replaceAll("[&]",""));
    bCancel.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            cmd_Cancel();
        }
    });
    //		bOk.setLabel(Msg.getMsg(Env.getCtx(), "Ok").replaceAll("[&]",""));
    bOk.addActionListener(new EventListener() {

        public void onEvent(Event evt) {
            cmd_Ok();
        }
    });
    Div confirmDiv = new Div();
    confirmDiv.setAlign("center");
    hbox.appendChild(bCancel);
    hbox.appendChild(bOk);
    hbox.setAlign("center");
    confirmDiv.appendChild(hbox);
    Separator separator = new Separator();
    separator.setBar(true);
    confirmDiv.appendChild(separator);
    confirmDiv.appendChild(statusBar);
    searchTab.appendSouth(confirmDiv);
    searchTab.getSouth().setBorder("none");
    Tabpanel search = new Tabpanel();
    search.setWidth("100%");
    search.appendChild(searchTab);
    Tab tabSearch = new Tab();
    tabSearch.addEventListener(Events.ON_SELECT, this);
    tabSearch.setLabel(Msg.getMsg(Env.getCtx(), "Search").replaceAll("[&]", ""));
    Tabs tabs = new Tabs();
    tabs.appendChild(tabSearch);
    Tabpanels tabPanels = new Tabpanels();
    tabPanels.setWidth("100%");
    tabPanels.appendChild(search);
    //graphPanel = new Borderlayout();
    //TODO victor.perez@e-evolution.com implement Graph Functionality
    //Tabpanel graph = new Tabpanel();
    //graph.setWidth("100%");
    //graph.appendChild(graphPanel);
    //Tab tabGraph = new Tab();
    //tabGraph.addEventListener(Events.ON_SELECT, this);
    //tabGraph.setLabel(Msg.getMsg(Env.getCtx(), "Graph").replaceAll("[&]",
    //		""));
    //tabs.appendChild(tabGraph);
    //tabPanels.appendChild(graph);
    tabsPanel.setWidth("100%");
    tabsPanel.setHeight("100%");
    tabsPanel.appendChild(tabs);
    tabsPanel.appendChild(tabPanels);
    mainLayout.appendCenter(tabsPanel);
}
Also used : Hbox(org.zkoss.zul.Hbox) Center(org.zkoss.zul.Center) Tabbox(org.adempiere.webui.component.Tabbox) Borderlayout(org.adempiere.webui.component.Borderlayout) Div(org.zkoss.zul.Div) Tab(org.adempiere.webui.component.Tab) Button(org.adempiere.webui.component.Button) Tabpanels(org.adempiere.webui.component.Tabpanels) ToolBar(org.adempiere.webui.component.ToolBar) WBrowserTable(org.eevolution.grid.WBrowserTable) Event(org.zkoss.zk.ui.event.Event) Tabs(org.adempiere.webui.component.Tabs) North(org.zkoss.zul.North) EventListener(org.zkoss.zk.ui.event.EventListener) Vbox(org.zkoss.zul.Vbox) Tabpanel(org.adempiere.webui.component.Tabpanel) Separator(org.zkoss.zul.Separator)

Aggregations

ToolBar (org.adempiere.webui.component.ToolBar)4 Button (org.adempiere.webui.component.Button)2 Combobox (org.adempiere.webui.component.Combobox)2 ToolBarButton (org.adempiere.webui.component.ToolBarButton)2 WAppsAction (org.adempiere.webui.component.WAppsAction)2 Div (org.zkoss.zul.Div)2 Hbox (org.zkoss.zul.Hbox)2 Separator (org.zkoss.zul.Separator)2 SQLException (java.sql.SQLException)1 AdempiereException (org.adempiere.exceptions.AdempiereException)1 Borderlayout (org.adempiere.webui.component.Borderlayout)1 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)1 Label (org.adempiere.webui.component.Label)1 ListHead (org.adempiere.webui.component.ListHead)1 ListHeader (org.adempiere.webui.component.ListHeader)1 Listbox (org.adempiere.webui.component.Listbox)1 Panel (org.adempiere.webui.component.Panel)1 Tab (org.adempiere.webui.component.Tab)1 Tabbox (org.adempiere.webui.component.Tabbox)1 Tabpanel (org.adempiere.webui.component.Tabpanel)1