Search in sources :

Example 11 with ToolBarButton

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

the class AboutWindow method createAbout.

private Tabpanel createAbout() {
    Tabpanel tabPanel = new Tabpanel();
    Vbox vbox = new Vbox();
    vbox.setWidth("100%");
    vbox.setHeight("100%");
    vbox.setAlign("center");
    vbox.setPack("center");
    vbox.setParent(tabPanel);
    Image image = new Image(ThemeManager.getSmallLogo());
    image.setParent(vbox);
    Text text = new Text(Adempiere.getSubtitle());
    text.setParent(vbox);
    Separator separator = new Separator();
    separator.setParent(vbox);
    text = new Text(Adempiere.getVersion());
    text.setParent(vbox);
    separator = new Separator();
    separator.setParent(vbox);
    ToolBarButton link = new ToolBarButton();
    link.setLabel("Github Project Site");
    link.setHref("http://github.com/adempiere");
    link.setTarget("_blank");
    link.setParent(vbox);
    separator = new Separator();
    separator.setParent(vbox);
    link = new ToolBarButton();
    link.setLabel("ADempiere.io");
    link.setHref("http://www.adempiere.io");
    link.setTarget("_blank");
    link.setParent(vbox);
    separator = new Separator();
    separator.setParent(vbox);
    link = new ToolBarButton();
    link.setLabel("ADempiere.net");
    link.setHref("http://www.adempiere.net");
    link.setTarget("_blank");
    link.setParent(vbox);
    separator = new Separator();
    separator.setParent(vbox);
    link = new ToolBarButton();
    link.setLabel("ADempiere Wiki");
    link.setHref("http://wiki.adempiere.net");
    link.setTarget("_blank");
    link.setParent(vbox);
    return tabPanel;
}
Also used : ToolBarButton(org.adempiere.webui.component.ToolBarButton) Text(org.zkoss.zhtml.Text) Image(org.zkoss.zul.Image) Tabpanel(org.adempiere.webui.component.Tabpanel) Vbox(org.zkoss.zul.Vbox) Separator(org.zkoss.zul.Separator)

Example 12 with ToolBarButton

use of org.adempiere.webui.component.ToolBarButton 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)

Aggregations

ToolBarButton (org.adempiere.webui.component.ToolBarButton)12 Component (org.zkoss.zk.ui.Component)7 IOException (java.io.IOException)6 Tabpanel (org.adempiere.webui.component.Tabpanel)5 BufferedReader (java.io.BufferedReader)3 InputStreamReader (java.io.InputStreamReader)3 URL (java.net.URL)3 PreparedStatement (java.sql.PreparedStatement)3 ResultSet (java.sql.ResultSet)3 WGraph (org.adempiere.webui.apps.graph.WGraph)3 DashboardPanel (org.adempiere.webui.dashboard.DashboardPanel)3 HeaderPanel (org.adempiere.webui.panel.HeaderPanel)3 SidePanel (org.adempiere.webui.panel.SidePanel)3 MGoal (org.compiere.model.MGoal)3 Separator (org.zkoss.zul.Separator)3 Button (org.adempiere.webui.component.Button)2 Combobox (org.adempiere.webui.component.Combobox)2 Label (org.adempiere.webui.component.Label)2 Listbox (org.adempiere.webui.component.Listbox)2 ToolBar (org.adempiere.webui.component.ToolBar)2