Example usage for org.apache.wicket.extensions.markup.html.tabs TabbedPanel TAB_PANEL_ID

List of usage examples for org.apache.wicket.extensions.markup.html.tabs TabbedPanel TAB_PANEL_ID

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.markup.html.tabs TabbedPanel TAB_PANEL_ID.

Prototype

String TAB_PANEL_ID

To view the source code for org.apache.wicket.extensions.markup.html.tabs TabbedPanel TAB_PANEL_ID.

Click Source Link

Document

id used for child panels

Usage

From source file:au.org.theark.core.web.component.ArkMainTab.java

License:Open Source License

@Override
public Panel getPanel(String panelId) {
    if (panel == null) {
        // Lazily create the panel
        panel = createPanel();/*  w  w  w.j  a  v a 2s  .  co  m*/
        if (!TabbedPanel.TAB_PANEL_ID.equals(panel.getId())) {
            throw new IllegalArgumentException("Panel id must be TabbedPanel.TAB_PANEL_ID");
        }
        panel.setOutputMarkupId(true);
    }
    return panel;
}

From source file:com.doculibre.constellio.wicket.panels.admin.collection.AddEditCollectionPanel.java

License:Open Source License

@Override
protected void defaultReturnAction() {
    RecordCollection collection = collectionModel.getObject();
    AdminTopMenuPanel adminTabsPanel = (AdminTopMenuPanel) findParent(AdminTopMenuPanel.class);
    if (collection.getId() != null && !collection.isOpenSearch() && !edit) {
        AdminCollectionPanel adminCollectionPanel = new AdminCollectionPanel(TabbedPanel.TAB_PANEL_ID,
                collection);/*from  www . jav  a2s. c  o  m*/
        adminTabsPanel.replaceTabContent(adminCollectionPanel);
        adminCollectionPanel.setSelectedTab(0);
    } else {
        super.defaultReturnAction();
    }
}

From source file:com.doculibre.constellio.wicket.panels.admin.collection.CollectionListPanel.java

License:Open Source License

@Override
protected void onClickDetailsLink(IModel entityModel, AjaxRequestTarget target, ModalWindow detailsModal,
        int index) {
    RecordCollection collection = (RecordCollection) entityModel.getObject();
    if (!collection.isOpenSearch()) {
        AdminTopMenuPanel adminTabsPanel = (AdminTopMenuPanel) findParent(AdminTopMenuPanel.class);
        AdminCollectionPanel adminCollectionPanel = new AdminCollectionPanel(TabbedPanel.TAB_PANEL_ID,
                collection);//from w w w  . ja  va 2s . co m
        adminTabsPanel.replaceTabContent(adminCollectionPanel);
        adminCollectionPanel.setSelectedTab(0);
        if (target != null) {
            target.addComponent(adminTabsPanel);
        }
    }
}

From source file:com.doculibre.constellio.wicket.panels.admin.tabs.AdminLeftMenuPanel.java

License:Open Source License

private void setBreadCrumbs() {
    AdminTopMenuPanel topMenuPanel = (AdminTopMenuPanel) findParent(AdminTopMenuPanel.class);
    BreadCrumbBar breadCrumbBar = topMenuPanel.getBreadCrumbBar();
    int breadCrumbCount = breadCrumbBar.allBreadCrumbParticipants().size();
    if (breadCrumbCount == 2) {
        breadCrumbBar.allBreadCrumbParticipants().remove(1);
    }//  w ww  . ja  va 2  s .  c o m
    breadCrumbBar.setActive(new IBreadCrumbParticipant() {
        @Override
        public void onActivate(IBreadCrumbParticipant previous) {
            // Nothing to do
        }

        @Override
        public String getTitle() {
            int selectedTab = getSelectedTab();
            if (selectedTab == -1) {
                selectedTab = 0;
            }
            ITab leftMenuTab = (ITab) getTabs().get(selectedTab);
            String leftMenuTitle = leftMenuTab.getTitle().getObject().toString();

            AdminTopMenuPanel adminTopMenuPanel = (AdminTopMenuPanel) findParent(AdminTopMenuPanel.class);
            if (adminTopMenuPanel.getSelectedTab() == 0) {
                Component currentTabContent = adminTopMenuPanel.get(TAB_PANEL_ID);
                if (currentTabContent instanceof AdminCollectionPanel) {
                    AdminCollectionPanel adminCollectionPanel = (AdminCollectionPanel) currentTabContent;
                    RecordCollection collection = adminCollectionPanel.getCollection();
                    Locale displayLocale = collection.getDisplayLocale(getLocale());
                    String collectionTitle = collection.getTitle(displayLocale);
                    leftMenuTitle = collectionTitle + " > " + leftMenuTitle;
                }
            }
            return leftMenuTitle;
        }

        @Override
        public Component getComponent() {
            return get(TabbedPanel.TAB_PANEL_ID);
        }
    });
}

From source file:com.doculibre.constellio.wicket.panels.admin.tabs.AdminTopMenuPanel.java

License:Open Source License

