Search in sources :

Example 1 with TabbedPanel

use of com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel in project openmeetings by apache.

the class SettingsPanel method onInitialize.

@Override
protected void onInitialize() {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AjaxTab(Model.of(getString("1170"))) {

        private static final long serialVersionUID = 1L;

        UserProfilePanel profilePanel = null;

        @Override
        protected WebMarkupContainer getLazyPanel(String panelId) {
            if (profilePanel == null) {
                profilePanel = new UserProfilePanel(panelId, getUserId());
                profilePanel.setOutputMarkupId(true);
            }
            return profilePanel;
        }

        @Override
        public boolean load(AjaxRequestTarget target) {
            if (profilePanel != null) {
                profilePanel.setDefaultModelObject(userDao.get(getUserId()));
                target.add(profilePanel);
            }
            return super.load(target);
        }
    });
    tabs.add(new AjaxTab(Model.of(getString("1188"))) {

        private static final long serialVersionUID = 1L;

        @Override
        protected WebMarkupContainer getLazyPanel(String panelId) {
            return new MessagesContactsPanel(panelId);
        }
    });
    tabs.add(new AbstractTab(Model.of(getString("1171"))) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new ProfilePanel(panelId);
        }
    });
    tabs.add(new AbstractTab(Model.of(getString("1172"))) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new UserSearchPanel(panelId);
        }
    });
    tabs.add(new AbstractTab(Model.of(getString("1548"))) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new WidgetsPanel(panelId);
        }
    });
    add(new TabbedPanel("tabs", tabs, new Options("active", active)).setActiveTab(active));
    super.onInitialize();
}
Also used : Options(com.googlecode.wicket.jquery.core.Options) ArrayList(java.util.ArrayList) TabbedPanel(com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxTab(com.googlecode.wicket.jquery.ui.widget.tabs.AjaxTab) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab)

Example 2 with TabbedPanel

use of com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel in project openmeetings by apache.

the class TestMainAreas method testRoomsProfileMessages.

@Test
public void testRoomsProfileMessages() throws OmException {
    checkArea(AreaKeys.profile, TYPE_MESSAGES, SettingsPanel.class, p -> {
        TabbedPanel tp = (TabbedPanel) p.get("main-container:main:contents:child:tabs");
        // create behavior
        tester.executeBehavior((AbstractAjaxBehavior) tp.getBehaviorById(0));
        for (int i = 0; i <= tp.getLastTabIndex(); ++i) {
            tester.getRequest().setParameter("index", String.valueOf(i));
            // activate
            tester.executeBehavior((AbstractAjaxBehavior) tp.getBehaviorById(1));
        // add visibility check
        }
    }, regularUsername);
}
Also used : TabbedPanel(com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel) Test(org.junit.Test)

Aggregations

TabbedPanel (com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel)2 Options (com.googlecode.wicket.jquery.core.Options)1 AjaxTab (com.googlecode.wicket.jquery.ui.widget.tabs.AjaxTab)1 ArrayList (java.util.ArrayList)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)1 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 Test (org.junit.Test)1