Search in sources :

Example 56 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project syncope by apache.

the class ReconciliationWidget method buildExecFragment.

private Fragment buildExecFragment() {
    Fragment execFragment = new Fragment("reportResult", "execFragment", this);
    execFragment.setOutputMarkupId(true);
    Pair<List<ProgressBean>, ReconciliationReport> execResult;
    try {
        execResult = parseReconciliationReportExec();
    } catch (Exception e) {
        LOG.error("Could not parse the reconciliation report result", e);
        execResult = Pair.of(Collections.<ProgressBean>emptyList(), new ReconciliationReport(new Date()));
    }
    final List<ProgressBean> progressBeans = execResult.getLeft();
    final ReconciliationReport report = execResult.getRight();
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(new ResourceModel("summary")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new ProgressesPanel(panelId, report.getRun(), progressBeans);
        }
    });
    tabs.add(new AbstractTab(Model.of(AnyTypeKind.USER.name())) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new AnysReconciliationPanel(panelId, report.getUsers(), pageRef);
        }
    });
    tabs.add(new AbstractTab(Model.of(AnyTypeKind.GROUP.name())) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new AnysReconciliationPanel(panelId, report.getGroups(), pageRef);
        }
    });
    for (final Anys anys : report.getAnyObjects()) {
        tabs.add(new AbstractTab(Model.of(anys.getAnyType())) {

            private static final long serialVersionUID = -6815067322125799251L;

            @Override
            public Panel getPanel(final String panelId) {
                return new AnysReconciliationPanel(panelId, anys, pageRef);
            }
        });
    }
    execFragment.add(new AjaxBootstrapTabbedPanel<>("execResult", tabs));
    return execFragment;
}
Also used : ArrayList(java.util.ArrayList) Fragment(org.apache.wicket.markup.html.panel.Fragment) IOException(java.io.IOException) Date(java.util.Date) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) AjaxBootstrapTabbedPanel(de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel) ActionPanel(org.apache.syncope.client.console.wicket.markup.html.form.ActionPanel) DirectoryPanel(org.apache.syncope.client.console.panels.DirectoryPanel) Panel(org.apache.wicket.markup.html.panel.Panel) WizardMgtPanel(org.apache.syncope.client.console.wizards.WizardMgtPanel) ReconciliationReport(org.apache.syncope.client.console.widgets.reconciliation.ReconciliationReport) Anys(org.apache.syncope.client.console.widgets.reconciliation.Anys) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) ResourceModel(org.apache.wicket.model.ResourceModel) List(java.util.List) ArrayList(java.util.ArrayList)

Example 57 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project syncope by apache.

the class JobWidget method buildTabList.

private List<ITab> buildTabList(final PageReference pageRef) {
    final List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(new ResourceModel("available")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            availableJobsPanel = new AvailableJobsPanel(panelId, pageRef);
            availableJobsPanel.setOutputMarkupId(true);
            return availableJobsPanel;
        }
    });
    tabs.add(new AbstractTab(new ResourceModel("recent")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            recentExecPanel = new RecentExecPanel(panelId, pageRef);
            recentExecPanel.setOutputMarkupId(true);
            return recentExecPanel;
        }
    });
    return tabs;
}
Also used : ReportletDirectoryPanel(org.apache.syncope.client.console.reports.ReportletDirectoryPanel) AjaxBootstrapTabbedPanel(de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel) ActionLinksTogglePanel(org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksTogglePanel) DirectoryPanel(org.apache.syncope.client.console.panels.DirectoryPanel) ActionsPanel(org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel) Panel(org.apache.wicket.markup.html.panel.Panel) WizardMgtPanel(org.apache.syncope.client.console.wizards.WizardMgtPanel) ArrayList(java.util.ArrayList) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) ResourceModel(org.apache.wicket.model.ResourceModel) StringResourceModel(org.apache.wicket.model.StringResourceModel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab)

Example 58 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project wicket by apache.

the class SimplePageTest method renderHomePage_2a.

/**
 * @throws Exception
 */
@Test
public void renderHomePage_2a() throws Exception {
    // Render the component without having rendered the page previously
    SimplePage page = new SimplePage();
    tester.startPage(page);
    String document = tester.getLastResponseAsString();
    Label label = (Label) page.get("myLabel");
    assertNotNull(label);
    assertTrue(document.contains("<span wicket:id=\"myLabel\">Test Label</span>"));
    Panel panel = (Panel) page.get("myPanel");
    assertNotNull(panel);
    assertTrue(document.contains("<wicket:panel>Inside the panel<span wicket:id=\"label\">mein Label</span></wicket:panel>"));
    label = (Label) page.get("myPanel:label");
    assertNotNull(label);
    assertTrue(document.contains("<span wicket:id=\"label\">mein Label</span>"));
    Border border = (Border) page.get("myBorder");
    assertNotNull(border);
    assertTrue(document.contains("<wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border>"));
    border = (Border) page.get("myBorder2");
    assertNotNull(border);
    assertTrue(document.contains("<span wicket:id=\"myBorder2\" testAttr=\"myValue\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>"));
    // do the same test twice. Igor reported a problem with that, so we have to test it.
    border = (Border) page.get("myBorder2");
    assertNotNull(border);
    assertTrue(document.contains("<span wicket:id=\"myBorder2\" testAttr=\"myValue\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>"));
    WebMarkupContainer container = (WebMarkupContainer) page.get("test");
    assertNotNull(container);
    assertTrue(document.contains("body<span wicket:id=\"myLabel2\">Test Label2</span>"));
    label = (Label) page.get("test:myLabel2");
    assertNotNull(label);
    assertTrue(document.contains("<span wicket:id=\"myLabel2\">Test Label2</span>"));
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) Border(org.apache.wicket.markup.html.border.Border) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Test(org.junit.Test)

Example 59 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project wiquery by WiQuery.

the class SelectableBehaviorTestCase method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    selectableBehavior = new SelectableBehavior();
    Panel panel = new DivTestPanel("panelId");
    WebMarkupContainer component = new WebMarkupContainer("anId");
    component.setMarkupId("anId");
    component.add(selectableBehavior);
    panel.add(component);
    tester.startComponentInPage(panel);
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Before(org.junit.Before)

Example 60 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project wiquery by WiQuery.

the class DraggableBehaviorTestCase method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    draggableBehavior = new DraggableBehavior();
    Panel panel = new DivTestPanel("panelId");
    WebMarkupContainer component = new WebMarkupContainer("anId");
    component.setMarkupId("anId");
    component.add(draggableBehavior);
    panel.add(component);
    tester.startComponentInPage(panel);
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) DivTestPanel(org.odlabs.wiquery.ui.DivTestPanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Before(org.junit.Before)

Aggregations

Panel (org.apache.wicket.markup.html.panel.Panel)76 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)27 ArrayList (java.util.ArrayList)21 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)18 BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)16 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)16 Before (org.junit.Before)16 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)15 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)13 AjaxBootstrapTabbedPanel (de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel)12 ResourceModel (org.apache.wicket.model.ResourceModel)11 DivTestPanel (org.odlabs.wiquery.ui.DivTestPanel)11 ItemPanelSettingsBuilder (com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettingsBuilder)10 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)10 List (java.util.List)9 Test (org.junit.Test)9 IModel (org.apache.wicket.model.IModel)8 Model (org.apache.wicket.model.Model)6 ActionsPanel (org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel)5 Label (org.apache.wicket.markup.html.basic.Label)5