use of com.haulmont.cuba.gui.components.data.meta.ContainerDataUnit in project cuba by cuba-platform.
the class TestCommentaryPanel method addMessage.
private void addMessage(String text) {
if (getCommentProvider() == null) {
return;
}
Comment comment = getCommentProvider().apply(text);
DataGridItems<Comment> items = commentsDataGrid.getItems();
if (items instanceof ContainerDataUnit) {
// noinspection unchecked
CollectionContainer<Comment> container = ((ContainerDataUnit<Comment>) items).getContainer();
container.getMutableItems().add(comment);
} else {
throw new IllegalStateException("Items must implement com.haulmont.cuba.gui.components.data.meta.ContainerDataUnit");
}
}
use of com.haulmont.cuba.gui.components.data.meta.ContainerDataUnit in project cuba by cuba-platform.
the class TestProgrammaticCommentaryPanel method addMessage.
private void addMessage(String text) {
if (getCommentProvider() == null) {
return;
}
Comment comment = getCommentProvider().apply(text);
DataGridItems<Comment> items = commentsDataGrid.getItems();
if (items instanceof ContainerDataUnit) {
// noinspection unchecked
CollectionContainer<Comment> container = ((ContainerDataUnit<Comment>) items).getContainer();
container.getMutableItems().add(comment);
} else {
throw new IllegalStateException("Items must implement com.haulmont.cuba.gui.components.data.meta.ContainerDataUnit");
}
}
Aggregations