use of com.evolveum.midpoint.web.component.wizard.resource.dto.AttributeDto 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 link = new AjaxLink(ID_CLASS_LINK) {
@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 AbstractReadOnlyModel<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);
}
use of com.evolveum.midpoint.web.component.wizard.resource.dto.AttributeDto in project midpoint by Evolveum.
the class SchemaListPanel method loadAttributes.
private List<AttributeDto> loadAttributes() {
List<AttributeDto> list = new ArrayList<>();
ObjectClassDto selected = getSelectedObjectClass();
if (selected == null) {
return list;
}
for (ResourceAttributeDefinition def : selected.getDefinition().getAttributeDefinitions()) {
list.add(new AttributeDto(def));
}
return list;
}
Aggregations