Search in sources :

Example 26 with ResourceModel

use of org.apache.wicket.model.ResourceModel in project sandbox by irof.

the class ResourcePage method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    add(new Label("resource.static", new ResourceModel("simple")));
    Object[] args = { "Dynamic", "Args" };
    add(new Label("resource.dynamic1", new StringResourceModel("dynamic1", Model.of(), args)));
    Map<String, String> valueMap = new HashMap<>();
    valueMap.put("arg1", "Argument1");
    valueMap.put("arg3", "Argument3");
    add(new Label("resource.dynamic2", new StringResourceModel("dynamic2", Model.ofMap(valueMap))));
    add(new Label("markup.label.pattern1", new ResourceModel("markup.pattern1")));
    add(new Label("markup.label.pattern2", new ResourceModel("markup.pattern2")));
    add(new Label("markup.label.pattern3", new ResourceModel("markup.pattern3")));
    add(new Label("markup.label.pattern1.unescape", new ResourceModel("markup.pattern1")).setEscapeModelStrings(false));
    add(new Label("markup.label.pattern2.unescape", new ResourceModel("markup.pattern2")).setEscapeModelStrings(false));
    add(new Label("markup.label.pattern3.unescape", new ResourceModel("markup.pattern3")).setEscapeModelStrings(false));
}
Also used : HashMap(java.util.HashMap) Label(org.apache.wicket.markup.html.basic.Label) StringResourceModel(org.apache.wicket.model.StringResourceModel) ResourceModel(org.apache.wicket.model.ResourceModel) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Example 27 with ResourceModel

use of org.apache.wicket.model.ResourceModel in project syncope by apache.

the class SAML2SP method buildTabList.

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

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new SAML2IdPsDirectoryPanel(panelId, getPageReference());
        }
    });
    tabs.add(new AbstractTab(new ResourceModel("sp")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new SAML2SPPanel(panelId);
        }
    });
    return tabs;
}
Also used : AjaxBootstrapTabbedPanel(de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel) SAML2SPPanel(org.apache.syncope.client.console.panels.SAML2SPPanel) Panel(org.apache.wicket.markup.html.panel.Panel) SAML2IdPsDirectoryPanel(org.apache.syncope.client.console.panels.SAML2IdPsDirectoryPanel) ArrayList(java.util.ArrayList) SAML2SPPanel(org.apache.syncope.client.console.panels.SAML2SPPanel) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) ResourceModel(org.apache.wicket.model.ResourceModel) SAML2IdPsDirectoryPanel(org.apache.syncope.client.console.panels.SAML2IdPsDirectoryPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab)

Example 28 with ResourceModel

use of org.apache.wicket.model.ResourceModel in project syncope by apache.

the class AnyObjectDirectoryPanel method getHeader.

@Override
public ActionsPanel<Serializable> getHeader(final String componentId) {
    final ActionsPanel<Serializable> panel = super.getHeader(componentId);
    panel.add(new ActionLink<Serializable>() {

        private static final long serialVersionUID = -7978723352517770644L;

        @Override
        public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
            target.add(displayAttributeModal.setContent(new AnyObjectDisplayAttributesModalPanel<>(displayAttributeModal, page.getPageReference(), pSchemaNames, dSchemaNames, type)));
            displayAttributeModal.addSubmitButton();
            displayAttributeModal.header(new ResourceModel("any.attr.display"));
            displayAttributeModal.show(true);
        }

        @Override
        protected boolean statusCondition(final Serializable modelObject) {
            return wizardInModal;
        }
    }, ActionType.CHANGE_VIEW, AnyEntitlement.READ.getFor(type)).hideLabel();
    return panel;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Serializable(java.io.Serializable) StringResourceModel(org.apache.wicket.model.StringResourceModel) ResourceModel(org.apache.wicket.model.ResourceModel) ActionLink(org.apache.syncope.client.console.wicket.markup.html.form.ActionLink)

Example 29 with ResourceModel

use of org.apache.wicket.model.ResourceModel in project syncope by apache.

