use of de.catma.ui.component.actiongrid.ActionGridComponent in project catma by forTEXT.
the class AnnotationPanel method initComponents.
private void initComponents(Consumer<String> annotationSelectionListener) {
setSizeFull();
setSpacing(true);
currentEditableCollectionBox = new ComboBox<>("Collection currently being edited");
currentEditableCollectionBox.setWidth("100%");
currentEditableCollectionBox.setPlaceholder("Please select a Document first!");
btAddCollection = new IconButton(VaadinIcons.PLUS);
btAddCollection.setVisible(project.isAuthorizedOnProject(RBACPermission.COLLECTION_CREATE));
HorizontalLayout editableCollectionPanel = new HorizontalLayout(currentEditableCollectionBox, btAddCollection);
editableCollectionPanel.addStyleName("annotate-right-padding");
editableCollectionPanel.setWidth("100%");
editableCollectionPanel.setExpandRatio(currentEditableCollectionBox, 1.0f);
editableCollectionPanel.setComponentAlignment(btAddCollection, Alignment.BOTTOM_CENTER);
addComponent(editableCollectionPanel);
Label tagsetsLabel = new Label("Tagsets");
tagsetGrid = TreeGridFactory.createDefaultTreeGrid();
tagsetGrid.addStyleNames("flat-undecorated-icon-buttonrenderer");
tagsetGrid.setSizeFull();
tagsetGrid.setSelectionMode(SelectionMode.SINGLE);
tagsetGrid.addStyleName(MaterialTheme.GRID_BORDERLESS);
tagsetGridComponent = new ActionGridComponent<TreeGrid<TagsetTreeItem>>(tagsetsLabel, tagsetGrid);
tagsetGridComponent.setMargin(false);
rightSplitPanel = new VerticalSplitPanel();
rightSplitPanel.setSizeFull();
rightSplitPanel.setSplitPosition(90);
rightSplitPanel.setLocked(true);
addComponent(rightSplitPanel);
setExpandRatio(rightSplitPanel, 1.0f);
rightSplitPanel.addComponent(tagsetGridComponent);
btMaximizeAnnotationDetailsRibbon = new IconButton(VaadinIcons.ANGLE_DOUBLE_UP);
btMaximizeAnnotationDetailsRibbon.addStyleName("annotation-panel-button-right-align");
rightSplitPanel.addComponent(btMaximizeAnnotationDetailsRibbon);
annotationDetailsPanel = new AnnotationDetailsPanel(project, collectionManager, annotationSelectionListener, collectionId -> currentEditableCollectionBox.getValue() != null && currentEditableCollectionBox.getValue().getUuid().contentEquals(collectionId), collectionId -> handleCollectionChangeRequest(collectionId));
}
Aggregations