use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ObjectSelectionPanel method initLayout.
public void initLayout(PageBase pageBase) {
Form searchForm = new Form(ID_SEARCH_FORM);
searchForm.setOutputMarkupId(true);
add(searchForm);
searchForm.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return context.isSearchEnabled();
}
});
BasicSearchPanel<ObjectSearchDto> basicSearch = new BasicSearchPanel<ObjectSearchDto>(ID_BASIC_SEARCH) {
@Override
protected IModel<String> createSearchTextModel() {
return new PropertyModel<>(searchModel, ObjectSearchDto.F_SEARCH_TEXT);
}
@Override
protected void searchPerformed(AjaxRequestTarget target) {
ObjectSelectionPanel.this.searchPerformed(target);
}
@Override
protected void clearSearchPerformed(AjaxRequestTarget target) {
ObjectSelectionPanel.this.clearSearchPerformed(target);
}
};
searchForm.add(basicSearch);
add(context.createExtraContentContainer(ID_EXTRA_CONTENT_CONTAINER, this));
List<IColumn<SelectableBean<ObjectType>, String>> columns = initColumns();
ObjectDataProvider provider = new ObjectDataProvider(pageBase, this.objectType);
provider.setQuery(context.getDataProviderQuery());
provider.setOptions(context.getDataProviderOptions());
TablePanel table = new TablePanel<>(ID_TABLE, provider, columns);
table.setOutputMarkupId(true);
addOrReplace(table);
AjaxButton cancelButton = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("chooseTypeDialog.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
modalWindow.close(ajaxRequestTarget);
}
};
add(cancelButton);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ObjectSelectionPanel method initColumns.
private List<IColumn<SelectableBean<ObjectType>, String>> initColumns() {
List<IColumn<SelectableBean<ObjectType>, String>> columns = new ArrayList<>();
IColumn column = new LinkColumn<SelectableBean<ObjectType>>(createStringResource("chooseTypeDialog.column.name"), context.getSortableProperty(), "value.name") {
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ObjectType>> rowModel) {
ObjectType object = rowModel.getObject().getValue();
context.chooseOperationPerformed(target, object);
}
};
columns.add(column);
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class ObjectHistoryTabPanel method initLayout.
private void initLayout(final LoadableModel<ObjectWrapper<F>> focusWrapperModel, final PageAdminObjectDetails<F> page) {
AuditSearchDto searchDto = new AuditSearchDto();
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(focusWrapperModel.getObject().getOid());
searchDto.setTargetNames(asList(ort));
searchDto.setEventStage(AuditEventStageType.EXECUTION);
Map<String, Boolean> visibilityMap = new HashMap<>();
visibilityMap.put(AuditLogViewerPanel.TARGET_NAME_LABEL_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.TARGET_NAME_FIELD_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.TARGET_OWNER_LABEL_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.TARGET_OWNER_FIELD_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.EVENT_STAGE_LABEL_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.EVENT_STAGE_FIELD_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.EVENT_STAGE_COLUMN_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.TARGET_COLUMN_VISIBILITY, false);
visibilityMap.put(AuditLogViewerPanel.TARGET_OWNER_COLUMN_VISIBILITY, false);
AuditLogViewerPanel panel = new AuditLogViewerPanel(ID_MAIN_PANEL, page, searchDto, visibilityMap) {
@Override
protected List<IColumn<AuditEventRecordType, String>> initColumns() {
List<IColumn<AuditEventRecordType, String>> columns = super.initColumns();
IColumn<AuditEventRecordType, String> column = new MultiButtonColumn<AuditEventRecordType>(new Model(), 2) {
private final DoubleButtonColumn.BUTTON_COLOR_CLASS[] colors = { DoubleButtonColumn.BUTTON_COLOR_CLASS.INFO, DoubleButtonColumn.BUTTON_COLOR_CLASS.SUCCESS };
@Override
public String getCaption(int id) {
return "";
}
@Override
public String getButtonTitle(int id) {
switch(id) {
case 0:
return page.createStringResource("ObjectHistoryTabPanel.viewHistoricalObjectDataTitle").getString();
case 1:
return page.createStringResource("ObjectHistoryTabPanel.viewHistoricalObjectXmlTitle").getString();
}
return "";
}
@Override
public String getButtonColorCssClass(int id) {
return colors[id].toString();
}
@Override
protected String getButtonCssClass(int id) {
StringBuilder sb = new StringBuilder();
sb.append(DoubleButtonColumn.BUTTON_BASE_CLASS).append(" ");
sb.append(getButtonColorCssClass(id)).append(" ");
switch(id) {
case 0:
sb.append("fa fa-circle-o");
break;
case 1:
sb.append("fa fa-file-text-o");
break;
}
return sb.toString();
}
@Override
public void clickPerformed(int id, AjaxRequestTarget target, IModel<AuditEventRecordType> model) {
switch(id) {
case 0:
currentStateButtonClicked(target, focusWrapperModel.getObject().getOid(), model.getObject().getEventIdentifier(), WebComponentUtil.getLocalizedDate(model.getObject().getTimestamp(), DateLabelComponent.SHORT_NOTIME_STYLE), page.getCompileTimeClass());
break;
case 1:
viewObjectXmlButtonClicked(focusWrapperModel.getObject().getOid(), model.getObject().getEventIdentifier(), page.getCompileTimeClass(), WebComponentUtil.getLocalizedDate(model.getObject().getTimestamp(), DateLabelComponent.SHORT_NOTIME_STYLE));
break;
}
}
};
columns.add(column);
return columns;
}
};
panel.setOutputMarkupId(true);
add(panel);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class SubtasksPanel method initLayout.
private void initLayout(boolean workflowsEnabled) {
List<IColumn<TaskDto, String>> columns = new ArrayList<IColumn<TaskDto, String>>();
columns.add(PageTasks.createTaskNameColumn(this, "SubtasksPanel.label.name"));
columns.add(PageTasks.createTaskCategoryColumn(this, "SubtasksPanel.label.category"));
columns.add(PageTasks.createTaskExecutionStatusColumn(this, "SubtasksPanel.label.executionState"));
columns.add(PageTasks.createTaskResultStatusColumn(this, "SubtasksPanel.label.result"));
//columns.add(PageTasks.createTaskDetailColumn(this, "SubtasksPanel.label.detail", workflowsEnabled));
ISortableDataProvider provider = new ListDataProvider(this, getModel());
add(new TablePanel<TaskDto>(ID_SUBTASKS_TABLE, provider, columns));
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method createMembersColumns.
protected List<IColumn<SelectableBean<ObjectType>, String>> createMembersColumns() {
List<IColumn<SelectableBean<ObjectType>, String>> columns = new ArrayList<>();
IColumn<SelectableBean<ObjectType>, String> column = new AbstractExportableColumn<SelectableBean<ObjectType>, String>(createStringResource("TreeTablePanel.fullName.displayName")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ObjectType>>> cellItem, String componentId, IModel<SelectableBean<ObjectType>> rowModel) {
SelectableBean<ObjectType> bean = rowModel.getObject();
ObjectType object = bean.getValue();
cellItem.add(new Label(componentId, getMemberObjectDisplayName(object)));
}
@Override
public IModel<String> getDataModel(IModel<SelectableBean<ObjectType>> rowModel) {
return Model.of(getMemberObjectDisplayName(rowModel.getObject().getValue()));
}
};
columns.add(column);
column = new AbstractExportableColumn<SelectableBean<ObjectType>, String>(createStringResource("TreeTablePanel.identifier.description")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ObjectType>>> cellItem, String componentId, IModel<SelectableBean<ObjectType>> rowModel) {
SelectableBean<ObjectType> bean = rowModel.getObject();
ObjectType object = bean.getValue();
cellItem.add(new Label(componentId, getMemberObjectIdentifier(object)));
}
@Override
public IModel<String> getDataModel(IModel<SelectableBean<ObjectType>> rowModel) {
return Model.of(getMemberObjectIdentifier(rowModel.getObject().getValue()));
}
};
columns.add(column);
return columns;
}
Aggregations