Search in sources :

Example 21 with AjaxIconButton

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

the class AbstractAssignmentTypePanel method createToolbarButtonsList.

@Override
protected List<Component> createToolbarButtonsList(String idButton) {
    List<Component> bar = new ArrayList<>();
    AjaxIconButton newObjectButton = new AjaxIconButton(idButton, new Model<>(GuiStyleConstants.EVO_ASSIGNMENT_ICON), createStringResource("MainObjectListPanel.newObject")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            newAssignmentClickPerformed(target);
        }
    };
    newObjectButton.add(AttributeAppender.append("class", "btn btn-default btn-sm"));
    bar.add(newObjectButton);
    newObjectButton.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return isNewObjectButtonVisible(getFocusObject());
        }

        @Override
        public boolean isEnabled() {
            return !isAssignmentsLimitReached();
        }
    });
    return bar;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ArrayList(java.util.ArrayList) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) Component(org.apache.wicket.Component)

Example 22 with AjaxIconButton

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

the class TaskOperationalButtonsPanel method createSuspendButton.

private void createSuspendButton(RepeatingView repeatingView) {
    AjaxIconButton suspend = new AjaxIconButton(repeatingView.newChildId(), Model.of(GuiStyleConstants.CLASS_SUSPEND_MENU_ITEM), createStringResource("pageTaskEdit.button.suspend")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            suspendPerformed(target, getPrismObject());
        }
    };
    suspend.showTitleAsLabel(true);
    suspend.add(new VisibleBehaviour(() -> WebComponentUtil.canSuspendTask(getObjectType(), getPageBase())));
    suspend.add(AttributeAppender.append("class", "btn-danger"));
    repeatingView.add(suspend);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton)

Example 23 with AjaxIconButton

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

the class TaskOperationalButtonsPanel method createResumePauseButton.

private void createResumePauseButton(RepeatingView repeatingView) {
    AjaxIconButton resumePauseRefreshing = new AjaxIconButton(repeatingView.newChildId(), (IModel<String>) this::createResumePauseButtonLabel, createStringResource("autoRefreshPanel.resumeRefreshing")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            refreshEnabled = !isRefreshEnabled();
            refresh(target);
        }
    };
    resumePauseRefreshing.add(AttributeAppender.append("class", "btn-margin-left"));
    repeatingView.add(resumePauseRefreshing);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IModel(org.apache.wicket.model.IModel) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton)

Example 24 with AjaxIconButton

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

the class TaskOperationalButtonsPanel method createRunNowButton.

private void createRunNowButton(RepeatingView repeatingView) {
    AjaxIconButton runNow = new AjaxIconButton(repeatingView.newChildId(), Model.of(GuiStyleConstants.CLASS_PLAY), createStringResource("pageTaskEdit.button.runNow")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            runNowPerformed(target, getPrismObject());
        }
    };
    runNow.showTitleAsLabel(true);
    runNow.add(AttributeAppender.append("class", "btn-success"));
    runNow.add(new VisibleBehaviour(() -> WebComponentUtil.canRunNowTask(getObjectType(), getPageBase())));
    repeatingView.add(runNow);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton)

Example 25 with AjaxIconButton

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

the class OperationalButtonsPanel method createDeleteButton.

private void createDeleteButton(RepeatingView repeatingView) {
    AjaxIconButton remove = new AjaxIconButton(repeatingView.newChildId(), Model.of(GuiStyleConstants.CLASS_ICON_REMOVE), getPageBase().createStringResource("OperationalButtonsPanel.delete")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            deletePerformed(ajaxRequestTarget);
        }
    };
    remove.add(new VisibleBehaviour(this::isDeleteButtonVisible));
    remove.showTitleAsLabel(true);
    remove.add(AttributeAppender.append("class", "btn btn-danger btn-sm"));
    repeatingView.add(remove);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton)

Aggregations

AjaxIconButton (com.evolveum.midpoint.web.component.AjaxIconButton)31 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)27 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)11 Component (org.apache.wicket.Component)9 IModel (org.apache.wicket.model.IModel)9 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)7 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)6 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)5 ArrayList (java.util.ArrayList)5 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)3 List (java.util.List)3 AbstractColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn)3 Item (org.apache.wicket.markup.repeater.Item)3 ChooseMemberPopup (com.evolveum.midpoint.gui.api.component.ChooseMemberPopup)2 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)2 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)2 CompiledObjectCollectionView (com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 Task (com.evolveum.midpoint.task.api.Task)2