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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations