Search in sources :

Example 21 with North

use of org.zkoss.zul.North in project adempiere by adempiere.

the class NavBarDesktop method doCreatePart.

protected Component doCreatePart(Component parent) {
    SidePanel pnlSide = new SidePanel();
    HeaderPanel pnlHead = new HeaderPanel();
    pnlSide.getMenuPanel().addMenuListener(this);
    layout = new Borderlayout();
    if (parent != null) {
        layout.setParent(parent);
        layout.setWidth("100%");
        layout.setHeight("100%");
        layout.setStyle("position: absolute");
    } else
        layout.setPage(page);
    dashboardRunnable = new DashboardRunnable(layout.getDesktop(), this);
    North n = new North();
    n.setSplittable(true);
    n.setCollapsible(false);
    layout.appendChild(n);
    pnlHead.setParent(n);
    leftRegion = new West();
    layout.appendChild(leftRegion);
    leftRegion.setWidth("300px");
    leftRegion.setCollapsible(true);
    leftRegion.setSplittable(true);
    leftRegion.setTitle("Navigation");
    //leftRegion.setHflex("true");
    leftRegion.setVflex("true");
    leftRegion.addEventListener(Events.ON_OPEN, new EventListener() {

        @Override
        public void onEvent(Event event) throws Exception {
            OpenEvent oe = (OpenEvent) event;
            UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
            pref.setProperty(UserPreference.P_MENU_COLLAPSED, !oe.isOpen());
            pref.savePreference();
        }
    });
    UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
    boolean menuCollapsed = pref.isPropertyBool(UserPreference.P_MENU_COLLAPSED);
    leftRegion.setOpen(!menuCollapsed);
    navigationPanel = new Accordion();
    navigationPanel.setParent(leftRegion);
    navigationPanel.setWidth("100%");
    navigationPanel.setHeight("100%");
    navigationPanel.add(pnlSide, "Application Menu");
    Div div = new Div();
    favPanel = (DPFavourites) Executions.createComponents(FAVOURITES_PATH, div, null);
    navigationPanel.add(div, "Favourites");
    //setup drag and drop for favourites
    div = navigationPanel.getHeader(1);
    div.setDroppable(DPFavourites.FAVOURITE_DROPPABLE);
    div.addEventListener(Events.ON_DROP, this);
    div = new Div();
    Component component = Executions.createComponents(ACTIVITIES_PATH, div, null);
    if (component instanceof DashboardPanel) {
        DashboardPanel dashboardPanel = (DashboardPanel) component;
        dashboardRunnable.add(dashboardPanel);
    }
    navigationPanel.add(div, "Activities");
    div = new Div();
    Executions.createComponents(VIEWS_PATH, div, null);
    navigationPanel.add(div, Msg.getMsg(Env.getCtx(), "View").replaceAll("&", ""));
    navigationPanel.setSelectedIndex(0);
    windowArea = new Center();
    windowArea.setParent(layout);
    windowArea.setHflex("true");
    windowArea.setVflex("true");
    windowContainer.createPart(windowArea);
    createHomeTab();
    return layout;
}
Also used : Center(org.zkoss.zul.Center) SidePanel(org.adempiere.webui.panel.SidePanel) West(org.zkoss.zul.West) Borderlayout(org.zkoss.zul.Borderlayout) DashboardRunnable(org.adempiere.webui.dashboard.DashboardRunnable) IOException(java.io.IOException) Div(org.zkoss.zul.Div) DashboardPanel(org.adempiere.webui.dashboard.DashboardPanel) Accordion(org.adempiere.webui.component.Accordion) HeaderPanel(org.adempiere.webui.panel.HeaderPanel) Event(org.zkoss.zk.ui.event.Event) OpenEvent(org.zkoss.zk.ui.event.OpenEvent) DropEvent(org.zkoss.zk.ui.event.DropEvent) North(org.zkoss.zul.North) UserPreference(org.adempiere.webui.util.UserPreference) EventListener(org.zkoss.zk.ui.event.EventListener) Component(org.zkoss.zk.ui.Component) OpenEvent(org.zkoss.zk.ui.event.OpenEvent)

Example 22 with North

use of org.zkoss.zul.North in project adempiere by adempiere.

