use of com.evolveum.midpoint.gui.api.component.PendingOperationPanel in project midpoint by Evolveum.
the class ResourceContentPanel method initColumns.
private List<IColumn<SelectableBean<ShadowType>, String>> initColumns() {
List<ColumnTypeDto<String>> columnDefs = Arrays.asList(new ColumnTypeDto<>("ShadowType.synchronizationSituation", SelectableBeanImpl.F_VALUE + ".synchronizationSituation", ShadowType.F_SYNCHRONIZATION_SITUATION.getLocalPart()), new ColumnTypeDto<>("ShadowType.intent", SelectableBeanImpl.F_VALUE + ".intent", ShadowType.F_INTENT.getLocalPart()));
List<IColumn<SelectableBean<ShadowType>, String>> columns = new ArrayList<>();
IColumn<SelectableBean<ShadowType>, String> identifiersColumn = new AbstractColumn<>(createStringResource("pageContentAccounts.identifiers")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ShadowType>>> cellItem, String componentId, IModel<SelectableBean<ShadowType>> rowModel) {
SelectableBean<ShadowType> dto = rowModel.getObject();
RepeatingView repeater = new RepeatingView(componentId);
ShadowType value = dto.getValue();
if (value != null) {
for (ResourceAttribute<?> attr : ShadowUtil.getAllIdentifiers(value)) {
repeater.add(new Label(repeater.newChildId(), attr.getElementName().getLocalPart() + ": " + attr.getRealValue()));
}
}
cellItem.add(repeater);
}
};
columns.add(identifiersColumn);
columns.addAll(ColumnUtils.createColumns(columnDefs));
ObjectLinkColumn<SelectableBean<ShadowType>> ownerColumn = new ObjectLinkColumn<>(createStringResource("pageContentAccounts.owner")) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<FocusType> createLinkModel(final IModel<SelectableBean<ShadowType>> rowModel) {
return new IModel<>() {
private static final long serialVersionUID = 1L;
@Override
public FocusType getObject() {
return loadShadowOwner(rowModel);
}
};
}
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ShadowType>> rowModel, ObjectType targetObjectType) {
ownerDetailsPerformed((FocusType) targetObjectType);
}
};
columns.add(ownerColumn);
columns.add(new AbstractColumn<>(createStringResource("PageAccounts.accounts.pendingOperations")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ShadowType>>> cellItem, String componentId, IModel<SelectableBean<ShadowType>> rowModel) {
cellItem.add(new PendingOperationPanel(componentId, new PropertyModel<>(rowModel, SelectableBeanImpl.F_VALUE + "." + ShadowType.F_PENDING_OPERATION.getLocalPart())));
}
});
return columns;
}
use of com.evolveum.midpoint.gui.api.component.PendingOperationPanel in project midpoint by Evolveum.
the class ProjectionDisplayNamePanel method initLayout.
private void initLayout() {
WebMarkupContainer pendingOperationContainer = new WebMarkupContainer(ID_PENDING_OPERATION_CONTAINER);
List<PendingOperationType> pendingOperations = getModelObject().getPendingOperation();
if (pendingOperations != null && !pendingOperations.isEmpty()) {
pendingOperationContainer.add(new PendingOperationPanel(ID_PENDING_OPERATION, (IModel<List<PendingOperationType>>) () -> pendingOperations));
} else {
pendingOperationContainer.add(new WebMarkupContainer(ID_PENDING_OPERATION));
pendingOperationContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return false;
}
});
}
add(pendingOperationContainer);
}
use of com.evolveum.midpoint.gui.api.component.PendingOperationPanel in project midpoint by Evolveum.
the class FocusProjectionsPanel method initBasicColumns.
private List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> initBasicColumns() {
IModel<PrismContainerDefinition<ShadowType>> shadowDef = Model.of(getShadowDefinition());
List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> columns = new ArrayList<>();
columns.add(new CheckBoxHeaderColumn<>());
columns.add(new CompositedIconColumn<>(Model.of("")) {
private static final long serialVersionUID = 1L;
@Override
protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
if (rowModel == null || rowModel.getObject() == null || rowModel.getObject().getRealValue() == null) {
return new CompositedIconBuilder().build();
}
ShadowType shadow = createShadowType(rowModel);
return WebComponentUtil.createAccountIcon(shadow, getPageBase(), true);
}
});
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_NAME, ColumnType.LINK, getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
getMultivalueContainerListPanel().itemDetailsPerformed(target, rowModel);
target.add(getPageBase().getFeedbackPanel());
}
});
columns.add(new PrismReferenceWrapperColumn<>(shadowDef, ShadowType.F_RESOURCE_REF, ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_OBJECT_CLASS, ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_KIND, ColumnType.STRING, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_INTENT, ColumnType.STRING, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
columns.add(new PrismContainerWrapperColumn<>(shadowDef, ShadowType.F_PENDING_OPERATION, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-2";
}
@Override
protected <IW extends ItemWrapper> Component createColumnPanel(String componentId, IModel<IW> rowModel) {
IW object = rowModel.getObject();
if (object == null) {
return new WebMarkupContainer(componentId);
}
List<PrismValueWrapper<PendingOperationType>> values = object.getValues();
List<PendingOperationType> pendingOperations = values.stream().map(operation -> operation.getRealValue()).collect(Collectors.toList());
return new PendingOperationPanel(componentId, Model.ofList(pendingOperations));
}
});
return columns;
}
use of com.evolveum.midpoint.gui.api.component.PendingOperationPanel in project midpoint by Evolveum.
the class FocusProjectionsTabPanel method initBasicColumns.
private List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> initBasicColumns() {
IModel<PrismContainerDefinition<ShadowType>> shadowDef = Model.of(getShadowDefinition());
List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> columns = new ArrayList<>();
columns.add(new CheckBoxHeaderColumn<>());
columns.add(new CompositedIconColumn<PrismContainerValueWrapper<ShadowType>>(Model.of("")) {
private static final long serialVersionUID = 1L;
@Override
protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
if (rowModel == null || rowModel.getObject() == null || rowModel.getObject().getRealValue() == null) {
return new CompositedIconBuilder().build();
}
ShadowType shadow = createShadowType(rowModel);
return WebComponentUtil.createAccountIcon(shadow, getPageBase(), true);
}
});
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_NAME, ColumnType.LINK, getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
getMultivalueContainerListPanel().itemDetailsPerformed(target, rowModel);
target.add(getFeedbackPanel());
}
});
columns.add(new PrismReferenceWrapperColumn<>(shadowDef, ShadowType.F_RESOURCE_REF, ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_OBJECT_CLASS, ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_KIND, ColumnType.STRING, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_INTENT, ColumnType.STRING, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
columns.add(new PrismContainerWrapperColumn<ShadowType>(shadowDef, ShadowType.F_PENDING_OPERATION, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-2";
}
@Override
protected <IW extends ItemWrapper> Component createColumnPanel(String componentId, IModel<IW> rowModel) {
IW object = rowModel.getObject();
if (object == null) {
return new WebMarkupContainer(componentId);
}
List<PrismValueWrapper<PendingOperationType>> values = object.getValues();
List<PendingOperationType> pendingOperations = new ArrayList<>();
values.forEach(value -> pendingOperations.add(value.getRealValue()));
return new PendingOperationPanel(componentId, (IModel<List<PendingOperationType>>) () -> pendingOperations);
}
});
columns.add(new InlineMenuButtonColumn(createShadowMenu(), getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
return columns;
}
Aggregations