use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn 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 org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn 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 org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ResourceTasksPanel method initLayout.
private void initLayout(final ListModel<TaskType> tasks) {
final MainObjectListPanel<TaskType> tasksPanel = new MainObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, TableId.PAGE_RESOURCE_TASKS_PANEL, null, pageBase) {
private static final long serialVersionUID = 1L;
@Override
protected BaseSortableDataProvider<SelectableBean<TaskType>> initProvider() {
return new ListDataProvider2(pageBase, tasks);
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
// TODO Auto-generated method stub
return null;
}
@Override
public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
// TODO Auto-generated method stub
// super.objectDetailsPerformed(target, task);
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
getPageBase().navigateToNext(PageTaskEdit.class, parameters);
}
@Override
protected void newObjectPerformed(AjaxRequestTarget target) {
getPageBase().navigateToNext(PageTaskAdd.class);
}
@Override
protected List<IColumn<SelectableBean<TaskType>, String>> createColumns() {
return ColumnUtils.getDefaultTaskColumns();
}
};
// final ObjectListPanel<TaskType> tasksPanel = new ObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, pageBase){
//
// @Override
// protected BaseSortableDataProvider<SelectableBean<TaskType>> getProvider() {
// return new ListDataProvider2(pageBase, tasks);
// }
//
// @Override
// public boolean isEditable() {
// return ResourceTasksPanel.this.editable;
// }
//
// @Override
// public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
// // TODO Auto-generated method stub
// super.objectDetailsPerformed(target, task);
// PageParameters parameters = new PageParameters();
// parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
// setResponsePage(new PageTaskEdit(parameters));
// }
// };
// tasksPanel.setEditable(false);
tasksPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_TASK_BOX_CSS_CLASSES);
add(tasksPanel);
AjaxButton runNow = new AjaxButton(ID_RUN_NOW, pageBase.createStringResource("pageTaskEdit.button.runNow")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.runNowPerformed(pageBase.getTaskService(), oids);
pageBase.showResult(result);
} else {
noTasksSelected();
}
target.add(pageBase.getFeedbackPanel());
}
};
add(runNow);
AjaxButton resume = new AjaxButton(ID_RESUME, pageBase.createStringResource("pageTaskEdit.button.resume")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.resumePerformed(pageBase.getTaskService(), oids);
pageBase.showResult(result);
} else {
noTasksSelected();
}
target.add(pageBase.getFeedbackPanel());
}
};
add(resume);
AjaxButton suspend = new AjaxButton(ID_SUSPEND, pageBase.createStringResource("pageTaskEdit.button.suspend")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
if (!oids.isEmpty()) {
OperationResult result = TaskOperationUtils.suspendPerformed(pageBase.getTaskService(), oids);
pageBase.showResult(result);
} else {
noTasksSelected();
}
target.add(pageBase.getFeedbackPanel());
}
};
add(suspend);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class PageResources method initResourceColumns.
private List<IColumn<SelectableBean<ResourceType>, String>> initResourceColumns() {
List<IColumn<SelectableBean<ResourceType>, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn(createStringResource("pageResources.connectorType"), SelectableBean.F_VALUE + ".connector.connectorType"));
columns.add(new PropertyColumn(createStringResource("pageResources.version"), SelectableBean.F_VALUE + ".connector.connectorVersion"));
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn 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