use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class ResourceContentPanel method initButton.
private void initButton(String id, String label, String icon, String archetypeOid) {
ObjectQuery existingTasksQuery = getExistingTasksQuery(archetypeOid);
OperationResult result = new OperationResult(OPERATION_SEARCH_TASKS_FOR_RESOURCE);
List<PrismObject<TaskType>> tasksList = WebModelServiceUtils.searchObjects(TaskType.class, existingTasksQuery, result, getPageBase());
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.showExisting")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<TaskType> filteredByKindIntentTasks = getTasksForKind(tasksList);
redirectToTasksListPage(createInTaskOidQuery(filteredByKindIntentTasks), archetypeOid);
}
};
}
};
items.add(item);
item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.newTask")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
newTaskPerformed(archetypeOid);
}
};
}
};
items.add(item);
DropdownButtonPanel button = new DropdownButtonPanel(id, new DropdownButtonDto(String.valueOf(tasksList.size()), icon, label, items)) {
@Override
protected String getSpecialDropdownMenuClass() {
return "pull-left";
}
};
add(button);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method createRowActions.
protected List<InlineMenuItem> createRowActions() {
List<InlineMenuItem> menu = new ArrayList<>();
createAssignMemberRowAction(menu);
createUnassignMemberRowAction(menu);
createRecomputeMemberRowAction(menu);
if (isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_CREATE)) {
menu.add(new InlineMenuItem(createStringResource("abstractRoleMemberPanel.menu.create")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(AbstractRoleMemberPanel.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
createFocusMemberPerformed(target);
}
};
}
});
}
if (isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_DELETE)) {
menu.add(new InlineMenuItem(createStringResource("abstractRoleMemberPanel.menu.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(AbstractRoleMemberPanel.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteMembersPerformed(target);
}
};
}
});
}
return menu;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class PageConnectorHosts method initLayout.
protected void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ConnectorHostType> table = new MainObjectListPanel<ConnectorHostType>(ID_TABLE, ConnectorHostType.class, getQueryOptions()) {
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, ConnectorHostType host) {
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_RESOURCES_CONNECTOR_HOSTS;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return createRowActions();
}
@Override
protected List<IColumn<SelectableBean<ConnectorHostType>, String>> createDefaultColumns() {
return PageConnectorHosts.this.initColumns();
}
@Override
protected boolean isCreateNewObjectEnabled() {
return false;
}
@Override
protected boolean isObjectDetailsEnabled(IModel<SelectableBean<ConnectorHostType>> rowModel) {
return false;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class PageConnectorHosts method createRowActions.
private List<InlineMenuItem> createRowActions() {
List<InlineMenuItem> headerMenuItems = new ArrayList<>();
headerMenuItems.add(new InlineMenuItem(createStringResource("PageBase.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageConnectorHosts.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteHostPerformed(target);
}
};
}
});
headerMenuItems.add(new InlineMenuItem(createStringResource("pageResources.button.discoveryRemote")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageConnectorHosts.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
discoveryRemotePerformed(target);
}
};
}
});
return headerMenuItems;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class InternalsLoggedInUsersPanel method initInlineMenu.
private List<InlineMenuItem> initInlineMenu() {
List<InlineMenuItem> menuItems = new ArrayList<>();
menuItems.add(new ButtonInlineMenuItem(createStringResource("InternalsLoggedInUsers.refresh")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_ICON_SIGN_OUT);
}
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBean<F>>() {
@Override
public void onClick(AjaxRequestTarget target) {
if (getRowModel() == null) {
terminateSessions(target, null);
} else {
SelectableBean<F> rowDto = getRowModel().getObject();
terminateSessions(target, rowDto.getValue());
}
}
};
}
@Override
public boolean isHeaderMenuItem() {
return true;
}
});
return menuItems;
}
Aggregations