use of com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectClassDataProvider in project midpoint by Evolveum.
the class SchemaListPanel method initLayout.
protected void initLayout() {
final ObjectClassDataProvider dataProvider = new ObjectClassDataProvider(allClasses);
TextField objectClass = new TextField<>(ID_OBJECT_CLASS, new Model<>());
objectClass.setOutputMarkupId(true);
objectClass.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
updateSearchPerformed(target, dataProvider);
}
});
add(objectClass);
AjaxButton clearSearch = new AjaxButton(ID_CLEAR_SEARCH) {
@Override
public void onClick(AjaxRequestTarget target) {
clearSearchPerformed(target, dataProvider);
}
};
add(clearSearch);
WebMarkupContainer tableBody = new WebMarkupContainer(ID_TABLE_BODY);
tableBody.setOutputMarkupId(true);
add(tableBody);
DataView<ObjectClassDto> objectClassDataView = new DataView<ObjectClassDto>(ID_OBJECT_CLASS_LIST, dataProvider, UserProfileStorage.DEFAULT_PAGING_SIZE) {
@Override
protected void populateItem(final Item<ObjectClassDto> item) {
AjaxLink<Void> link = new AjaxLink<Void>(ID_CLASS_LINK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
objectClassClickPerformed(target, item.getModelObject());
}
};
item.add(link);
Label label = new Label(ID_LABEL, new PropertyModel<>(item.getModel(), ObjectClassDto.F_DISPLAY_NAME));
link.add(label);
item.add(AttributeModifier.replace("class", new IModel<Object>() {
@Override
public Object getObject() {
return item.getModelObject().isSelected() ? "success" : null;
}
}));
}
};
tableBody.add(objectClassDataView);
NavigatorPanel objectClassNavigator = new NavigatorPanel(ID_NAVIGATOR, objectClassDataView, true);
objectClassNavigator.setOutputMarkupId(true);
objectClassNavigator.setOutputMarkupPlaceholderTag(true);
add(objectClassNavigator);
WebMarkupContainer objectClassInfoContainer = new WebMarkupContainer(ID_OBJECT_CLASS_INFO_CONTAINER);
objectClassInfoContainer.setOutputMarkupId(true);
add(objectClassInfoContainer);
WebMarkupContainer objectClassInfoColumn = new WebMarkupContainer(ID_OBJECT_CLASS_INFO_COLUMN);
objectClassInfoColumn.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getSelectedObjectClass() != null;
}
});
objectClassInfoContainer.add(objectClassInfoColumn);
initDetailsPanel(objectClassInfoColumn);
ListDataProvider<AttributeDto> attributeProvider = new ListDataProvider<>(this, attributeModel, true);
attributeProvider.setSort(AttributeDto.F_DISPLAY_ORDER, SortOrder.ASCENDING);
BoxedTablePanel<AttributeDto> attributeTable = new BoxedTablePanel<>(ID_ATTRIBUTE_TABLE, attributeProvider, initColumns());
attributeTable.setOutputMarkupId(true);
attributeTable.setItemsPerPage(UserProfileStorage.DEFAULT_PAGING_SIZE);
attributeTable.setShowPaging(true);
objectClassInfoColumn.add(attributeTable);
}
Aggregations