use of com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem in project midpoint by Evolveum.
the class PageValuePolicies method createInlineMenu.
private List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(new ButtonInlineMenuItem(createStringResource("pageValuePolicies.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_DELETE_MENU_ITEM);
}
@Override
public InlineMenuItemAction initAction() {
return null;
}
});
return menu;
}
use of com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem in project midpoint by Evolveum.
the class AbstractAssignmentTypePanel method getAssignmentMenuActions.
private List<InlineMenuItem> getAssignmentMenuActions() {
List<InlineMenuItem> menuItems = new ArrayList<>();
ButtonInlineMenuItem unassignMenuItem = createUnassignAction();
if (unassignMenuItem != null) {
menuItems.add(unassignMenuItem);
}
menuItems.add(new ButtonInlineMenuItem(createStringResource("PageBase.button.edit")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_EDIT_MENU_ITEM);
}
@Override
public InlineMenuItemAction initAction() {
return AbstractAssignmentTypePanel.this.createEditColumnAction();
}
});
ButtonInlineMenuItem viewTargetObjectMenuItem = createViewTargetObjectAction();
menuItems.add(viewTargetObjectMenuItem);
return menuItems;
}
use of com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem in project midpoint by Evolveum.
the class AbstractAssignmentTypePanel method createViewTargetObjectAction.
private ButtonInlineMenuItem createViewTargetObjectAction() {
ButtonInlineMenuItem menu = new ButtonInlineMenuItem(createStringResource("AssignmentPanel.viewTargetObject")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_NAVIGATE_ARROW);
}
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<PrismContainerValueWrapper<AssignmentType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
targetObjectDetailsPerformed(target, getRowModel().getObject());
}
};
}
@Override
public boolean isHeaderMenuItem() {
return false;
}
};
menu.setVisibilityChecker(isViewTargetObjectMenuVisible());
return menu;
}
use of com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem 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.web.component.menu.cog.ButtonInlineMenuItem in project midpoint by Evolveum.
the class FocusProjectionsTabPanel method createShadowMenu.
private List<InlineMenuItem> createShadowMenu() {
List<InlineMenuItem> items = new ArrayList<>();
PrismObjectDefinition<F> def = getObjectWrapper().getObject().getDefinition();
PrismReferenceDefinition ref = def.findReferenceDefinition(UserType.F_LINK_REF);
InlineMenuItem item;
PrismPropertyDefinition<ActivationStatusType> administrativeStatus = def.findPropertyDefinition(SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS);
if (administrativeStatus.canRead() && administrativeStatus.canModify()) {
item = new ButtonInlineMenuItem(createStringResource("pageAdminFocus.button.enable")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
updateShadowActivation(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()), true);
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder("fa fa-check");
}
};
items.add(item);
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.disable")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
updateShadowActivation(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()), false);
}
};
}
};
items.add(item);
}
if (ref.canRead() && ref.canAdd()) {
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.unlink")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
unlinkProjectionPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
}
PrismPropertyDefinition<LockoutStatusType> locakoutStatus = def.findPropertyDefinition(SchemaConstants.PATH_ACTIVATION_LOCKOUT_STATUS);
if (locakoutStatus.canRead() && locakoutStatus.canModify()) {
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.unlock")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
unlockShadowPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
}
if (administrativeStatus.canRead() && administrativeStatus.canModify()) {
// items.add(new InlineMenuItem());
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteProjectionPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
}
item = new ButtonInlineMenuItem(createStringResource("PageBase.button.edit")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_EDIT_MENU_ITEM);
}
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getMultivalueContainerListPanel().editItemPerformed(target, getRowModel(), getMultivalueContainerListPanel().getSelectedItems());
target.add(getFeedbackPanel());
}
};
}
};
items.add(item);
return items;
}
Aggregations