Search in sources :

Example 11 with Combobox

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

Combobox (org.adempiere.webui.component.Combobox)11 Checkbox (org.adempiere.webui.component.Checkbox)3 Label (org.adempiere.webui.component.Label)3 Textbox (org.adempiere.webui.component.Textbox)3 Component (org.zkoss.zk.ui.Component)3 Button (org.adempiere.webui.component.Button)2 ToolBar (org.adempiere.webui.component.ToolBar)2 ToolBarButton (org.adempiere.webui.component.ToolBarButton)2 WTableDirEditor (org.adempiere.webui.editor.WTableDirEditor)2 UserPreference (org.adempiere.webui.util.UserPreference)2 Language (org.compiere.util.Language)2 BigDecimal (java.math.BigDecimal)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 DecimalFormat (java.text.DecimalFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ResourceBundle (java.util.ResourceBundle)1 MBrowseField (org.adempiere.model.MBrowseField)1 ComboItem (org.adempiere.webui.component.ComboItem)1