use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class PageCertDefinitions method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<AccessCertificationDefinitionType> mainPanel = new MainObjectListPanel<AccessCertificationDefinitionType>(ID_TABLE, AccessCertificationDefinitionType.class, null) {
private static final long serialVersionUID = 1L;
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_CERT_DEFINITIONS_PANEL;
}
@Override
protected IColumn<SelectableBean<AccessCertificationDefinitionType>, String> createCheckboxColumn() {
return null;
}
@Override
public void objectDetailsPerformed(AjaxRequestTarget target, AccessCertificationDefinitionType service) {
PageCertDefinitions.this.detailsPerformed(target, service);
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return PageCertDefinitions.this.createInlineMenu();
}
@Override
protected void newObjectPerformed(AjaxRequestTarget target, AssignmentObjectRelation relation, CompiledObjectCollectionView collectionView) {
navigateToNext(PageCertDefinition.class);
}
};
mainPanel.setOutputMarkupId(true);
mainPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_CERT_DEF_BOX_CSS_CLASSES);
mainForm.add(mainPanel);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class PageCertDefinitions method createInlineMenu.
private List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(new ButtonInlineMenuItem(createStringResource("PageCertDefinitions.button.createCampaign")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBean<AccessCertificationDefinitionType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
AccessCertificationDefinitionType campaign = getRowModel().getObject().getValue();
createCampaignPerformed(target, campaign);
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_START_MENU_ITEM);
}
@Override
public boolean isHeaderMenuItem() {
return false;
}
});
menu.add(new ButtonInlineMenuItem(createStringResource("PageCertDefinitions.button.showCampaigns")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBeanImpl<AccessCertificationDefinitionType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
AccessCertificationDefinitionType campaign = getRowModel().getObject().getValue();
showCampaignsPerformed(target, campaign);
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder("fa fa-files-o");
}
@Override
public boolean isHeaderMenuItem() {
return false;
}
});
menu.add(new ButtonInlineMenuItem(createStringResource("PageCertDefinitions.button.deleteDefinition")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBeanImpl<AccessCertificationDefinitionType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
AccessCertificationDefinitionType campaign = getRowModel().getObject().getValue();
deleteConfirmation(target, campaign);
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_DELETE_MENU_ITEM);
}
@Override
public boolean isHeaderMenuItem() {
return false;
}
});
return menu;
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class ChildCasesTabPanel method initLayout.
private void initLayout() {
setOutputMarkupId(true);
MainObjectListPanel<CaseType> table = new MainObjectListPanel<CaseType>(ID_CHILD_CASES_PANEL, CaseType.class, Collections.emptyList()) {
@Override
protected List<IColumn<SelectableBean<CaseType>, String>> createDefaultColumns() {
List<IColumn<SelectableBean<CaseType>, String>> columns = new ArrayList<IColumn<SelectableBean<CaseType>, String>>();
IColumn column = new PropertyColumn(createStringResource("pageCases.table.description"), "value.description");
columns.add(column);
columns.add(ColumnUtils.createCaseActorsColumn(ChildCasesTabPanel.this.getPageBase()));
column = new PropertyColumn<SelectableBeanImpl<CaseType>, String>(createStringResource("pageCases.table.state"), CaseType.F_STATE.getLocalPart(), "value.state") {
@Override
public String getCssClass() {
return "col-sm-2 col-md-1";
}
};
columns.add(column);
column = new AbstractExportableColumn<SelectableBean<CaseType>, String>(createStringResource("pageCases.table.workitems")) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<CaseType>>> cellItem, String componentId, IModel<SelectableBean<CaseType>> model) {
cellItem.add(new Label(componentId, model.getObject().getValue() != null && model.getObject().getValue().getWorkItem() != null ? model.getObject().getValue().getWorkItem().size() : null));
}
@Override
public IModel<String> getDataModel(IModel<SelectableBean<CaseType>> rowModel) {
return Model.of(rowModel.getObject().getValue() != null && rowModel.getObject().getValue().getWorkItem() != null ? Integer.toString(rowModel.getObject().getValue().getWorkItem().size()) : "");
}
@Override
public String getCssClass() {
return "col-md-2 col-lg-1";
}
};
columns.add(column);
return (List) columns;
}
@Override
protected boolean isCreateNewObjectEnabled() {
return false;
}
@Override
protected ISelectableDataProvider<CaseType, SelectableBean<CaseType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getChildCasesQuery(), null);
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_CASE_CHILD_CASES_TAB;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return new ArrayList<>();
}
@Override
protected IColumn<SelectableBean<CaseType>, String> createCheckboxColumn() {
return null;
}
};
table.setOutputMarkupId(true);
add(table);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class ChooseArchetypeMemberPopup method createAssignmentTabs.
@Override
protected List<ITab> createAssignmentTabs(AssignmentObjectRelation relationSpec) {
// super.createAssignmentTabs();
List<ITab> tabs = new ArrayList<>();
tabs.add(new CountablePanelTab(getPageBase().createStringResource("chooseMemberForOrgPopup.otherTypesLabel"), new VisibleBehaviour(() -> getAvailableObjectTypes() != null)) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new MultiTypesMemberPopupTabPanel<O>(panelId, relationsConfig, getArchetypeRefList()) {
private static final long serialVersionUID = 1L;
@Override
protected void onSelectionPerformed(AjaxRequestTarget target, IModel<SelectableBean<O>> rowModel) {
tabLabelPanelUpdate(target);
}
@Override
protected ArchetypeType getAbstractRoleTypeObject() {
return ChooseArchetypeMemberPopup.this.getAssignmentTargetRefObject();
}
@Override
protected List<ObjectTypes> getSupportedTypesList() {
return getAvailableObjectTypes().stream().map(type -> ObjectTypes.getObjectTypeFromTypeQName(type)).collect(Collectors.toList());
}
@Override
protected ObjectTypes getObjectType() {
if (CollectionUtils.isNotEmpty(getSupportedTypesList())) {
return getSupportedTypesList().get(0);
}
return super.getObjectType();
}
};
}
@Override
public String getCount() {
return Integer.toString(getTabPanelSelectedCount(getPanel()));
}
});
return tabs;
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class ChooseOrgMemberPopup method createAssignmentTabs.
@Override
protected List<ITab> createAssignmentTabs(AssignmentObjectRelation relationSpec) {
List<ITab> tabs = super.createAssignmentTabs(relationSpec);
tabs.add(new CountablePanelTab(getPageBase().createStringResource("chooseMemberForOrgPopup.otherTypesLabel"), new VisibleBehaviour(() -> getAvailableObjectTypes() == null)) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new MultiTypesMemberPopupTabPanel<O>(panelId, relationsConfig, getArchetypeRefList()) {
private static final long serialVersionUID = 1L;
@Override
protected void onSelectionPerformed(AjaxRequestTarget target, IModel<SelectableBean<O>> rowModel) {
tabLabelPanelUpdate(target);
}
@Override
protected OrgType getAbstractRoleTypeObject() {
return ChooseOrgMemberPopup.this.getAssignmentTargetRefObject();
}
};
}
@Override
public String getCount() {
return Integer.toString(getTabPanelSelectedCount(getPanel()));
}
});
return tabs;
}
Aggregations