the class Notifications method buildTabList.

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

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new NotificationDirectoryPanel(panelId, getPageReference());
        }
    });
    tabs.add(new AbstractTab(new ResourceModel("notification.templates")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new MailTemplateDirectoryPanel(panelId, getPageReference());
        }
    });
    return tabs;
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) NotificationDirectoryPanel(org.apache.syncope.client.console.notifications.NotificationDirectoryPanel) AjaxBootstrapTabbedPanel(de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel) MailTemplateDirectoryPanel(org.apache.syncope.client.console.notifications.MailTemplateDirectoryPanel) MailTemplateDirectoryPanel(org.apache.syncope.client.console.notifications.MailTemplateDirectoryPanel) ArrayList(java.util.ArrayList) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) ResourceModel(org.apache.wicket.model.ResourceModel) NotificationDirectoryPanel(org.apache.syncope.client.console.notifications.NotificationDirectoryPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab)

Example 30 with ResourceModel

use of org.apache.wicket.model.ResourceModel in project syncope by apache.

the class Dashboard method buildTabList.

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

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new DashboardOverviewPanel(panelId);
        }
    });
    tabs.add(new AbstractTab(new ResourceModel("accessTokens")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new DashboardAccessTokensPanel(panelId, getPageReference());
        }
    });
    tabs.add(new AbstractTab(new ResourceModel("control")) {

        private static final long serialVersionUID = -6815067322125799251L;

        @Override
        public Panel getPanel(final String panelId) {
            return new DashboardControlPanel(panelId, getPageReference());
        }
    });
    ClassPathScanImplementationLookup classPathScanImplementationLookup = (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
    final List<Class<? extends BaseExtWidget>> extWidgetClasses = classPathScanImplementationLookup.getExtWidgetClasses();
    if (!extWidgetClasses.isEmpty()) {
        tabs.add(new AbstractTab(new ResourceModel("extensions")) {

            private static final long serialVersionUID = -6815067322125799251L;

            @Override
            public Panel getPanel(final String panelId) {
                return new DashboardExtensionsPanel(panelId, extWidgetClasses, getPageReference());
            }
        });
    }
    return tabs;
}
Also used : DashboardAccessTokensPanel(org.apache.syncope.client.console.panels.DashboardAccessTokensPanel) ArrayList(java.util.ArrayList) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) DashboardExtensionsPanel(org.apache.syncope.client.console.panels.DashboardExtensionsPanel) DashboardExtensionsPanel(org.apache.syncope.client.console.panels.DashboardExtensionsPanel) AjaxBootstrapTabbedPanel(de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel) Panel(org.apache.wicket.markup.html.panel.Panel) DashboardOverviewPanel(org.apache.syncope.client.console.panels.DashboardOverviewPanel) DashboardAccessTokensPanel(org.apache.syncope.client.console.panels.DashboardAccessTokensPanel) DashboardControlPanel(org.apache.syncope.client.console.panels.DashboardControlPanel) DashboardOverviewPanel(org.apache.syncope.client.console.panels.DashboardOverviewPanel) ClassPathScanImplementationLookup(org.apache.syncope.client.console.init.ClassPathScanImplementationLookup) DashboardControlPanel(org.apache.syncope.client.console.panels.DashboardControlPanel) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) ResourceModel(org.apache.wicket.model.ResourceModel) BaseExtWidget(org.apache.syncope.client.console.widgets.BaseExtWidget)

Aggregations

ResourceModel (org.apache.wicket.model.ResourceModel)48 ArrayList (java.util.ArrayList)20 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)19 Label (org.apache.wicket.markup.html.basic.Label)17 StringResourceModel (org.apache.wicket.model.StringResourceModel)15 Panel (org.apache.wicket.markup.html.panel.Panel)11 List (java.util.List)9 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)9 AjaxBootstrapTabbedPanel (de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel)8 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)8 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)8 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)6 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)5 Form (org.apache.wicket.markup.html.form.Form)5 Serializable (java.io.Serializable)4 HashMap (java.util.HashMap)4 WizardMgtPanel (org.apache.syncope.client.console.wizards.WizardMgtPanel)4 Fragment (org.apache.wicket.markup.html.panel.Fragment)4 NavbarButton (de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton)3 StringUtils (org.apache.commons.lang3.StringUtils)3