Search in sources :

Example 1 with MultiCompositedButtonPanel

use of com.evolveum.midpoint.web.component.MultiCompositedButtonPanel in project midpoint by Evolveum.

the class AssignmentPopup method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    Form form = new Form(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    MultiCompositedButtonPanel newObjectIcon = new MultiCompositedButtonPanel(ID_COMPOSITED_BUTTONS, createNewButtonDescriptionModel()) {

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            Form form = (Form) AssignmentPopup.this.get(ID_FORM);
            AssignmentPopup.this.getModelObject().setSelectionVisible(false);
            addOrReplaceTabPanels(form, relationSpec);
            target.add(form);
        }
    };
    form.add(newObjectIcon);
    newObjectIcon.add(new VisibleBehaviour(() -> getModelObject() != null && getModelObject().isSelectionVisible()));
    addOrReplaceTabPanels(form, null);
    MessagePanel warningMessage = new MessagePanel(ID_WARNING_MESSAGE, MessagePanel.MessagePanelType.WARN, getWarningMessageModel());
    warningMessage.setOutputMarkupId(true);
    warningMessage.add(new VisibleBehaviour(() -> getWarningMessageModel() != null));
    add(warningMessage);
    form.add(createCancelButton());
    form.add(createAddButton());
    form.add(createBackButton());
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) Form(org.apache.wicket.markup.html.form.Form) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) MessagePanel(com.evolveum.midpoint.gui.api.component.result.MessagePanel) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Example 2 with MultiCompositedButtonPanel

use of com.evolveum.midpoint.web.component.MultiCompositedButtonPanel in project midpoint by Evolveum.

the class NewObjectCreationPopup method initLayout.

private void initLayout() {
    MultiCompositedButtonPanel buttonPanel = new MultiCompositedButtonPanel(ID_NEW_OBJECT_SELECTION_BUTTON_PANEL, getModel()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            NewObjectCreationPopup.this.buttonClickPerformed(target, relationSpec, collectionViews, page);
        }
    };
    buttonPanel.setOutputMarkupId(true);
    add(buttonPanel);
    AjaxButton cancel = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("PageBase.button.cancel")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            cancelPerformed(target);
        }
    };
    add(cancel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Example 3 with MultiCompositedButtonPanel

use of com.evolveum.midpoint.web.component.MultiCompositedButtonPanel in project midpoint by Evolveum.

the class PageCreateFromTemplate method initLayout.

private void initLayout() {
    MultiCompositedButtonPanel buttonsPanel = new MultiCompositedButtonPanel(ID_TEMPLATE, new PropertyModel<>(loadButtonDescriptions(), MultiFunctinalButtonDto.F_ADDITIONAL_BUTTONS)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            List<ObjectReferenceType> archetypeRef = ObjectCollectionViewUtil.getArchetypeReferencesList(collectionViews);
            try {
                WebComponentUtil.initNewObjectWithReference(getPageBase(), getType(), archetypeRef);
            } catch (SchemaException ex) {
                getPageBase().getFeedbackMessages().error(PageCreateFromTemplate.this, ex.getUserFriendlyMessage());
                target.add(getPageBase().getFeedbackPanel());
            }
        }
    };
    add(buttonsPanel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Example 4 with MultiCompositedButtonPanel

use of com.evolveum.midpoint.web.component.MultiCompositedButtonPanel in project midpoint by Evolveum.

the class CreateTemplatePanel method initLayout.

private void initLayout() {
    MultiCompositedButtonPanel buttonsPanel = new MultiCompositedButtonPanel(ID_TEMPLATE, new PropertyModel<>(loadButtonDescriptions(), MultiFunctinalButtonDto.F_ADDITIONAL_BUTTONS)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            onTemplateChosePerformed(collectionViews, target);
        }
    };
    add(buttonsPanel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Example 5 with MultiCompositedButtonPanel

use of com.evolveum.midpoint.web.component.MultiCompositedButtonPanel in project midpoint by Evolveum.

the class PageSystemConfiguration method initLayout.

private void initLayout() {
    IModel<List<CompositedIconButtonDto>> model = Model.ofList(Arrays.asList(createCompositedButton("fa fa-wrench", PageSystemBasic.class), createCompositedButton("fa fa-camera", PageSystemPolicies.class), createCompositedButton("fa fa-envelope", PageSystemNotification.class), createCompositedButton("fa fa-file-text", PageSystemLogging.class), createCompositedButton("fa fa-camera", PageProfiling.class), createCompositedButton("fa fa-camera", PageSystemAdminGui.class), createCompositedButton("fa fa-camera", PageSystemWorkflow.class), createCompositedButton("fa fa-camera", PageRoleManagement.class), createCompositedButton("fa fa-camera", PageSystemInternals.class), createCompositedButton("fa fa-camera", PageAccessCertification.class)));
    MultiCompositedButtonPanel panel = new MultiCompositedButtonPanel(ID_CONTAINER, model) {

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            navigateToNext(page);
        }
    };
    panel.add(AttributeModifier.append("class", " row"));
    add(panel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) List(java.util.List) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Aggregations

AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)5 CompiledObjectCollectionView (com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView)5 MultiCompositedButtonPanel (com.evolveum.midpoint.web.component.MultiCompositedButtonPanel)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 WebPage (org.apache.wicket.markup.html.WebPage)5 MessagePanel (com.evolveum.midpoint.gui.api.component.result.MessagePanel)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)1 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 List (java.util.List)1 Form (org.apache.wicket.markup.html.form.Form)1