use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class TaskErrorsPanel method initColumnsOld.
private List<IColumn<TaskErrorSelectableBeanImplOld<ObjectType>, String>> initColumnsOld() {
List<IColumn<TaskErrorSelectableBeanImplOld<ObjectType>, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.objectName"), TaskErrorSelectableBeanImplOld.F_OBJECT_REF_NAME) {
@Override
public String getSortProperty() {
return "name";
}
});
columns.add(new AbstractColumn<>(createStringResource("pageTaskEdit.taskErros.timestamp"), TaskErrorSelectableBeanImplOld.F_ERROR_TIMESTAMP) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<TaskErrorSelectableBeanImplOld<ObjectType>>> cellItem, String componentId, IModel<TaskErrorSelectableBeanImplOld<ObjectType>> rowModel) {
Label label = new Label(componentId, (IModel<String>) () -> WebComponentUtil.getShortDateTimeFormattedValue(rowModel.getObject().getErrorTimestamp(), getPageBase()));
cellItem.add(label);
}
});
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.status"), TaskErrorSelectableBeanImplOld.F_STATUS));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.message"), TaskErrorSelectableBeanImplOld.F_MESSAGE));
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.recordType"), TaskErrorSelectableBeanImplOld.F_RECORD_TYPE));
columns.add(new AjaxLinkColumn<>(createStringResource("pageTaskEdit.taskErros.realOwner"), TaskErrorSelectableBeanImplOld.F_REAL_OWNER_DESCRIPTION) {
@Override
public void onClick(AjaxRequestTarget target, IModel<TaskErrorSelectableBeanImplOld<ObjectType>> rowModel) {
TaskErrorSelectableBeanImplOld<ObjectType> object = rowModel.getObject();
PrismObject<ObjectType> realOwner = object.getRealOwner();
WebComponentUtil.dispatchToObjectDetailsPage(realOwner.getCompileTimeClass(), realOwner.getOid(), TaskErrorsPanel.this, false);
}
});
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class TaskSubtasksAndThreadsPanel method initLayout.
protected void initLayout() {
Label subtasksLabel = new Label(ID_SUBTASKS_LABEL, new ResourceModel("pageTaskEdit.subtasksLabel"));
add(subtasksLabel);
TaskTablePanel subtasksPanel = new TaskTablePanel(ID_SUBTASKS_PANEL, createOperationOptions()) {
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> createSubtasksQuery(), null);
}
@Override
protected List<Component> createToolbarButtonsList(String buttonId) {
return new ArrayList<>();
}
@Override
protected List<IColumn<SelectableBean<TaskType>, String>> createDefaultColumns() {
List<IColumn<SelectableBean<TaskType>, String>> columns = super.createDefaultColumns();
// });
return columns;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_SUBTASKS;
}
@Override
@NotNull
protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, getObjectDetailsModels().getRootTaskModelObject());
}
};
add(subtasksPanel);
Label workerThreadsTableLabel = new Label(ID_WORKER_THREADS_TABLE_LABEL, new ResourceModel("TaskStatePanel.workerThreads"));
add(workerThreadsTableLabel);
TaskTablePanel workerThreadsTable = new TaskTablePanel(ID_WORKER_THREADS_TABLE, null) {
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return new SelectableListDataProvider<>(TaskSubtasksAndThreadsPanel.this, createWorkersModel());
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_WORKERS;
}
@Override
protected boolean isHeaderVisible() {
return false;
}
@Override
protected List<Component> createToolbarButtonsList(String buttonId) {
return new ArrayList<>();
}
@Override
@NotNull
protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, getObjectDetailsModels().getRootTaskModelObject());
}
};
add(workerThreadsTable);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ListMappingPanel method initLayout.
private void initLayout() {
MultivalueContainerListPanelWithDetailsPanel<MappingType> table = new MultivalueContainerListPanelWithDetailsPanel<MappingType>(ID_TABLE, MappingType.class) {
@Override
protected MultivalueContainerDetailsPanel<MappingType> getMultivalueContainerDetailsPanel(ListItem<PrismContainerValueWrapper<MappingType>> item) {
return new MultivalueContainerDetailsPanel<>(MultivalueContainerListPanelWithDetailsPanel.ID_ITEM_DETAILS, item.getModel(), true) {
@Override
protected DisplayNamePanel<MappingType> createDisplayNamePanel(String displayNamePanelId) {
ItemRealValueModel<MappingType> displayNameModel = new ItemRealValueModel<>(item.getModel());
return new DisplayNamePanel<>(displayNamePanelId, displayNameModel) {
@Override
protected IModel<String> createHeaderModel() {
IModel<String> headerModel = super.createHeaderModel();
if (StringUtils.isEmpty(headerModel.getObject())) {
return getPageBase().createStringResource("feedbackMessagePanel.message.undefined");
}
return headerModel;
}
};
}
@Override
protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, MappingType.F_METADATA_MAPPING))) {
return ItemVisibility.HIDDEN;
}
return ItemVisibility.AUTO;
}
};
}
@Override
protected boolean isCreateNewObjectVisible() {
return true;
}
@Override
protected IModel<PrismContainerWrapper<MappingType>> getContainerModel() {
return ListMappingPanel.this.getModel();
}
@Override
protected UserProfileStorage.TableId getTableId() {
return null;
}
@Override
protected List<IColumn<PrismContainerValueWrapper<MappingType>, String>> createDefaultColumns() {
List<IColumn<PrismContainerValueWrapper<MappingType>, String>> columns = new ArrayList<>();
columns.add(new PrismPropertyWrapperColumn<>(ListMappingPanel.this.getModel(), MappingType.F_DESCRIPTION, AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
columns.add(new PrismPropertyWrapperColumn<>(ListMappingPanel.this.getModel(), MappingType.F_ENABLED, AbstractItemWrapperColumn.ColumnType.VALUE, getPageBase()));
columns.add(new AbstractColumn<>(createStringResource("ListMappingPanel.mappingDescription")) {
@Override
public void populateItem(Item<ICellPopulator<PrismContainerValueWrapper<MappingType>>> cellItem, String componentId, IModel<PrismContainerValueWrapper<MappingType>> rowModel) {
cellItem.add(new Label(componentId, WebComponentUtil.createMappingDescription(rowModel)));
}
});
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item = new InlineMenuItem(createStringResource("pageAdminFocus.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteItemPerformed(target, getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
item = new ButtonInlineMenuItem(createStringResource("PageBase.button.edit")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_EDIT_MENU_ITEM);
}
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editItemPerformed(target, getRowModel(), getSelectedItems());
target.add(getFeedbackPanel());
}
};
}
};
items.add(item);
columns.add(new InlineMenuButtonColumn(items, getPageBase()) {
@Override
public String getCssClass() {
return "col-xs-1";
}
});
return columns;
}
@Override
protected IColumn<PrismContainerValueWrapper<MappingType>, String> createNameColumn(IModel<String> displayModel, GuiObjectColumnType customColumn, ItemPath itemPath, ExpressionType expression) {
return new PrismPropertyWrapperColumn<>(ListMappingPanel.this.getModel(), MappingType.F_NAME, AbstractItemWrapperColumn.ColumnType.LINK, getPageBase()) {
@Override
protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<MappingType>> model) {
itemDetailsPerformed(target, model);
}
};
}
@Override
protected IColumn<PrismContainerValueWrapper<MappingType>, String> createCheckboxColumn() {
return new CheckBoxHeaderColumn<>();
}
@Override
protected PrismContainerDefinition<MappingType> getTypeDefinitionForSearch() {
return getPrismContext().getSchemaRegistry().findContainerDefinitionByType(MappingType.COMPLEX_TYPE);
}
};
add(table);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class SearchPropertiesConfigPanel method initTable.
private void initTable(WebMarkupContainer configPanel) {
List<IColumn<SelectableBean<ValueSearchFilterItem>, String>> columns = getTableColumns();
BoxedTablePanel<SelectableBean<ValueSearchFilterItem>> table = new BoxedTablePanel<SelectableBean<ValueSearchFilterItem>>(ID_PROPERTIES_TABLE, 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) {
AjaxButton addRowButton = new AjaxButton(id) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
propertyAddedPerformed(ajaxRequestTarget);
}
};
addRowButton.setOutputMarkupId(true);
addRowButton.add(AttributeAppender.append("class", "btn btn-sm btn-default fa fa-plus"));
addRowButton.add(AttributeAppender.append("style", "color: green;"));
return addRowButton;
}
@Override
protected boolean hideFooterIfSinglePage() {
return true;
}
@Override
public int getAutoRefreshInterval() {
return 0;
}
@Override
public boolean isAutoRefreshEnabled() {
return false;
}
};
table.setOutputMarkupId(true);
configPanel.add(table);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class PageCreatedReports method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ReportDataType> table = new MainObjectListPanel<ReportDataType>(ID_TABLE, ReportDataType.class) {
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, ReportDataType object) {
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_CREATED_REPORTS_PANEL;
}
@Override
protected ISelectableDataProvider<ReportDataType, SelectableBean<ReportDataType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> appendTypeFilter(), (sortParam) -> PageCreatedReports.this.createCustomOrdering(sortParam));
}
// @Override
// protected ObjectQuery getCustomizeContentQuery() {
// return appendTypeFilter();
// }
//
// @Override
// protected List<ObjectOrdering> createObjectOrderings(SortParam<String> sortParam) {
// return PageCreatedReports.this.createCustomOrdering(sortParam);
// }
// @Override
// protected ISelectableDataProvider<ReportDataType, SelectableBean<ReportDataType>> createProvider() {
// PageStorage storage = getObjectListPanel().getPageStorage();
// SelectableBeanObjectDataProvider<ReportDataType> provider = new SelectableBeanObjectDataProvider<ReportDataType>(
// getPageBase(), getSearchModel(), null) {
// private static final long serialVersionUID = 1L;
//
// @Override
// protected PageStorage getPageStorage() {
// return storage;
// }
//
// @NotNull
// @Override
// protected List<ObjectOrdering> createObjectOrderings(SortParam<String> sortParam) {
// return PageCreatedReports.this.createCustomOrdering(sortParam);
// }
//
// @Override
// protected ObjectQuery getCustomizeContentQuery() {
// return appendTypeFilter();
// }
// };
// provider.setCompiledObjectCollectionView(getObjectCollectionView());
// provider.setOptions(createOptions());
// return provider;
// }
@Override
protected List<InlineMenuItem> createInlineMenu() {
return initInlineMenu();
}
@Override
protected boolean isCreateNewObjectEnabled() {
return false;
}
@Override
protected boolean isObjectDetailsEnabled(IModel<SelectableBean<ReportDataType>> rowModel) {
return false;
}
@Override
protected List<IColumn<SelectableBean<ReportDataType>, String>> createDefaultColumns() {
return PageCreatedReports.this.initColumns();
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
String reportName = reportTypeMal.get(getReportType());
List<String> values = new ArrayList<>(reportTypeMal.values());
DropDownChoicePanel<String> reportTypeSelect = new DropDownChoicePanel<>(ID_REPORT_TYPE_SELECT, Model.of(reportName), Model.ofList(values), StringChoiceRenderer.simple(), true);
reportTypeSelect.getBaseFormComponent().add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
table.refreshTable(target);
}
});
reportTypeSelect.setOutputMarkupId(true);
mainForm.add(reportTypeSelect);
ajaxDownloadBehavior = new AjaxDownloadBehaviorFromStream() {
private static final long serialVersionUID = 1L;
@Override
protected InputStream initStream() {
return createReport();
}
@Override
public String getFileName() {
return getReportFileName();
}
};
mainForm.add(ajaxDownloadBehavior);
}
Aggregations