Search in sources :

Example 11 with Tabs

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

the class WTextEditorDialog method init.

private void init() {
    setBorder("normal");
    VerticalBox vbox = new VerticalBox();
    appendChild(vbox);
    tabbox = new Tabbox();
    vbox.appendChild(tabbox);
    Tabs tabs = new Tabs();
    tabbox.appendChild(tabs);
    Tabpanels tabPanels = new Tabpanels();
    tabbox.appendChild(tabPanels);
    Tab tab = new Tab("Text");
    tabs.appendChild(tab);
    Tabpanel tabPanel = new Tabpanel();
    tabPanels.appendChild(tabPanel);
    textBox = new Textbox(text);
    textBox.setCols(80);
    textBox.setRows(30);
    textBox.setEnabled(editable);
    textBox.setWidth("700px");
    textBox.setHeight("500px");
    tabPanel.appendChild(textBox);
    tab = new Tab("HTML");
    tabs.appendChild(tab);
    tabPanel = new Tabpanel();
    tabPanels.appendChild(tabPanel);
    if (editable) {
        editor = new FCKeditor();
        tabPanel.appendChild(editor);
        editor.setWidth("700px");
        editor.setHeight("500px");
        editor.setValue(text);
    } else {
        Div div = new Div();
        div.setHeight("500px");
        div.setWidth("700px");
        div.setStyle("overflow: auto; border: 1px solid");
        tabPanel.appendChild(div);
        Html html = new Html();
        div.appendChild(html);
        html.setContent(text);
    }
    vbox.appendChild(new Separator());
    ConfirmPanel confirmPanel = new ConfirmPanel(true);
    vbox.appendChild(confirmPanel);
    confirmPanel.addButton(confirmPanel.createButton(ConfirmPanel.A_RESET));
    confirmPanel.addActionListener(this);
    if (maxSize > 0) {
        status = new Label();
        appendChild(status);
        updateStatus(text.length());
        status.setStyle("margin-top:10px;");
        textBox.addEventListener(Events.ON_CHANGE, this);
        editor.addEventListener(Events.ON_CHANGE, this);
    }
    tabbox.addEventListener(Events.ON_SELECT, this);
}
Also used : VerticalBox(org.adempiere.webui.component.VerticalBox) Textbox(org.adempiere.webui.component.Textbox) Label(org.adempiere.webui.component.Label) Html(org.zkoss.zul.Html) Tabbox(org.adempiere.webui.component.Tabbox) Div(org.zkoss.zul.Div) Tab(org.adempiere.webui.component.Tab) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Tabpanels(org.adempiere.webui.component.Tabpanels) Tabs(org.adempiere.webui.component.Tabs) Tabpanel(org.adempiere.webui.component.Tabpanel) Separator(org.zkoss.zul.Separator) FCKeditor(org.zkforge.fckez.FCKeditor)

Aggregations

Tabs (org.adempiere.webui.component.Tabs)11 Tabpanels (org.adempiere.webui.component.Tabpanels)10 Tab (org.adempiere.webui.component.Tab)9 Tabbox (org.adempiere.webui.component.Tabbox)6 Tabpanel (org.adempiere.webui.component.Tabpanel)6 Center (org.zkoss.zul.Center)6 North (org.zkoss.zul.North)6 Rows (org.adempiere.webui.component.Rows)3 Event (org.zkoss.zk.ui.event.Event)3 Borderlayout (org.zkoss.zul.Borderlayout)3 Div (org.zkoss.zul.Div)3 South (org.zkoss.zul.South)3 SQLException (java.sql.SQLException)2 Button (org.adempiere.webui.component.Button)2 Row (org.adempiere.webui.component.Row)2 ColumnInfo (org.compiere.minigrid.ColumnInfo)2 Hbox (org.zkoss.zul.Hbox)2 Separator (org.zkoss.zul.Separator)2 Vbox (org.zkoss.zul.Vbox)2 Borderlayout (org.adempiere.webui.component.Borderlayout)1