Search in sources :

Example 1 with Text

use of org.zkoss.zhtml.Text in project adempiere by adempiere.

the class WBrowserListItemRenderer method setLabelText.

/**
	 * Set the label text
	 * @param text
	 * @param label
	 */
private void setLabelText(String text, Label label) {
    String display = text;
    if (text != null && text.length() > MAX_TEXT_LENGTH)
        display = text.substring(0, MAX_TEXT_LENGTH - 3) + "...";
    if (display != null)
        display = XMLs.encodeText(display);
    label.appendChild(new Text(display));
    if (text != null && text.length() > MAX_TEXT_LENGTH)
        label.setDynamicProperty("title", text);
    else
        label.setDynamicProperty("title", "");
}
Also used : Text(org.zkoss.zhtml.Text)

Example 2 with Text

use of org.zkoss.zhtml.Text in project adempiere by adempiere.

the class StatusBarPanel method setStatusLine.

/**
     * @param text
     * @param error
     * @param showPopup ignore for embedded
     */
public void setStatusLine(String text, boolean error, boolean showPopup) {
    statusLine.setText(text);
    if (error)
        statusLine.setStyle("color: red");
    else
        statusLine.setStyle("color: black");
    statusLine.setTooltiptext(text);
    if (showPopup && AEnv.isBrowserSupported()) {
        Text t = new Text(text);
        popupContent.getChildren().clear();
        popupContent.appendChild(t);
        popupContent.setStyle(POPUP_TEXT_STYLE);
        if (error) {
            popupStyle = POPUP_ERROR_BACKGROUND_STYLE;
        } else {
            popupStyle = POPUP_INFO_BACKGROUND_STYLE;
        }
        String shadow = SHADOW_STYLE;
        popupStyle = popupStyle + shadow + POPUP_POSITION_STYLE;
        showPopup();
        //auto hide
        /* TODO-evenos: ZK6 */
        String script = "setTimeout('zk.Widget.$(\"" + popup.getUuid() + "\").$n().style.display = \"none\"',";
        if (error)
            script += "3500";
        else
            script += "1000";
        script += ")";
        AuScript aus = new AuScript(popup, script);
        Clients.response("statusPopupFade", aus);
    }
}
Also used : Text(org.zkoss.zhtml.Text) AuScript(org.zkoss.zk.au.out.AuScript)

Example 3 with Text

use of org.zkoss.zhtml.Text in project adempiere by adempiere.

the class WDeleteSelection method initComponents.

/**
	 * Init components
	 */
private void initComponents() {
    container = new Window();
    container.setTitle(Msg.getMsg(Env.getCtx(), "DeleteSelection"));
    container.setAttribute("modal", Boolean.TRUE);
    container.setWidth("500px");
    container.setHeight("400px");
    container.setBorder("normal");
    container.setSizable(true);
    container.setClosable(true);
    container.setMaximizable(true);
    //	Init list
    listbox = new Listbox();
    // FR [ 2877111 ]
    Vector<String> data = getData();
    for (int i = 0; i < data.size(); i++) {
        String record = data.get(i);
        listbox.appendItem(record, record);
    }
    //	Is a multiple selection
    listbox.setMultiple(true);
    //	Instance Panel
    confirmPanel = new ConfirmPanel(true);
    //	
    Div div = new Div();
    div.setStyle("width: 100%; height: 100%");
    Pre pre = new Pre();
    Text text = new Text(Msg.getMsg(Env.getCtx(), "DeleteSelectionDescription"));
    text.setParent(pre);
    pre.setParent(div);
    //
    Borderlayout layout = new Borderlayout();
    layout.setParent(container);
    layout.setWidth("100%");
    layout.setHeight("100%");
    North north = new North();
    north.setParent(layout);
    north.appendChild(div);
    Center center = new Center();
    center.setParent(layout);
    center.setFlex(true);
    center.appendChild(listbox);
    listbox.setWidth("100%");
    listbox.setVflex(true);
    //
    South south = new South();
    south.setParent(layout);
    south.appendChild(confirmPanel);
    //	Add Listener
    confirmPanel.addActionListener(Events.ON_CLICK, this);
    //	Default Selected
    if (isDefaultSelected() && getSelection() != null) {
        listbox.setSelectedIndices(getSelection());
    }
}
Also used : Window(org.adempiere.webui.component.Window) Pre(org.zkoss.zhtml.Pre) Center(org.zkoss.zkex.zul.Center) South(org.zkoss.zkex.zul.South) Text(org.zkoss.zhtml.Text) Borderlayout(org.zkoss.zkex.zul.Borderlayout) Div(org.zkoss.zul.Div) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) North(org.zkoss.zkex.zul.North) Listbox(org.adempiere.webui.component.Listbox)

Example 4 with Text

use of org.zkoss.zhtml.Text in project adempiere by adempiere.

the class WRecordInfo method init.

/**
	 * 	Static Layout
	 *	@throws Exception
	 */
private void init() throws Exception {
    Div div = new Div();
    div.setStyle("width: 100%; height: 100%");
    Pre pre = new Pre();
    Text text = new Text(getInfo());
    text.setParent(pre);
    pre.setParent(div);
    //
    Borderlayout layout = new Borderlayout();
    layout.setParent(v_Container);
    layout.setWidth("100%");
    layout.setHeight("100%");
    Center center = new Center();
    center.setParent(layout);
    center.setFlex(true);
    if (isOk()) {
        North north = new North();
        north.setParent(layout);
        north.appendChild(div);
        center.appendChild(table);
        table.setWidth("100%");
        table.setVflex(true);
    } else {
        center.appendChild(div);
    }
    //
    South south = new South();
    south.setParent(layout);
    south.appendChild(confirmPanel);
    confirmPanel.addActionListener(Events.ON_CLICK, this);
}
Also used : Div(org.zkoss.zul.Div) Pre(org.zkoss.zhtml.Pre) Center(org.zkoss.zkex.zul.Center) South(org.zkoss.zkex.zul.South) Text(org.zkoss.zhtml.Text) North(org.zkoss.zkex.zul.North) Borderlayout(org.zkoss.zkex.zul.Borderlayout)

Example 5 with Text

use of org.zkoss.zhtml.Text 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

Text (org.zkoss.zhtml.Text)9 Div (org.zkoss.zul.Div)5 Pre (org.zkoss.zhtml.Pre)3 Tabpanel (org.adempiere.webui.component.Tabpanel)2 Borderlayout (org.zkoss.zkex.zul.Borderlayout)2 Center (org.zkoss.zkex.zul.Center)2 North (org.zkoss.zkex.zul.North)2 South (org.zkoss.zkex.zul.South)2 Vbox (org.zkoss.zul.Vbox)2 Point (java.awt.Point)1 BigDecimal (java.math.BigDecimal)1 GraphColumn (org.adempiere.apps.graph.GraphColumn)1 ValueChangeEvent (org.adempiere.exceptions.ValueChangeEvent)1 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)1 Listbox (org.adempiere.webui.component.Listbox)1 ToolBarButton (org.adempiere.webui.component.ToolBarButton)1 Window (org.adempiere.webui.component.Window)1 LoginWindow (org.adempiere.webui.window.LoginWindow)1 ChartMouseEvent (org.jfree.chart.ChartMouseEvent)1 A (org.zkoss.zhtml.A)1