public void replaceTabContent(Panel newTabContent) {
    Panel tabContentPanel = (Panel) get(TabbedPanel.TAB_PANEL_ID);
    tabContentPanel.replaceWith(newTabContent);
    setBreadCrumbs();
}

From source file:com.userweave.module.methoden.questionnaire.page.conf.QuestionnaireConfigurationUI.java

License:Open Source License

@Override
public void onFilter(AjaxRequestTarget target, StateChangeTrigger trigger) {
    super.onFilter(target, trigger);

    // delegate on filter event to selected tab      
    Component panel = tabPanel.get(TabbedPanel.TAB_PANEL_ID);

    if (panel != null && panel instanceof QuestionConfigurationPanel) {
        ((QuestionConfigurationPanel) panel).onFilter(target, trigger);
    }//from www .  j a  v  a  2 s . co m
}

From source file:com.userweave.pages.components.studypanel.StudyPanel.java

License:Open Source License

@Override
public void onFilter(AjaxRequestTarget target, StateChangeTrigger trigger) {
    // delegate on filter event to selected tab      
    Component panel = tabbedPanel.get(TabbedPanel.TAB_PANEL_ID);

    if (panel != null) {
        if (panel instanceof StudyFilteredReportPanel) {
            // selected tab is configuration tab
            ((StudyFilteredReportPanel) panel).onFilter(target);
        } else if (panel instanceof ConfigurationReportPanel) {
            // selected tab is method tab
            ((ConfigurationReportPanel) panel).onFilter(target, trigger);
        }/* w  ww .ja v  a2  s. com*/
    }
}

From source file:org.dcm4chee.web.common.base.ExternalWebApplications.java

License:LGPL

public List<ExternalWebApp> getExternalWebAppPanels() {
    File cfgPath = FileUtils.resolve(new File(BaseCfgDelegate.getInstance().getWebConfigPath()));
    File cfgFile = new File(cfgPath, CFG_FILE_NAME);
    if (cfgFile.isFile()) {
        BufferedReader br = null;
        try {//ww  w .  j a v  a 2 s  .  c  om
            br = new BufferedReader(new FileReader(cfgFile));
            String line;
            String appTitle, grpTitle, url;
            int pos1, pos2, height;
            HashMap<String, ExternalWebAppGroupPanel> grpPanels = new HashMap<String, ExternalWebAppGroupPanel>();
            Model<String> titleModel;
            while ((line = br.readLine()) != null) {
                if (line.length() == 0)
                    continue;
                if (line.charAt(0) != '#') {
                    pos1 = line.indexOf('=');
                    if (pos1 == -1) {
                        log.warn(CFG_FILE_NAME + ": Wrong formatted line ignored! Reason: '=' missing! line:"
                                + line);
                        continue;
                    }
                    appTitle = line.substring(0, pos1++);
                    pos2 = line.indexOf('|', pos1);
                    if (pos2 == -1) {
                        log.warn(CFG_FILE_NAME + ": Wrong formatted line ignored! Reason: '|' missing! line:"
                                + line);
                        continue;
                    }
                    grpTitle = line.substring(pos1, pos2++);
                    pos1 = pos2;
                    pos2 = line.indexOf('|', pos1);
                    if (pos2 == -1) {
                        log.warn(CFG_FILE_NAME
                                + ": Wrong formatted line ignored! Reason: second '|' missing! line:" + line);
                        continue;
                    }
                    if (!hasRole(line.substring(pos1, pos2++)))
                        continue;
                    pos1 = pos2;
                    pos2 = line.indexOf('|', pos1);
                    if (pos2 == -1) {
                        log.warn(CFG_FILE_NAME
                                + ": Wrong formatted line ignored! Reason: third '|' missing! line:" + line);
                        continue;
                    }
                    try {
                        height = Integer.parseInt(line.substring(pos1, pos2++));
                    } catch (Exception x) {
                        log.warn(CFG_FILE_NAME
                                + ": Wrong formatted line ignored! Reason: height not an integer! line:"
                                + line);
                        continue;
                    }
                    url = line.substring(pos2);
                    titleModel = new Model<String>(appTitle);
                    if (grpTitle.length() < 1) {
                        this.applications.add(
                                new ExternalWebAppPanel(TabbedPanel.TAB_PANEL_ID, url, titleModel, height));
                    } else {
                        ExternalWebAppGroupPanel grpPanel = grpPanels.get(grpTitle);
                        if (grpPanel == null) {
                            grpPanel = new ExternalWebAppGroupPanel(TabbedPanel.TAB_PANEL_ID,
                                    new Model<String>(grpTitle));
                            grpPanels.put(grpTitle, grpPanel);
                            this.applications.add(grpPanel);
                        }
                        grpPanel.addModule(
                                new ExternalWebAppPanel(TabbedPanel.TAB_PANEL_ID, url, titleModel, height),
                                titleModel);
                    }
                }
            }
        } catch (Exception x) {
            log.error("Failed to read config file:" + cfgFile, x);
        }
    }
    log.debug("ExternalWebAppPanels:{}", applications);
    return applications;
}