use of org.ovirt.engine.ui.uicommonweb.models.AbstractErrataListModel in project ovirt-engine by oVirt.
the class ErrataTableView method createErrataTable.
private void createErrataTable() {
errataTable = new EntityModelCellTable<AbstractErrataListModel>(false, true) {
// Override the addSelectionChangeHandler method to prevent a class cast exception. The EntityModelCellTable
// expect to be handed a list of EntityModels, but the ErrataListModel is returning a list of Erratums. If
// I rework the list model to return EntityModel<Erratum> I get another class cast exception on something
// that expects it to return a straight Erratum.
public void addSelectionChangeHandler() {
// Handle selection
getSelectionModel().addSelectionChangeHandler(new Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
if (errataListModel == null || errataListModel.getItems() == null) {
return;
}
SelectionModel<?> selectionModel = errataTable.getSelectionModel();
Erratum selectedObject = (Erratum) ((SingleSelectionModel<?>) selectionModel).getSelectedObject();
clearCurrentSelectedItems();
if (selectedObject != null) {
errataListModel.setSelectedItem(selectedObject);
}
}
private void clearCurrentSelectedItems() {
errataListModel.setSelectedItems(null);
errataListModel.setSelectedItem(null);
}
});
}
};
}
use of org.ovirt.engine.ui.uicommonweb.models.AbstractErrataListModel in project ovirt-engine by oVirt.
the class ErrataListWithDetailsPopupPresenterWidget method init.
@Override
public void init(final AbstractErrataCountModel clickSource) {
super.init(clickSource);
AbstractErrataListModel model = modelProvider.getModel();
model.setItemsFilter(createFilter(clickSource.getFilterCommand()));
}
Aggregations