// This would make our details view bookmarkable. However, the old design of the create/delete
// history makes determining what entity to use via an ID is not possible (the create/delete
// history is split into two tables). So, I'll just pop up the audit details in a dialog window.
setListGridDoubleClickHandler(new DoubleClickHandler() {
public void onDoubleClick(DoubleClickEvent event) {
ListGrid listGrid = (ListGrid) event.getSource();
ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
if (selectedRows != null && selectedRows.length == 1) {
String typeString = selectedRows[0].getAttribute(DataSource.Field.TYPE);
ChildHistoryDetails detailsView = null;
if (DataSource.TYPE_CREATE.equals(typeString)) {
CreateResourceHistory history = (CreateResourceHistory) selectedRows[0]
.getAttributeAsObject(DataSource.Field.OBJECT);
detailsView = new ChildHistoryDetails(history);
} else if (DataSource.TYPE_DELETE.equals(typeString)) {
DeleteResourceHistory history = (DeleteResourceHistory) selectedRows[0]
.getAttributeAsObject(DataSource.Field.OBJECT);
detailsView = new ChildHistoryDetails(history);
}
new DetailsWindow(detailsView).show();
}
}
});
ListGrid listGrid = getListGrid();
listGrid.setSortField(DataSource.Field.CREATED_DATE);
listGrid.setSortDirection(SortDirection.DESCENDING);
}