Search in sources :

Example 11 with ActionGridComponent

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));
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) BackgroundServiceProvider(de.catma.backgroundservice.BackgroundServiceProvider) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) Alignment(com.vaadin.ui.Alignment) UI(com.vaadin.ui.UI) XmlMarkupCollectionSerializationHandler(de.catma.serialization.intrinsic.xml.XmlMarkupCollectionSerializationHandler) SearchFilterProvider(de.catma.ui.component.actiongrid.SearchFilterProvider) ErrorHandler(de.catma.ui.module.main.ErrorHandler) TreeDataProvider(com.vaadin.data.provider.TreeDataProvider) VaadinIcons(com.vaadin.icons.VaadinIcons) IconButton(de.catma.ui.component.IconButton) Collection(java.util.Collection) Set(java.util.Set) TreeGrid(com.vaadin.ui.TreeGrid) Collectors(java.util.stream.Collectors) ItemClick(com.vaadin.ui.Grid.ItemClick) TagReference(de.catma.document.annotation.TagReference) Objects(java.util.Objects) List(java.util.List) Type(com.vaadin.ui.Notification.Type) RendererClickEvent(com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent) PropertyChangeListener(java.beans.PropertyChangeListener) TagDefinition(de.catma.tag.TagDefinition) Optional(java.util.Optional) SingleTextInputDialog(de.catma.ui.dialog.SingleTextInputDialog) CollectionChangeEvent(de.catma.project.event.CollectionChangeEvent) SelectionMode(com.vaadin.ui.Grid.SelectionMode) StyleGenerator(com.vaadin.ui.StyleGenerator) RBACPermission(de.catma.rbac.RBACPermission) PropertyDefinition(de.catma.tag.PropertyDefinition) VerticalLayout(com.vaadin.ui.VerticalLayout) AnnotationCollectionManager(de.catma.document.annotation.AnnotationCollectionManager) ComboBox(com.vaadin.ui.ComboBox) Multimap(com.google.common.collect.Multimap) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) EventBus(com.google.common.eventbus.EventBus) AddEditPropertyDialog(de.catma.ui.module.tags.AddEditPropertyDialog) MaterialTheme(com.github.appreciated.material.MaterialTheme) EditTagDialog(de.catma.ui.module.tags.EditTagDialog) Notification(com.vaadin.ui.Notification) Label(com.vaadin.ui.Label) TagsetDefinition(de.catma.tag.TagsetDefinition) Pair(de.catma.util.Pair) TreeGridFactory(de.catma.ui.component.TreeGridFactory) IDGenerator(de.catma.util.IDGenerator) Subscribe(com.google.common.eventbus.Subscribe) ButtonRenderer(com.vaadin.ui.renderers.ButtonRenderer) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) PropertyChangeEvent(java.beans.PropertyChangeEvent) ListDataProvider(com.vaadin.data.provider.ListDataProvider) TreeData(com.vaadin.data.TreeData) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) Project(de.catma.project.Project) AddSubtagDialog(de.catma.ui.module.tags.AddSubtagDialog) IOException(java.io.IOException) AddParenttagDialog(de.catma.ui.module.tags.AddParenttagDialog) SourceDocument(de.catma.document.source.SourceDocument) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) Annotation(de.catma.document.annotation.Annotation) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) ContextMenu(com.vaadin.contextmenu.ContextMenu) Button(com.vaadin.ui.Button) ChangeType(de.catma.project.event.ChangeType) HorizontalLayout(com.vaadin.ui.HorizontalLayout) SerializablePredicate(com.vaadin.server.SerializablePredicate) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) IconButton(de.catma.ui.component.IconButton) TreeGrid(com.vaadin.ui.TreeGrid) Label(com.vaadin.ui.Label) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

Label (com.vaadin.ui.Label)11 ActionGridComponent (de.catma.ui.component.actiongrid.ActionGridComponent)11 UI (com.vaadin.ui.UI)10 HtmlRenderer (com.vaadin.ui.renderers.HtmlRenderer)10 Project (de.catma.project.Project)10 ErrorHandler (de.catma.ui.module.main.ErrorHandler)10 Notification (com.vaadin.ui.Notification)9 Type (com.vaadin.ui.Notification.Type)9 SourceDocument (de.catma.document.source.SourceDocument)9 RBACPermission (de.catma.rbac.RBACPermission)9 SaveCancelListener (de.catma.ui.dialog.SaveCancelListener)9 List (java.util.List)9 Set (java.util.Set)9 Collectors (java.util.stream.Collectors)9 VaadinIcons (com.vaadin.icons.VaadinIcons)8 SelectionMode (com.vaadin.ui.Grid.SelectionMode)8 VerticalLayout (com.vaadin.ui.VerticalLayout)8 Collection (java.util.Collection)8 TreeData (com.vaadin.data.TreeData)7 ListDataProvider (com.vaadin.data.provider.ListDataProvider)7