Search in sources :

Example 11 with TabPanel

use of com.extjs.gxt.ui.client.widget.TabPanel in project jahia by Jahia.

the class ResourceBundleEditor method onRender.

@Override
protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setLayout(new FitLayout());
    tabPanel = new TabPanel();
    tabPanel.setWidth("100%");
    tabPanel.setTabPosition(TabPosition.BOTTOM);
    tabPanel.setMinTabWidth(100);
    tabPanel.setLayoutData(new FitLayout());
    tabPanel.add(createPropertiesTab());
    newLanguageTab = createNewLanguageTab();
    tabPanel.add(newLanguageTab);
    newLanguageTab.setEnabled(writable);
    tabPanel.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent event) {
            fillCurrentTab();
        }
    });
    tabPanel.addListener(Events.BeforeSelect, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent event) {
            TabItem selectedItem = tabPanel.getSelectedItem();
            if (selectedItem != null && selectedItem.getItemId().startsWith(LANGUAGE_TAB_ID)) {
                propagateChanges(selectedItem);
            }
        }
    });
    add(tabPanel);
}
Also used : TabPanel(com.extjs.gxt.ui.client.widget.TabPanel) TabItem(com.extjs.gxt.ui.client.widget.TabItem) AsyncTabItem(org.jahia.ajax.gwt.client.widget.AsyncTabItem) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 12 with TabPanel

use of com.extjs.gxt.ui.client.widget.TabPanel in project kura by eclipse.

the class DeviceTabs method onRender.

protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setLayout(new FitLayout());
    setId("device-tabs-wrapper");
    m_tabsPanel = new TabPanel();
    m_tabsPanel.setPlain(true);
    m_tabsPanel.setBorders(false);
    m_tabsPanel.setStyleAttribute("padding-top", "5px");
    m_tabProfile = new TabItem(MSGS.deviceTabProfile());
    m_tabProfile.setBorders(true);
    m_tabProfile.setLayout(new FitLayout());
    m_tabProfile.add(m_profileTab);
    m_tabProfile.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            m_profileTab.refresh();
        }
    });
    m_tabsPanel.add(m_tabProfile);
    m_tabBundles = new TabItem(MSGS.deviceTabBundles());
    m_tabBundles.setBorders(true);
    m_tabBundles.setLayout(new FitLayout());
    m_tabBundles.add(m_bundlesTab);
    m_tabBundles.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            m_bundlesTab.refresh();
        }
    });
    m_tabsPanel.add(m_tabBundles);
    m_tabThreads = new TabItem(MSGS.deviceTabThreads());
    m_tabThreads.setBorders(true);
    m_tabThreads.setLayout(new FitLayout());
    m_tabThreads.add(m_threadsTab);
    m_tabThreads.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            m_threadsTab.refresh();
        }
    });
    m_tabsPanel.add(m_tabThreads);
    m_tabSysProps = new TabItem(MSGS.deviceTabSystemProperties());
    m_tabSysProps.setBorders(true);
    m_tabSysProps.setLayout(new FitLayout());
    m_tabSysProps.add(m_sysPropsTab);
    m_tabSysProps.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            m_sysPropsTab.refresh();
        }
    });
    m_tabsPanel.add(m_tabSysProps);
    m_tabCommand = new TabItem(MSGS.deviceTabCommand());
    m_tabCommand.setBorders(true);
    m_tabCommand.setLayout(new FitLayout());
    m_tabCommand.add(m_commandTab);
    m_tabCommand.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            m_commandTab.refresh();
        }
    });
    m_tabsPanel.add(m_tabCommand);
    add(m_tabsPanel);
}
Also used : TabPanel(com.extjs.gxt.ui.client.widget.TabPanel) TabItem(com.extjs.gxt.ui.client.widget.TabItem) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 13 with TabPanel

use of com.extjs.gxt.ui.client.widget.TabPanel in project kura by eclipse.

the class FirewallConfigTabs method onRender.

protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setId("firewall-tabs-wrapper");
    setLayout(new FitLayout());
    m_tabsPanel = new TabPanel();
    m_tabsPanel.setPlain(true);
    m_tabsPanel.setBorders(false);
    m_tabsPanel.setStyleAttribute("padding-top", "5px");
    m_tabOpenPortsConfig = new TabItem(MSGS.firewallOpenPorts());
    m_tabOpenPortsConfig.setBorders(true);
    m_tabOpenPortsConfig.setLayout(new FitLayout());
    m_tabOpenPortsConfig.add(m_openPortsConfigTab);
    m_tabOpenPortsConfig.addListener(Events.BeforeSelect, new Listener<TabPanelEvent>() {

        public void handleEvent(final TabPanelEvent be) {
            handleTabChangeEvent(m_openPortsConfigTab.isDirty(), be);
        }
    });
    m_tabsPanel.add(m_tabOpenPortsConfig);
    m_tabPortForwardingConfig = new TabItem(MSGS.firewallPortForwarding());
    m_tabPortForwardingConfig.setBorders(true);
    m_tabPortForwardingConfig.setLayout(new FitLayout());
    m_tabPortForwardingConfig.add(m_portForwardingConfigTab);
    m_tabPortForwardingConfig.addListener(Events.BeforeSelect, new Listener<TabPanelEvent>() {

        public void handleEvent(final TabPanelEvent be) {
            handleTabChangeEvent(m_portForwardingConfigTab.isDirty(), be);
        }
    });
    m_tabsPanel.add(m_tabPortForwardingConfig);
    m_tabNatConfig = new TabItem(MSGS.firewallNat());
    m_tabNatConfig.setBorders(true);
    m_tabNatConfig.setLayout(new FitLayout());
    m_tabNatConfig.add(m_natConfigTab);
    m_tabNatConfig.addListener(Events.BeforeSelect, new Listener<TabPanelEvent>() {

        public void handleEvent(final TabPanelEvent be) {
            handleTabChangeEvent(m_natConfigTab.isDirty(), be);
        }
    });
    m_tabsPanel.add(m_tabNatConfig);
    add(m_tabsPanel);
}
Also used : TabPanel(com.extjs.gxt.ui.client.widget.TabPanel) TabItem(com.extjs.gxt.ui.client.widget.TabItem) TabPanelEvent(com.extjs.gxt.ui.client.event.TabPanelEvent) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 14 with TabPanel

use of com.extjs.gxt.ui.client.widget.TabPanel in project kura by eclipse.

the class PackageInstallDialog method onRender.

