use of com.evolveum.midpoint.web.page.self.dto.AssignmentViewType in project midpoint by Evolveum.
the class AssignmentCatalogPanel method initViewSelector.
private void initViewSelector(WebMarkupContainer headerPanel) {
DropDownChoice<AssignmentViewType> viewSelect = new DropDownChoice(ID_VIEW_TYPE, viewModel, Model.ofList(viewTypeList != null && viewTypeList.size() > 0 ? viewTypeList : createAssignableTypesList()), new EnumChoiceRenderer<AssignmentViewType>(this));
viewSelect.add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (AssignmentViewType.USER_TYPE.equals(viewSelect.getModelObject())) {
initUserViewSelectionPopup(createStringResource("AssignmentCatalogPanel.selectAssignmentsUserOwner"), target);
} else {
AssignmentCatalogPanel.this.addOrReplaceLayout(target, getCatalogItemsPanelContainer());
target.add(getCatalogItemsPanelContainer());
target.add(getHeaderPanel());
}
}
});
viewSelect.setOutputMarkupId(true);
headerPanel.add(viewSelect);
}
use of com.evolveum.midpoint.web.page.self.dto.AssignmentViewType in project midpoint by Evolveum.
the class PageAssignmentShoppingKart method initMainPanel.
private Component initMainPanel() {
List<AssignmentViewType> viewTypeList = getAssignmentViewList();
AssignmentViewType defaultViewType = getDefaultAssignmentViewType();
if (viewTypeList == null || viewTypeList.size() == 0) {
viewTypeList = new ArrayList<>(Arrays.asList(AssignmentViewType.values()));
}
if (defaultViewType != null && !viewTypeList.contains(defaultViewType)) {
viewTypeList.add(defaultViewType);
} else if (defaultViewType == null) {
if (viewTypeList.size() == 1) {
defaultViewType = viewTypeList.get(0);
} else {
if (StringUtils.isEmpty(catalogOid) && AssignmentViewType.ROLE_CATALOG_VIEW.getUri().equals(viewTypeList.get(0).getUri())) {
defaultViewType = viewTypeList.get(1);
} else {
defaultViewType = viewTypeList.get(0);
}
}
}
AssignmentCatalogPanel panel = new AssignmentCatalogPanel(ID_MAIN_PANEL, catalogOid, defaultViewType, viewTypeList, PageAssignmentShoppingKart.this);
panel.setOutputMarkupId(true);
return panel;
}
use of com.evolveum.midpoint.web.page.self.dto.AssignmentViewType in project midpoint by Evolveum.
the class PageAssignmentShoppingCart method getDefaultViewTypeIndex.
private int getDefaultViewTypeIndex() {
RoleManagementConfigurationType roleConfig = roleManagementConfigModel.getObject();
if (roleConfig == null || roleConfig.getDefaultCollection() == null || roleConfig.getDefaultCollection().getCollectionUri() == null) {
return 0;
}
List<AssignmentViewType> viewTypes = Arrays.asList(AssignmentViewType.values());
for (AssignmentViewType viewType : viewTypes) {
if (viewType.getUri().equals(roleConfig.getDefaultCollection().getCollectionUri())) {
return viewTypes.indexOf(viewType);
}
}
return 0;
}
Aggregations