use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project syncope by apache.
the class ProvisioningTaskDirectoryPanel method getFieldColumns.
@Override
protected List<IColumn<T, String>> getFieldColumns() {
List<IColumn<T, String>> columns = new ArrayList<>();
columns.add(new KeyPropertyColumn<>(new StringResourceModel("key", this), "key"));
columns.add(new PropertyColumn<>(new StringResourceModel("name", this), "name", "name"));
columns.add(new PropertyColumn<>(new StringResourceModel("description", this), "description", "description"));
if (reference == PullTaskTO.class) {
columns.add(new PropertyColumn<>(new StringResourceModel("destinationRealm", this), "destinationRealm", "destinationRealm"));
} else if (reference == PushTaskTO.class) {
columns.add(new PropertyColumn<>(new StringResourceModel("sourceRealm", this), "sourceRealm", "sourceRealm"));
}
columns.add(new DatePropertyColumn<>(new StringResourceModel("lastExec", this), "lastExec", "lastExec"));
columns.add(new DatePropertyColumn<>(new StringResourceModel("nextExec", this), "nextExec", "nextExec"));
columns.add(new PropertyColumn<>(new StringResourceModel("latestExecStatus", this), "latestExecStatus", "latestExecStatus"));
columns.add(new BooleanPropertyColumn<>(new StringResourceModel("active", this), "active", "active"));
columns.add(new AbstractColumn<T, String>(new Model<>(""), "running") {
private static final long serialVersionUID = -4008579357070833846L;
@Override
public void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel) {
JobTO jobTO = restClient.getJob(rowModel.getObject().getKey());
JobActionPanel panel = new JobActionPanel(componentId, jobTO, false, ProvisioningTaskDirectoryPanel.this, pageRef);
MetaDataRoleAuthorizationStrategy.authorize(panel, WebPage.ENABLE, String.format("%s,%s", StandardEntitlement.TASK_EXECUTE, StandardEntitlement.TASK_UPDATE));
cellItem.add(panel);
}
@Override
public String getCssClass() {
return "col-xs-1";
}
});
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project wicket by apache.
the class BrowserPanel method createTable.
private BrowserTable createTable(String id, IModel<String> sessionId) {
PageWindowProvider provider = new PageWindowProvider(sessionId);
List<IColumn<PageWindowDescription, String>> columns = new ArrayList<>();
PageWindowColumn pageIdColumn = new PageWindowColumn(Model.of("Id"), "id");
columns.add(pageIdColumn);
PageWindowColumn pageNameColumn = new PageWindowColumn(Model.of("Name"), "name");
columns.add(pageNameColumn);
PageWindowColumn pageSizeColumn = new PageWindowColumn(Model.of("Size"), "size");
columns.add(pageSizeColumn);
BrowserTable browserTable = new BrowserTable(id, columns, provider);
browserTable.setOutputMarkupId(true);
browserTable.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
return browserTable;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ContainerableListPanel method getViewColumnsTransformed.
protected List<IColumn<PO, String>> getViewColumnsTransformed(List<GuiObjectColumnType> customColumns, boolean shouldCheckForNameColumn) {
List<IColumn<PO, String>> columns = new ArrayList<>();
if (customColumns == null || customColumns.isEmpty()) {
return columns;
}
IColumn<PO, String> column;
for (GuiObjectColumnType customColumn : customColumns) {
if (nothingToTransform(customColumn)) {
continue;
}
ItemPath columnPath = customColumn.getPath() == null ? null : customColumn.getPath().getItemPath();
// TODO this throws an exception for some kinds of invalid paths like e.g. fullName/norm (but we probably should fix prisms in that case!)
ExpressionType expression = customColumn.getExport() != null ? customColumn.getExport().getExpression() : null;
if (expression == null && noItemDefinitionFor(columnPath, customColumn)) {
continue;
}
if (WebComponentUtil.getElementVisibility(customColumn.getVisibility())) {
IModel<String> columnDisplayModel = createColumnDisplayModel(customColumn);
if (customColumns.indexOf(customColumn) == 0 && shouldCheckForNameColumn) {
column = createNameColumn(columnDisplayModel, customColumn, columnPath, expression);
} else {
column = createCustomExportableColumn(columnDisplayModel, customColumn, columnPath, expression);
}
if (column != null) {
columns.add(column);
}
}
}
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ExportingPanel method createTable.
private BoxedTablePanel<SelectableBean<Integer>> createTable(String id, DataTable<?, ?> dataTable) {
List<? extends IColumn<?, ?>> allColumns = dataTable.getColumns();
List<Integer> exportableColumnIndex = getExportableColumns(dataTable);
if (exportableColumnIndex.isEmpty()) {
throw new IllegalArgumentException("List of exportable columns is empty");
}
List<IColumn<SelectableBean<Integer>, String>> columns = new ArrayList<>();
CheckBoxHeaderColumn<SelectableBean<Integer>> checkboxColumn = new CheckBoxHeaderColumn<>();
columns.add(checkboxColumn);
StringResourceModel nameString = getPageBase().createStringResource("ExportingPopupPanel.nameColumn");
IColumn<SelectableBean<Integer>, String> nameColumn = new AbstractColumn<SelectableBean<Integer>, String>(nameString) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<Integer>>> cellItem, String componentId, IModel<SelectableBean<Integer>> rowModel) {
IModel stringModel = ((IExportableColumn) allColumns.get(rowModel.getObject().getValue())).getDisplayModel();
cellItem.add(new Label(componentId, stringModel));
}
};
columns.add(nameColumn);
SelectableListDataProvider<SelectableBean<Integer>, Integer> provider = new SelectableListDataProvider<SelectableBean<Integer>, Integer>(getPageBase(), Model.ofList(exportableColumnIndex)) {
@Override
public Iterator<SelectableBean<Integer>> internalIterator(long first, long count) {
if (getAvailableData().isEmpty()) {
return super.internalIterator(first, count);
} else {
return getAvailableData().iterator();
}
}
};
BoxedTablePanel<SelectableBean<Integer>> table = new BoxedTablePanel<SelectableBean<Integer>>(id, provider, columns) {
private static final long serialVersionUID = 1L;
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new WebMarkupContainer(headerId);
}
@Override
public String getAdditionalBoxCssClasses() {
return null;
}
@Override
protected WebMarkupContainer createButtonToolbar(String id) {
return new WebMarkupContainer(id);
}
@Override
protected boolean hideFooterIfSinglePage() {
return true;
}
@Override
public int getAutoRefreshInterval() {
return 0;
}
@Override
public boolean isAutoRefreshEnabled() {
return false;
}
};
table.setOutputMarkupId(true);
return table;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ExportingPanel method getExportableColumns.
private List<Integer> getExportableColumns(DataTable<?, ?> dataTable) {
List<? extends IColumn<?, ?>> columns = dataTable.getColumns();
List<Integer> exportableColumn = new ArrayList<>();
for (IColumn column : columns) {
if (column instanceof IExportableColumn) {
exportableColumn.add(columns.indexOf(column));
}
}
return exportableColumn;
}
Aggregations