use of com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel in project midpoint by Evolveum.
the class ResourceContentPanel method initButton.
private void initButton(String id, String label, String icon, final String category, final List<TaskType> tasks) {
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.showExisting"), new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
runTask(tasks, target);
}
});
items.add(item);
item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.newTask"), new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
newTaskPerformed(category, target);
}
});
items.add(item);
DropdownButtonPanel button = new DropdownButtonPanel(id, new DropdownButtonDto(String.valueOf(tasks.size()), icon, label, items));
add(button);
}
use of com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel in project midpoint by Evolveum.
the class InlineMenuHeaderColumn method getHeader.
@Override
public Component getHeader(String componentId) {
DropdownButtonDto model = new DropdownButtonDto(null, null, null, menuItems);
DropdownButtonPanel inlineMenu = new DropdownButtonPanel(componentId, model) {
private static final long serialVersionUID = 1L;
@Override
protected String getSpecialButtonClass() {
return "btn-xs btn-default";
}
};
inlineMenu.setOutputMarkupPlaceholderTag(true);
inlineMenu.setOutputMarkupId(true);
return inlineMenu;
}
use of com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel in project midpoint by Evolveum.
the class ExecuteChangeOptionsPanel method createTracingOptionsPanel.
private void createTracingOptionsPanel() {
List<InlineMenuItem> items = new ArrayList<>();
items.add(new InlineMenuItem(createStringResource("Tracing")) {
@Override
public InlineMenuItemAction initAction() {
return null;
}
});
DropdownButtonDto model = new DropdownButtonDto(null, GuiStyleConstants.CLASS_TRACING_BUTTON_ICON, "Tracing", items);
DropdownButtonPanel dropdownButtonPanel = new DropdownButtonPanel(ID_TRACING, model) {
@Override
protected void populateMenuItem(String componentId, ListItem<InlineMenuItem> menuItem) {
menuItem.add(createTracingRadioChoicesFragment(componentId));
}
@Override
protected String getSpecialButtonClass() {
return "btn-sm btn-default btn-margin-right";
}
@Override
protected String getSpecialDropdownMenuClass() {
return "execute-options radio";
}
@Override
protected String getSpecialLabelClass() {
return "execute-options-label";
}
};
add(dropdownButtonPanel);
dropdownButtonPanel.setOutputMarkupId(true);
dropdownButtonPanel.add(new VisibleBehaviour(this::isTracingEnabled));
}
use of com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel in project midpoint by Evolveum.
the class MenuMultiButtonPanel method initLayout.
private void initLayout() {
DropdownButtonPanel inlineMenu = new DropdownButtonPanel(ID_INLINE_MENU_PANEL, new DropdownButtonDto(null, null, null, menuItemsModel.getObject())) {
private static final long serialVersionUID = 1L;
@Override
protected String getSpecialButtonClass() {
return "btn-xs btn-default";
}
@Override
protected void onBeforeClickMenuItem(AjaxRequestTarget target, InlineMenuItemAction action, IModel<InlineMenuItem> item) {
MenuMultiButtonPanel.this.onBeforeClickMenuItem(target, action, item);
}
};
add(inlineMenu);
inlineMenu.add(new VisibleBehaviour(() -> {
List<InlineMenuItem> menuItems = menuItemsModel.getObject();
for (InlineMenuItem menuItem : menuItems) {
if (!(menuItem instanceof ButtonInlineMenuItem)) {
return true;
}
}
return false;
}));
}
use of com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel in project midpoint by Evolveum.
the class DelegatedToMePanel method initLayout.
@Override
protected void initLayout() {
final WebMarkupContainer assignments = new WebMarkupContainer(ID_ASSIGNMENTS);
assignments.setOutputMarkupId(true);
add(assignments);
Label label = new Label(ID_HEADER, getLabel());
assignments.add(label);
DropdownButtonDto model = new DropdownButtonDto(null, null, null, createAssignmentMenu());
DropdownButtonPanel assignmentMenu = new DropdownButtonPanel(ID_MENU, model) {
private static final long serialVersionUID = 1L;
@Override
protected String getSpecialButtonClass() {
return "btn-xs btn-default";
}
};
assignmentMenu.setVisible(getAssignmentMenuVisibility());
assignments.add(assignmentMenu);
ListView<AssignmentEditorDto> list = new ListView<AssignmentEditorDto>(ID_LIST, getDelegatedToMeModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<AssignmentEditorDto> item) {
DelegatedToMePanel.this.populateAssignmentDetailsPanel(item);
}
};
list.setOutputMarkupId(true);
assignments.add(list);
AjaxCheckBox checkAll = new AjaxCheckBox(ID_CHECK_ALL, new Model()) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
List<AssignmentEditorDto> assignmentsList = getDelegatedToMeModelObject();
for (AssignmentEditorDto dto : assignmentsList) {
dto.setSelected(this.getModelObject());
}
target.add(assignments);
}
};
checkAll.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
int count = 0;
for (AssignmentEditorDto dto : getDelegatedToMeModelObject()) {
if (dto.isSimpleView()) {
count++;
}
}
return count != getDelegatedToMeModelObject().size();
}
});
assignments.add(checkAll);
}
Aggregations