@Override
protected void onRender(Element parent, int pos) {
    super.onRender(parent, pos);
    setLayout(new FitLayout());
    setBodyBorder(false);
    setModal(true);
    setButtons("");
    setScrollMode(Scroll.AUTO);
    setHideOnButtonClick(false);
    setSize(400, 175);
    m_tabsPanel = new TabPanel();
    m_tabsPanel.setPlain(true);
    m_tabsPanel.setBorders(false);
    // 
    // File upload tab
    m_formPanelFile = new FormPanel();
    m_formPanelFile.setFrame(false);
    m_formPanelFile.setHeaderVisible(false);
    m_formPanelFile.setBodyBorder(false);
    m_formPanelFile.setAction(m_actionUrl + "/upload");
    m_formPanelFile.setEncoding(Encoding.MULTIPART);
    m_formPanelFile.setMethod(Method.POST);
    m_formPanelFile.setButtonAlign(HorizontalAlignment.CENTER);
    m_formPanelFile.setStyleAttribute("padding-right", "0px");
    m_formPanelFile.addListener(Events.Submit, new Listener<FormEvent>() {

        public void handleEvent(FormEvent be) {
            String htmlResponse = be.getResultHtml();
            if (htmlResponse == null || htmlResponse.isEmpty()) {
                MessageBox.info(MSGS.information(), MSGS.fileUploadSuccess(), null);
            } else {
                MessageBox.info(MSGS.information(), MSGS.fileUploadFailure(), null);
            }
            hide();
        }
    });
    FieldSet fileFieldSet = new FieldSet();
    fileFieldSet.setBorders(false);
    fileFieldSet.setStyleAttribute("padding", "0px");
    FormLayout fileFormLayout = new FormLayout();
    fileFormLayout.setLabelWidth(Constants.LABEL_WIDTH_FORM_SMALL);
    fileFieldSet.setLayout(fileFormLayout);
    m_fileUploadField = new FileUploadField();
    m_fileUploadField.setAllowBlank(false);
    m_fileUploadField.setName("uploadedFile");
    m_fileUploadField.setFieldLabel(MSGS.fileLabel());
    if (m_hiddenFields != null) {
        for (HiddenField<?> hf : m_hiddenFields) {
            fileFieldSet.add(hf);
        }
    }
    FormData fileFormData = new FormData("-20");
    fileFormData.setMargins(new Margins(0, 0, 0, 0));
    fileFieldSet.add(m_fileUploadField, fileFormData);
    m_formPanelFile.add(fileFieldSet, fileFormData);
    m_tabFile = new TabItem(MSGS.fileLabel());
    m_tabFile.setBorders(true);
    m_tabFile.setLayout(new FormLayout());
    m_tabFile.add(m_formPanelFile);
    m_tabsPanel.add(m_tabFile);
    // 
    // xsrfToken Hidden field
    // 
    gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() {

        @Override
        public void onFailure(Throwable ex) {
            FailureHandler.handle(ex);
        }

        @Override
        public void onSuccess(GwtXSRFToken token) {
            xsrfTokenFieldFile.setValue(token.getToken());
            xsrfTokenFieldUrl.setValue(token.getToken());
        }
    });
    xsrfTokenFieldFile = new HiddenField<String>();
    xsrfTokenFieldFile.setId("xsrfToken");
    xsrfTokenFieldFile.setName("xsrfToken");
    xsrfTokenFieldFile.setValue("");
    m_formPanelFile.add(xsrfTokenFieldFile);
    // 
    // 
    // Download URL tab
    m_formPanelUrl = new FormPanel();
    m_formPanelUrl.setFrame(false);
    m_formPanelUrl.setHeaderVisible(false);
    m_formPanelUrl.setBodyBorder(false);
    m_formPanelUrl.setAction(m_actionUrl + "/url");
    m_formPanelUrl.setMethod(Method.POST);
    m_formPanelUrl.setStyleAttribute("padding-right", "0px");
    m_formPanelUrl.addListener(Events.Submit, new Listener<FormEvent>() {

        public void handleEvent(FormEvent be) {
            String htmlResponse = be.getResultHtml();
            if (htmlResponse == null || htmlResponse.isEmpty()) {
                MessageBox.info(MSGS.information(), MSGS.fileDownloadSuccess(), null);
            } else {
                String errMsg = htmlResponse;
                int startIdx = htmlResponse.indexOf("<pre>");
                int endIndex = htmlResponse.indexOf("</pre>");
                if (startIdx != -1 && endIndex != -1) {
                    errMsg = htmlResponse.substring(startIdx + 5, endIndex);
                }
                MessageBox.alert(MSGS.error(), MSGS.fileDownloadFailure() + ": " + errMsg, null);
            }
            hide();
        }
    });
    FieldSet urlFieldSet = new FieldSet();
    urlFieldSet.setBorders(false);
    urlFieldSet.setStyleAttribute("padding", "0px");
    FormLayout urlFormLayout = new FormLayout();
    urlFormLayout.setLabelWidth(Constants.LABEL_WIDTH_FORM_SMALL);
    urlFieldSet.setLayout(urlFormLayout);
    m_textFieldUrl = new TextField<String>();
    m_textFieldUrl.setAllowBlank(false);
    m_textFieldUrl.setName("packageUrl");
    m_textFieldUrl.setFieldLabel(MSGS.urlLabel());
    FormData urlFormData = new FormData("-20");
    urlFormData.setMargins(new Margins(0, 0, 0, 0));
    urlFieldSet.add(m_textFieldUrl, urlFormData);
    if (m_hiddenFields != null) {
        for (HiddenField<?> hf : m_hiddenFields) {
            urlFieldSet.add(hf);
        }
    }
    m_formPanelUrl.add(urlFieldSet, urlFormData);
    // 
    // xsrfToken Hidden field
    // 
    xsrfTokenFieldUrl = new HiddenField<String>();
    xsrfTokenFieldUrl.setId("xsrfToken");
    xsrfTokenFieldUrl.setName("xsrfToken");
    xsrfTokenFieldUrl.setValue("");
    m_formPanelUrl.add(xsrfTokenFieldUrl);
    // 
    m_tabUrl = new TabItem(MSGS.urlLabel());
    m_tabUrl.setBorders(true);
    m_tabUrl.setLayout(new FormLayout());
    m_tabUrl.add(m_formPanelUrl);
    m_tabsPanel.add(m_tabUrl);
    add(m_tabsPanel);
}
Also used : TabPanel(com.extjs.gxt.ui.client.widget.TabPanel) FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) FormData(com.extjs.gxt.ui.client.widget.layout.FormData) GwtXSRFToken(org.eclipse.kura.web.shared.model.GwtXSRFToken) FileUploadField(com.extjs.gxt.ui.client.widget.form.FileUploadField) TabItem(com.extjs.gxt.ui.client.widget.TabItem) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) FormPanel(com.extjs.gxt.ui.client.widget.form.FormPanel) FormEvent(com.extjs.gxt.ui.client.event.FormEvent) Margins(com.extjs.gxt.ui.client.util.Margins) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 15 with TabPanel

use of com.extjs.gxt.ui.client.widget.TabPanel in project kapua by eclipse.

the class AccountViewTabs method onRender.

protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setLayout(new FitLayout());
    m_tabsPanel = new TabPanel();
    m_tabsPanel.setPlain(true);
    m_tabsPanel.setBorders(false);
    m_tabsPanel.setBodyBorder(false);
    m_generalTab = new TabItem(MSGS.tabGeneral());
    m_generalTab.setBorders(false);
    m_generalTab.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.info16()));
    m_generalTab.setLayout(new FitLayout());
    m_generalTab.add(m_centerAccountViewGeneralTab);
    m_generalTab.addListener(Events.Select, new Listener<ComponentEvent>() {

        public void handleEvent(ComponentEvent be) {
            m_centerAccountViewGeneralTab.refresh();
        }
    });
    m_tabsPanel.add(m_generalTab);
    if (m_currentSession.hasUserReadPermission()) {
        m_usersTab = new TabItem(MSGS.accountTabUsers());
        m_usersTab.setBorders(false);
        m_usersTab.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.users16()));
        m_usersTab.setLayout(new FitLayout());
        m_usersTab.add(m_centerAccountViewUserTab);
        m_usersTab.addListener(Events.Select, new Listener<ComponentEvent>() {

            public void handleEvent(ComponentEvent be) {
                m_centerAccountViewUserTab.refresh();
            }
        });
        m_tabsPanel.add(m_usersTab);
    }
    m_tabsPanel.addListener(Events.Select, new Listener<TabPanelEvent>() {

        public void handleEvent(TabPanelEvent tpe) {
            TabItem tabItem = tpe.getItem();
            if (tabItem.getItem(0) instanceof AccountDetailsView) {
                AccountDetailsView generalTab = (AccountDetailsView) tabItem.getItem(0);
                generalTab.refresh();
            }
        }
    });
    add(m_tabsPanel);
}
Also used : TabPanel(com.extjs.gxt.ui.client.widget.TabPanel) TabItem(com.extjs.gxt.ui.client.widget.TabItem) TabPanelEvent(com.extjs.gxt.ui.client.event.TabPanelEvent) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Aggregations

TabPanel (com.extjs.gxt.ui.client.widget.TabPanel)17 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)13 TabItem (com.extjs.gxt.ui.client.widget.TabItem)12 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)8 Margins (com.extjs.gxt.ui.client.util.Margins)3 TabPanelEvent (com.extjs.gxt.ui.client.event.TabPanelEvent)2 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)2 FieldSet (com.extjs.gxt.ui.client.widget.form.FieldSet)2 FormPanel (com.extjs.gxt.ui.client.widget.form.FormPanel)2 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)2 FormData (com.extjs.gxt.ui.client.widget.layout.FormData)2 FormLayout (com.extjs.gxt.ui.client.widget.layout.FormLayout)2 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)1 FormEvent (com.extjs.gxt.ui.client.event.FormEvent)1 SelectionListener (com.extjs.gxt.ui.client.event.SelectionListener)1 LayoutContainer (com.extjs.gxt.ui.client.widget.LayoutContainer)1 Status (com.extjs.gxt.ui.client.widget.Status)1 Button (com.extjs.gxt.ui.client.widget.button.Button)1 ButtonBar (com.extjs.gxt.ui.client.widget.button.ButtonBar)1 FileUploadField (com.extjs.gxt.ui.client.widget.form.FileUploadField)1