use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ObjectListPanel method createTable.
private BoxedTablePanel<SelectableBean<O>> createTable() {
List<IColumn<SelectableBean<O>, String>> columns;
if (isCustomColumnsListConfigured()) {
columns = initCustomColumns();
} else {
columns = initColumns();
}
BaseSortableDataProvider<SelectableBean<O>> provider = initProvider();
BoxedTablePanel<SelectableBean<O>> table = new BoxedTablePanel<SelectableBean<O>>(ID_TABLE, provider, columns, tableId, tableId == null ? 10 : parentPage.getSessionStorage().getUserProfile().getPagingSize(tableId)) {
private static final long serialVersionUID = 1L;
@Override
protected WebMarkupContainer createHeader(String headerId) {
return initSearch(headerId);
}
@Override
public String getAdditionalBoxCssClasses() {
return ObjectListPanel.this.getAdditionalBoxCssClasses();
}
@Override
protected WebMarkupContainer createButtonToolbar(String id) {
WebMarkupContainer bar = ObjectListPanel.this.createTableButtonToolbar(id);
return bar != null ? bar : super.createButtonToolbar(id);
}
};
table.setOutputMarkupId(true);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
table.setCurrentPage(storage.getPaging());
}
}
return table;
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ProcessInstancesPanel method initLayout.
private void initLayout(UserProfileStorage.TableId tableId, int pageSize, View view, final IModel<String> currentInstanceIdModel) {
BoxedTablePanel<ProcessInstanceDto> table = new BoxedTablePanel<ProcessInstanceDto>(ID_REQUESTS_TABLE, provider, initColumns(view), tableId, pageSize) {
@Override
protected Item<ProcessInstanceDto> customizeNewRowItem(Item<ProcessInstanceDto> item, final IModel<ProcessInstanceDto> rowModel) {
item.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (currentInstanceIdModel == null || currentInstanceIdModel.getObject() == null) {
return "";
}
ProcessInstanceDto rowDto = rowModel.getObject();
if (currentInstanceIdModel.getObject().equals(rowDto.getProcessInstanceId())) {
return "info";
} else {
return "";
}
}
}));
return item;
}
};
table.setOutputMarkupId(true);
table.setAdditionalBoxCssClasses("without-box-header-top-border");
add(table);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ResourceDetailsTabPanel method initLayout.
protected void initLayout(IModel model, PageBase parentPage) {
PrismObject<ResourceType> resourceObject = (PrismObject<ResourceType>) model.getObject();
ResourceType resource = resourceObject.asObjectable();
add(createLastAvailabilityStatusInfo(resource));
add(createSourceTargetInfo(resource));
add(createSchemaStatusInfo(resource));
CapabilitiesPanel capabilities = new CapabilitiesPanel(PANEL_CAPABILITIES, capabilitiesModel);
add(capabilities);
List<ResourceConfigurationDto> resourceConfigList = createResourceConfigList(resource);
ListDataProvider<ResourceConfigurationDto> resourceConfigProvider = new ListDataProvider<ResourceConfigurationDto>(ResourceDetailsTabPanel.this, new ListModel<ResourceConfigurationDto>(resourceConfigList));
List<ColumnTypeDto<String>> columns = Arrays.asList(new ColumnTypeDto<String>("ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart()), new ColumnTypeDto<String>("ShadowType.objectClass", "objectTypeDefinition.objectClass.localPart", ShadowType.F_OBJECT_CLASS.getLocalPart()), new ColumnTypeDto<String>("ShadowType.intent", "objectTypeDefinition.intent", ShadowType.F_INTENT.getLocalPart()), new ColumnTypeDto<String>("ResourceType.isSync", "sync", null));
List<IColumn<SelectableBean<ResourceType>, String>> tableColumns = ColumnUtils.createColumns(columns);
PropertyColumn tasksColumn = new PropertyColumn(PageBase.createStringResourceStatic(this, "ResourceType.tasks"), "definedTasks") {
@Override
public void populateItem(Item item, String componentId, final IModel rowModel) {
ResourceConfigurationDto conf = (ResourceConfigurationDto) rowModel.getObject();
RepeatingView repeater = new RepeatingView(componentId);
for (final TaskType task : conf.getDefinedTasks()) {
repeater.add(new LinkPanel(repeater.newChildId(), new Model<String>(task.getName().getOrig())) {
@Override
public void onClick(AjaxRequestTarget target) {
ResourceDetailsTabPanel.this.taskDetailsPerformed(target, task.getOid());
}
});
}
item.add(repeater);
}
};
tableColumns.add(tasksColumn);
BoxedTablePanel<ResourceConfigurationDto> resourceConfig = new BoxedTablePanel("resourceConfig", resourceConfigProvider, tableColumns);
resourceConfig.setAdditionalBoxCssClasses("box-success");
add(resourceConfig);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class MultipleAssignmentSelector method searchPerformed.
private void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
MultipleAssignmentSelector.this.searchQuery = query;
if (filterModel != null && filterModel.getObject() != null) {
if (query == null) {
query = new ObjectQuery();
}
query.addFilter(filterModel.getObject());
filterObjectIsAdded = true;
}
BoxedTablePanel panel = getTable();
panel.setCurrentPage(null);
provider.setQuery(query);
target.add(panel);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class MultipleAssignmentSelector method initTablePanel.
private BoxedTablePanel initTablePanel() {
List<IColumn<SelectableBean<AssignmentEditorDto>, String>> columns = initColumns();
BoxedTablePanel table = new BoxedTablePanel(ID_TABLE, provider, columns, UserProfileStorage.TableId.TABLE_ROLES, ITEMS_PER_PAGE);
updateBoxedTablePanelStyles(table);
//hide footer menu
table.getFooterMenu().setVisible(false);
//hide footer count label
table.getFooterCountLabel().setVisible(false);
table.setOutputMarkupId(true);
return table;
}
Aggregations