use of com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn in project midpoint by Evolveum.
the class PageCreatedReports method initColumns.
//TODO - consider adding Author name, File Type and ReportType to columns
private List<IColumn<SelectableBean<ReportOutputType>, String>> initColumns(final AjaxDownloadBehaviorFromStream ajaxDownloadBehavior) {
List<IColumn<SelectableBean<ReportOutputType>, String>> columns = new ArrayList<>();
IColumn column;
column = new CheckBoxHeaderColumn();
columns.add(column);
column = new PropertyColumn(createStringResource("pageCreatedReports.table.name"), "name", "value.name");
columns.add(column);
column = new PropertyColumn(createStringResource("pageCreatedReports.table.description"), "value.description");
columns.add(column);
column = new AbstractColumn<SelectableBean<ReportOutputType>, String>(createStringResource("pageCreatedReports.table.time"), "createTimestamp") {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ReportOutputType>>> cellItem, String componentId, final IModel<SelectableBean<ReportOutputType>> rowModel) {
cellItem.add(new DateLabelComponent(componentId, new AbstractReadOnlyModel<Date>() {
@Override
public Date getObject() {
ReportOutputType object = rowModel.getObject().getValue();
MetadataType metadata = object != null ? object.getMetadata() : null;
if (metadata == null) {
return null;
}
return XmlTypeConverter.toDate(metadata.getCreateTimestamp());
}
}, DateLabelComponent.LONG_MEDIUM_STYLE));
}
};
columns.add(column);
column = new AbstractColumn<SelectableBean<ReportOutputType>, String>(new Model(), null) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ReportOutputType>>> cellItem, String componentId, final IModel<SelectableBean<ReportOutputType>> model) {
DownloadButtonPanel panel = new DownloadButtonPanel(componentId) {
@Override
protected void deletePerformed(AjaxRequestTarget target) {
deleteSelectedPerformed(target, ReportDeleteDialogDto.Operation.DELETE_SINGLE, model.getObject().getValue());
}
@Override
protected void downloadPerformed(AjaxRequestTarget target) {
currentReport = model.getObject().getValue();
PageCreatedReports.this.downloadPerformed(target, model.getObject().getValue(), ajaxDownloadBehavior);
}
};
cellItem.add(panel);
}
};
columns.add(column);
column = new InlineMenuHeaderColumn<InlineMenuable>(initInlineMenu()) {
@Override
public void populateItem(Item<ICellPopulator<InlineMenuable>> cellItem, String componentId, IModel<InlineMenuable> rowModel) {
cellItem.add(new Label(componentId));
}
};
columns.add(column);
return columns;
}
use of com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn in project midpoint by Evolveum.
the class PageDebugList method initColumns.
private List<IColumn> initColumns(final Class<? extends ObjectType> type) {
List<IColumn> columns = new ArrayList<>();
IColumn column = new CheckBoxHeaderColumn<ObjectType>();
columns.add(column);
column = new LinkColumn<DebugObjectItem>(createStringResource("pageDebugList.name"), DebugObjectItem.F_NAME, DebugObjectItem.F_NAME) {
@Override
public void populateItem(Item<ICellPopulator<DebugObjectItem>> cellItem, String componentId, final IModel<DebugObjectItem> rowModel) {
TwoValueLinkPanel panel = new TwoValueLinkPanel(componentId, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
DebugObjectItem object = rowModel.getObject();
if (object == null) {
return null;
}
StringBuilder sb = new StringBuilder();
sb.append(object.getName());
if (object.getStatus() != null && object.getStatus() != OperationResultStatusType.SUCCESS && object.getStatus() != OperationResultStatusType.HANDLED_ERROR) {
sb.append(" (");
sb.append(object.getStatus());
sb.append(")");
}
return sb.toString();
}
}, new PropertyModel<String>(rowModel, DebugObjectItem.F_OID)) {
@Override
public void onClick(AjaxRequestTarget target) {
DebugObjectItem object = rowModel.getObject();
objectEditPerformed(target, object.getOid(), type);
}
@Override
public boolean isEnabled() {
return rowModel.getObject().getOid() != null;
}
};
cellItem.add(panel);
cellItem.add(new AttributeModifier("class", "col-md-3"));
}
};
columns.add(column);
columns.add(new PropertyColumn(createStringResource("pageDebugList.description"), DebugObjectItem.F_DESCRIPTION));
if (ShadowType.class.isAssignableFrom(type)) {
columns.add(new PropertyColumn(createStringResource("pageDebugList.resourceName"), DebugObjectItem.F_RESOURCE_NAME));
columns.add(new PropertyColumn(createStringResource("pageDebugList.resourceType"), DebugObjectItem.F_RESOURCE_TYPE));
}
column = new AbstractColumn<DebugObjectItem, String>(new Model(), null) {
@Override
public String getCssClass() {
return "debug-list-buttons";
}
@Override
public void populateItem(Item<ICellPopulator<DebugObjectItem>> cellItem, String componentId, IModel<DebugObjectItem> rowModel) {
cellItem.add(new DebugButtonPanel<DebugObjectItem>(componentId, rowModel) {
@Override
public void deletePerformed(AjaxRequestTarget target, IModel<DebugObjectItem> model) {
deleteSelected(target, model.getObject());
}
@Override
public void exportPerformed(AjaxRequestTarget target, IModel<DebugObjectItem> model) {
exportSelected(target, model.getObject());
}
});
}
};
columns.add(column);
column = new InlineMenuHeaderColumn<InlineMenuable>(initInlineMenu()) {
@Override
public void populateItem(Item<ICellPopulator<InlineMenuable>> cellItem, String componentId, IModel<InlineMenuable> rowModel) {
// we don't need row inline menu
cellItem.add(new Label(componentId));
}
};
columns.add(column);
return columns;
}
use of com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn in project midpoint by Evolveum.
the class OrgUnitAddDeletePopup method initColumns.
private List<IColumn<SelectableBean<ObjectType>, String>> initColumns() {
List<IColumn<SelectableBean<ObjectType>, String>> columns = new ArrayList<IColumn<SelectableBean<ObjectType>, String>>();
IColumn column = new CheckBoxHeaderColumn<OrgType>();
columns.add(column);
column = new LinkColumn<SelectableBean<OrgType>>(createStringResource("orgUnitAddDeletePopup.column.name"), getSortableProperty(), "value.name") {
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<OrgType>> rowModel) {
OrgType org = rowModel.getObject().getValue();
chooseOperationPerformed(target, org);
}
};
columns.add(column);
return columns;
}
use of com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn in project midpoint by Evolveum.
the class PageConnectorHosts method initConnectorHostsColumns.
private List<IColumn<ConnectorHostType, String>> initConnectorHostsColumns() {
List<IColumn<ConnectorHostType, String>> columns = new ArrayList<>();
IColumn column = new CheckBoxHeaderColumn<ConnectorHostType>();
columns.add(column);
column = new LinkColumn<SelectableBean<ConnectorHostType>>(createStringResource("pageResources.connector.name"), "name", "value.name") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ConnectorHostType>> rowModel) {
ConnectorHostType host = rowModel.getObject().getValue();
// resourceDetailsPerformed(target, host.getOid());
}
};
columns.add(column);
columns.add(new PropertyColumn(createStringResource("pageResources.connector.hostname"), "value.hostname"));
columns.add(new PropertyColumn(createStringResource("pageResources.connector.port"), "value.port"));
columns.add(new PropertyColumn(createStringResource("pageResources.connector.timeout"), "value.timeout"));
columns.add(new CheckBoxColumn(createStringResource("pageResources.connector.protectConnection"), "value.protectConnection"));
InlineMenuHeaderColumn menu = new InlineMenuHeaderColumn(initInlineHostsMenu());
columns.add(menu);
return columns;
}
use of com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn in project midpoint by Evolveum.
the class JasperReportConfigurationPanel method initParameterColumns.
private List<IColumn<JasperReportParameterDto, String>> initParameterColumns() {
List<IColumn<JasperReportParameterDto, String>> columns = new ArrayList<>();
IColumn<JasperReportParameterDto, String> column = new CheckBoxHeaderColumn<>();
columns.add(column);
// name editing column
columns.add(buildEditableLinkColumn("JasperReportConfigurationPanel.parameterName", null, "name", true));
// class editing column
columns.add(buildEditableLinkColumn("JasperReportConfigurationPanel.parameterClass", null, "typeAsString", true));
columns.add(buildEditableLinkColumn("JasperReportConfigurationPanel.nestedClass", null, "nestedTypeAsString", true));
columns.add(new LinkColumn<JasperReportParameterDto>(createStringResource("JasperReportConfigurationPanel.properties")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target, IModel<JasperReportParameterDto> rowModel) {
showPropertiesPopup(target, rowModel);
}
@Override
protected IModel createLinkModel(IModel<JasperReportParameterDto> rowModel) {
return createStringResource("JasperReportConfigurationPanel.configure");
}
});
CheckBoxColumn<JasperReportParameterDto> forPrompting = new CheckBoxColumn<JasperReportParameterDto>(createStringResource("JasperReportConfigurationPanel.forPrompting"), "forPrompting") {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<JasperReportParameterDto>> cellItem, String componentId, IModel<JasperReportParameterDto> rowModel) {
CheckBoxPanel checkBox = new CheckBoxPanel(componentId, new PropertyModel<Boolean>(rowModel, getPropertyExpression()), new Model<>(true));
cellItem.add(checkBox);
}
};
columns.add(forPrompting);
return columns;
}
Aggregations