the class NavBar2Desktop method doCreatePart.

protected Component doCreatePart(Component parent) {
    SidePanel pnlSide = new SidePanel();
    HeaderPanel pnlHead = new HeaderPanel();
    pnlSide.getMenuPanel().addMenuListener(this);
    layout = new Borderlayout();
    if (parent != null) {
        layout.setParent(parent);
        layout.setWidth("100%");
        layout.setHeight("100%");
        layout.setStyle("position: absolute");
    } else
        layout.setPage(page);
    dashboardRunnable = new DashboardRunnable(layout.getDesktop(), this);
    North n = new North();
    n.setSplittable(true);
    n.setCollapsible(false);
    layout.appendChild(n);
    pnlHead.setParent(n);
    West w = new West();
    layout.appendChild(w);
    w.setWidth("300px");
    w.setCollapsible(true);
    w.setSplittable(true);
    w.setTitle(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Menu")));
    //w.setHflex("true");
    w.setVflex("true");
    w.addEventListener(Events.ON_OPEN, new EventListener() {

        @Override
        public void onEvent(Event event) throws Exception {
            OpenEvent oe = (OpenEvent) event;
            UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
            pref.setProperty(UserPreference.P_MENU_COLLAPSED, !oe.isOpen());
            pref.savePreference();
        }
    });
    UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
    boolean menuCollapsed = pref.isPropertyBool(UserPreference.P_MENU_COLLAPSED);
    w.setOpen(!menuCollapsed);
    pnlSide.setParent(w);
    Center center = new Center();
    center.setParent(layout);
    center.setHflex("true");
    center.setVflex("true");
    Borderlayout innerLayout = new Borderlayout();
    innerLayout.setHeight("100%");
    innerLayout.setWidth("100%");
    innerLayout.setParent(center);
    West innerW = new West();
    innerW.setWidth("200px");
    innerW.setCollapsible(true);
    innerW.setTitle("Navigation");
    innerW.setSplittable(true);
    innerW.setCollapsible(true);
    innerW.setParent(innerLayout);
    shortcutPanel = new Accordion();
    shortcutPanel.setWidth("100%");
    shortcutPanel.setHeight("100%");
    innerW.appendChild(shortcutPanel);
    Div div = new Div();
    Executions.createComponents(FAVOURITES_PATH, div, null);
    shortcutPanel.add(div, "Favourites");
    div = new Div();
    Component component = Executions.createComponents(ACTIVITIES_PATH, div, null);
    if (component instanceof DashboardPanel) {
        DashboardPanel dashboardPanel = (DashboardPanel) component;
        dashboardRunnable.add(dashboardPanel);
    }
    shortcutPanel.add(div, "Activities");
    shortcutPanel.setSelectedIndex(0);
    windowArea = new Center();
    windowArea.setParent(innerLayout);
    windowArea.setHflex("true");
    windowArea.setVflex("true");
    windowContainer.createPart(windowArea);
    createHomeTab();
    return layout;
}
Also used : Center(org.zkoss.zul.Center) SidePanel(org.adempiere.webui.panel.SidePanel) West(org.zkoss.zul.West) Borderlayout(org.zkoss.zul.Borderlayout) DashboardRunnable(org.adempiere.webui.dashboard.DashboardRunnable) IOException(java.io.IOException) Div(org.zkoss.zul.Div) DashboardPanel(org.adempiere.webui.dashboard.DashboardPanel) Accordion(org.adempiere.webui.component.Accordion) HeaderPanel(org.adempiere.webui.panel.HeaderPanel) Event(org.zkoss.zk.ui.event.Event) OpenEvent(org.zkoss.zk.ui.event.OpenEvent) North(org.zkoss.zul.North) UserPreference(org.adempiere.webui.util.UserPreference) EventListener(org.zkoss.zk.ui.event.EventListener) Component(org.zkoss.zk.ui.Component) OpenEvent(org.zkoss.zk.ui.event.OpenEvent)

Example 23 with North

use of org.zkoss.zul.North in project adempiere by adempiere.

the class WWFPanelManufacturing method initForm.

@Override
protected void initForm() {
    this.setHeight("100%");
    Borderlayout layout = new Borderlayout();
    layout.setStyle("width: 100%; height: 100%; position: absolute;");
    appendChild(layout);
    String sql = MRole.getDefault().addAccessSQL("SELECT AD_Workflow_ID, Name FROM AD_Workflow WHERE " + WF_WhereClause + " ORDER BY 2", "AD_Workflow", MRole.SQL_NOTQUALIFIED, //	all
    MRole.SQL_RO);
    KeyNamePair[] pp = DB.getKeyNamePairs(sql, true);
    workflowList = ListboxFactory.newDropdownListbox();
    for (KeyNamePair knp : pp) {
        workflowList.addItem(knp);
    }
    workflowList.addEventListener(Events.ON_SELECT, this);
    North north = new North();
    layout.appendChild(north);
    north.appendChild(workflowList);
    workflowList.setStyle("margin-left: 10px; margin-top: 5px;");
    north.setHeight("30px");
    imageMap = new Imagemap();
    Center center = new Center();
    layout.appendChild(center);
    center.setAutoscroll(true);
    //		center.setFlex(true);
    center.appendChild(imageMap);
    ConfirmPanel confirmPanel = new ConfirmPanel(true);
    confirmPanel.addActionListener(this);
    South south = new South();
    layout.appendChild(south);
    south.appendChild(confirmPanel);
    south.setHeight("36px");
}
Also used : Center(org.zkoss.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) South(org.zkoss.zul.South) North(org.zkoss.zul.North) Borderlayout(org.zkoss.zul.Borderlayout) KeyNamePair(org.compiere.util.KeyNamePair) Imagemap(org.zkoss.zul.Imagemap)

Example 24 with North

use of org.zkoss.zul.North in project adempiere by adempiere.

the class WTreeBOM method jbInit.

private void jbInit() {
    m_frame.setWidth("99%");
    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");
    labelProduct.setText(Msg.getElement(getCtx(), "M_Product_ID"));
    implosion.setText(Msg.getElement(getCtx(), "Implosion"));
    North north = new North();
    mainLayout.appendChild(north);
    north.appendChild(northPanel);
    north.setHeight("28px");
    northPanel.appendChild(labelProduct);
    northPanel.appendChild(new Space());
    fieldProduct.getComponent().setWidth("20%");
    northPanel.appendChild(fieldProduct.getComponent());
    northPanel.appendChild(new Space());
    northPanel.appendChild(implosion);
    northPanel.appendChild(new Space());
    northPanel.appendChild(treeInfo);
    South south = new South();
    mainLayout.appendChild(south);
    south.appendChild(confirmPanel);
    confirmPanel.addActionListener(this);
    West west = new West();
    mainLayout.appendChild(west);
    west.setSplittable(true);
    west.appendChild(treePane);
    treePane.appendChild(m_tree);
    m_tree.setStyle("border: none");
    west.setWidth("25%");
    west.setAutoscroll(true);
    Center center = new Center();
    mainLayout.appendChild(center);
    center.appendChild(dataPane);
    dataPane.appendChild(tableBOM);
    tableBOM.setVflex(true);
    tableBOM.setFixedLayout(true);
    center.setFlex(true);
    center.setAutoscroll(true);
}
Also used : Space(org.zkoss.zul.Space) Center(org.zkoss.zul.Center) West(org.zkoss.zul.West) South(org.zkoss.zul.South) North(org.zkoss.zul.North)

Example 25 with North

use of org.zkoss.zul.North in project adempiere by adempiere.

the class WLogin method doCreatePart.

protected Component doCreatePart(Component parent) {
    layout = new Borderlayout();
    if (parent != null)
        layout.setParent(parent);
    else
        layout.setPage(page);
    ThemeUtils.addSclass("ad-wlogin-layout", layout);
    Center center = new Center();
    center.setParent(layout);
    center.setHflex("true");
    center.setVflex("true");
    center.setAutoscroll(true);
    ThemeUtils.addSclass("ad-wlogin-layout-center", center);
    Vbox vb = new Vbox();
    vb.setParent(center);
    vb.setPack("center");
    vb.setAlign("center");
    vb.setWidth("100%");
    vb.setHeight("100%");
    LoginWindow loginWindow = new LoginWindow(app);
    loginWindow.setParent(vb);
    if (!AEnv.isBrowserSupported()) {
        //TODO: localization
        String msg = "You might experience slow performance and user interface anomalies using your current browser to access the application. We recommend the use of Firefox, Google Chrome or Apple Safari.";
        browserWarningWindow = new Window();
        ThemeUtils.addSclass("ad-wlogin-browser-not-supported", browserWarningWindow);
        Div div = new Div();
        div.appendChild(new Text(msg));
        browserWarningWindow.setPosition("top,right");
        browserWarningWindow.appendChild(div);
        browserWarningWindow.setPage(page);
        browserWarningWindow.doOverlapped();
    }
    try {
        String right = ThemeUtils.getLoginRightPanel();
        PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(right);
        East east = new East();
        ThemeUtils.addSclass("ad-wlogin-east-panel", east);
        addContent(east, pageDefintion);
    } catch (Exception e) {
        //ignore page not found exception
        if (e instanceof UiException) {
            if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
                e.printStackTrace();
            }
        } else {
            e.printStackTrace();
        }
    }
    try {
        String left = ThemeUtils.getLoginLeftPanel();
        PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(left);
        West west = new West();
        ThemeUtils.addSclass("ad-wlogin-west-panel", west);
        addContent(west, pageDefintion);
    } catch (Exception e) {
        //ignore page not found exception
        if (e instanceof UiException) {
            if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
                e.printStackTrace();
            }
        } else {
            e.printStackTrace();
        }
    }
    try {
        String top = ThemeUtils.getLoginTopPanel();
        PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(top);
        North north = new North();
        ThemeUtils.addSclass("ad-wlogin-north-panel", north);
        addContent(north, pageDefintion);
    } catch (Exception e) {
        //ignore page not found exception
        if (e instanceof UiException) {
            if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
                e.printStackTrace();
            }
        } else {
            e.printStackTrace();
        }
    }
    try {
        String bottom = ThemeUtils.getLoginBottomPanel();
        PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(bottom);
        South south = new South();
        ThemeUtils.addSclass("ad-wlogin-south-panel", south);
        addContent(south, pageDefintion);
    } catch (Exception e) {
        //ignore page not found exception
        if (e instanceof UiException) {
            if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
                e.printStackTrace();
            }
        } else {
            e.printStackTrace();
        }
    }
    return layout;
}
Also used : LoginWindow(org.adempiere.webui.window.LoginWindow) Window(org.zkoss.zul.Window) PageDefinition(org.zkoss.zk.ui.metainfo.PageDefinition) Center(org.zkoss.zul.Center) LoginWindow(org.adempiere.webui.window.LoginWindow) West(org.zkoss.zul.West) South(org.zkoss.zul.South) Text(org.zkoss.zhtml.Text) Borderlayout(org.zkoss.zul.Borderlayout) UiException(org.zkoss.zk.ui.UiException) UiException(org.zkoss.zk.ui.UiException) Div(org.zkoss.zul.Div) North(org.zkoss.zul.North) Vbox(org.zkoss.zul.Vbox) East(org.zkoss.zul.East)

Aggregations

North (org.zkoss.zul.North)37 Center (org.zkoss.zul.Center)35 South (org.zkoss.zul.South)28 Borderlayout (org.zkoss.zul.Borderlayout)18 Rows (org.adempiere.webui.component.Rows)11 Div (org.zkoss.zul.Div)11 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)10 Row (org.adempiere.webui.component.Row)9 Separator (org.zkoss.zul.Separator)9 Panel (org.adempiere.webui.component.Panel)7 Tab (org.adempiere.webui.component.Tab)7 Space (org.zkoss.zul.Space)7 Tabs (org.adempiere.webui.component.Tabs)6 Event (org.zkoss.zk.ui.event.Event)6 West (org.zkoss.zul.West)6 Tabpanels (org.adempiere.webui.component.Tabpanels)5 SQLException (java.sql.SQLException)4 Label (org.adempiere.webui.component.Label)4 StatusBarPanel (org.adempiere.webui.panel.StatusBarPanel)4 EventListener (org.zkoss.zk.ui.event.EventListener)4