use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class DropdownButtonPanel method initMenuItem.
private void initMenuItem(ListItem<InlineMenuItem> menuItem) {
final InlineMenuItem item = menuItem.getModelObject();
WebMarkupContainer menuItemBody = new MenuLinkPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
menuItemBody.setRenderBodyOnly(true);
menuItem.add(menuItemBody);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class DropdownButtonPanel method initLayout.
private void initLayout(DropdownButtonDto model) {
Label info = new Label(ID_INFO, model.getInfo());
add(info);
Label label = new Label(ID_LABEL, model.getLabel());
add(label);
WebMarkupContainer icon = new WebMarkupContainer(ID_ICON);
icon.add(AttributeModifier.append("class", model.getIcon()));
add(icon);
ListView<InlineMenuItem> li = new ListView<InlineMenuItem>(ID_MENU_ITEM, new Model((Serializable) model.getMenuItems())) {
@Override
protected void populateItem(ListItem<InlineMenuItem> item) {
initMenuItem(item);
}
};
add(li);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class TreeTablePanel method initLayout.
protected void initLayout() {
OrgTreePanel treePanel = new OrgTreePanel(ID_TREE_PANEL, getModel(), false) {
private static final long serialVersionUID = 1L;
@Override
protected void selectTreeItemPerformed(SelectableBean<OrgType> selected, AjaxRequestTarget target) {
TreeTablePanel.this.selectTreeItemPerformed(selected, target);
}
protected List<InlineMenuItem> createTreeMenu() {
return TreeTablePanel.this.createTreeMenu();
}
@Override
protected List<InlineMenuItem> createTreeChildrenMenu(OrgType org) {
return TreeTablePanel.this.createTreeChildrenMenu(org);
}
};
treePanel.setOutputMarkupId(true);
add(treePanel);
add(createMemberPanel(treePanel.getSelected().getValue()));
setOutputMarkupId(true);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class ResourceTasksPanel method initLayout.
private void initLayout(final ListModel<TaskType> tasks) {
final MainObjectListPanel<TaskType> tasksPanel = new MainObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, TableId.PAGE_RESOURCE_TASKS_PANEL, null, pageBase) {
private static final long serialVersionUID = 1L;
@Override
protected BaseSortableDataProvider<SelectableBean<TaskType>> initProvider() {
return new ListDataProvider2(pageBase, tasks);
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
// TODO Auto-generated method stub
return null;
}
@Override
public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
// TODO Auto-generated method stub
// super.objectDetailsPerformed(target, task);
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
getPageBase().navigateToNext(PageTaskEdit.class, parameters);
}
@Override
protected void newObjectPerformed(AjaxRequestTarget target) {
getPageBase().navigateToNext(PageTaskAdd.class);
}
@Override
protected List<IColumn<SelectableBean<TaskType>, String>> createColumns() {
return ColumnUtils.getDefaultTaskColumns();
}
};
// final ObjectListPanel<TaskType> tasksPanel = new ObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, pageBase){
//
// @Override
// protected BaseSortableDataProvider<SelectableBean<TaskType>> getProvider() {
// return new ListDataProvider2(pageBase, tasks);
// }
//
// @Override
// public boolean isEditable() {
// return ResourceTasksPanel.this.editable;
// }
//
// @Override
// public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
// // TODO Auto-generated method stub
// super.objectDetailsPerformed(target, task);
// PageParameters parameters = new PageParameters();
// parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
// setResponsePage(new PageTaskEdit(parameters));
// }
// };
// tasksPanel.setEditable(false);
tasksPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_TASK_BOX_CSS_CLASSES);
add(tasksPanel);
AjaxButton runNow = new AjaxButton(ID_RUN_NOW, pageBase.createStringResource("pageTaskEdit.button.runNow")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.runNowPerformed(pageBase.getTaskService(), oids);
pageBase.showResult(result);
} else {
noTasksSelected();
}
target.add(pageBase.getFeedbackPanel());
}
};
add(runNow);
AjaxButton resume = new AjaxButton(ID_RESUME, pageBase.createStringResource("pageTaskEdit.button.resume")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.resumePerformed(pageBase.getTaskService(), oids);
pageBase.showResult(result);
} else {
noTasksSelected();
}
target.add(pageBase.getFeedbackPanel());
}
};
add(resume);
AjaxButton suspend = new AjaxButton(ID_SUSPEND, pageBase.createStringResource("pageTaskEdit.button.suspend")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.suspendPerformed(pageBase.getTaskService(), oids);
pageBase.showResult(result);
} else {
noTasksSelected();
}
target.add(pageBase.getFeedbackPanel());
}
};
add(suspend);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class ResourceContentPanel method createHeaderMenuItems.
private List<InlineMenuItem> createHeaderMenuItems() {
List<InlineMenuItem> items = new ArrayList<InlineMenuItem>();
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.enableAccounts"), true, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
updateResourceObjectStatusPerformed(null, target, true);
}
}));
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.disableAccounts"), true, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
updateResourceObjectStatusPerformed(null, target, false);
}
}));
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.deleteAccounts"), true, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
deleteResourceObjectPerformed(null, target);
}
}));
items.add(new InlineMenuItem());
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.importAccounts"), true, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
importResourceObject(null, target);
}
}));
items.add(new InlineMenuItem());
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.removeOwners"), true, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
changeOwner(null, target, null, Operation.REMOVE);
}
}));
return items;
}
Aggregations