Search in sources :

Example 1 with ActionGridComponent

use of de.catma.ui.component.actiongrid.ActionGridComponent in project catma by forTEXT.

the class ProjectView method initResourceContent.

/**
 * initialize the resource part
 * @return
 */
private Component initResourceContent() {
    HorizontalFlexLayout resourceContent = new HorizontalFlexLayout();
    documentGrid = TreeGridFactory.createDefaultTreeGrid();
    documentGrid.addStyleNames(// $NON-NLS-1$
    "flat-undecorated-icon-buttonrenderer");
    documentGrid.setHeaderVisible(false);
    documentGrid.setRowHeight(45);
    documentGrid.addColumn(resource -> resource.getIcon(), new HtmlRenderer()).setWidth(100);
    Function<Resource, String> buildNameFunction = (resource) -> {
        StringBuilder sb = new StringBuilder().append(// $NON-NLS-1$
        "<div class='documentsgrid__doc'> ").append(// $NON-NLS-1$
        "<div class='documentsgrid__doc__title'> ").append(resource.getName()).append(// $NON-NLS-1$
        "</div>");
        if (resource.hasDetail()) {
            sb.append(// $NON-NLS-1$
            "<span class='documentsgrid__doc__author'> ").append(resource.getDetail()).append(// $NON-NLS-1$
            "</span>");
        }
        // $NON-NLS-1$
        sb.append("</div>");
        return sb.toString();
    };
    documentGrid.addColumn(resource -> buildNameFunction.apply(resource), new HtmlRenderer()).setCaption("Name").setId(DocumentGridColumn.NAME.name()).setWidth(300);
    documentGrid.addColumn(res -> res.getPermissionIcon(), new HtmlRenderer()).setCaption("Permission").setExpandRatio(1);
    Label documentsAnnotations = new Label("Documents & Annotations");
    documentGridComponent = new ActionGridComponent<TreeGrid<Resource>>(documentsAnnotations, documentGrid);
    // $NON-NLS-1$
    documentGridComponent.addStyleName("project-view-action-grid");
    resourceContent.addComponent(documentGridComponent);
    tagsetGrid = new Grid<>();
    tagsetGrid.setHeaderVisible(false);
    // $NON-NLS-1$
    tagsetGrid.setWidth("400px");
    tagsetGrid.addColumn(tagset -> VaadinIcons.TAGS.getHtml(), new HtmlRenderer()).setWidth(100);
    tagsetGrid.addColumn(tagset -> tagset.getName()).setId(TagsetGridColumn.NAME.name()).setCaption("Name").setWidth(300);
    Label tagsetsAnnotations = new Label("Tagsets");
    tagsetGridComponent = new ActionGridComponent<Grid<TagsetDefinition>>(tagsetsAnnotations, tagsetGrid);
    // $NON-NLS-1$
    tagsetGridComponent.addStyleName("project-view-action-grid");
    resourceContent.addComponent(tagsetGridComponent);
    return resourceContent;
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) BackgroundServiceProvider(de.catma.backgroundservice.BackgroundServiceProvider) HTMLNotification(de.catma.ui.component.HTMLNotification) Alignment(com.vaadin.ui.Alignment) IndexedProject(de.catma.indexer.IndexedProject) MembersChangedEvent(de.catma.ui.events.MembersChangedEvent) HeaderContextChangeEvent(de.catma.ui.events.HeaderContextChangeEvent) RouteToTagsEvent(de.catma.ui.events.routing.RouteToTagsEvent) TreeDataProvider(com.vaadin.data.provider.TreeDataProvider) TagsetImport(de.catma.ui.module.project.documentwizard.TagsetImport) DocumentChangeEvent(de.catma.project.event.DocumentChangeEvent) CorpusImporter(de.catma.ui.module.project.corpusimport.CorpusImporter) CommitInfo(de.catma.project.CommitInfo) ExecutionListener(de.catma.backgroundservice.ExecutionListener) MenuBar(com.vaadin.ui.MenuBar) VerticalFlexLayout(de.catma.ui.layout.VerticalFlexLayout) Set(java.util.Set) RBACConstraint(de.catma.rbac.RBACConstraint) TagInstance(de.catma.tag.TagInstance) CorpusImportDocumentMetadata(de.catma.ui.module.project.corpusimport.CorpusImportDocumentMetadata) ItemClick(com.vaadin.ui.Grid.ItemClick) Stream(java.util.stream.Stream) Type(com.vaadin.ui.Notification.Type) PropertyChangeListener(java.beans.PropertyChangeListener) SingleTextInputDialog(de.catma.ui.dialog.SingleTextInputDialog) CollectionChangeEvent(de.catma.project.event.CollectionChangeEvent) CanReloadAll(de.catma.ui.module.main.CanReloadAll) SelectionMode(com.vaadin.ui.Grid.SelectionMode) DocumentWizard(de.catma.ui.module.project.documentwizard.DocumentWizard) HugeCard(de.catma.ui.component.hugecard.HugeCard) ProjectChangedEvent(de.catma.ui.events.ProjectChangedEvent) DefaultProgressCallable(de.catma.backgroundservice.DefaultProgressCallable) TagManager(de.catma.tag.TagManager) com.vaadin.server(com.vaadin.server) LocalDateTime(java.time.LocalDateTime) WizardContext(de.catma.ui.dialog.wizard.WizardContext) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) ArrayList(java.util.ArrayList) Member(de.catma.user.Member) Pair(de.catma.util.Pair) TreeGridFactory(de.catma.ui.component.TreeGridFactory) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) Collator(java.text.Collator) ProgressListener(de.catma.backgroundservice.ProgressListener) XML2ContentHandler(de.catma.document.source.contenthandler.XML2ContentHandler) Property(de.catma.tag.Property) TreeData(com.vaadin.data.TreeData) IOException(java.io.IOException) SourceDocument(de.catma.document.source.SourceDocument) ProjectReadyEvent(de.catma.project.event.ProjectReadyEvent) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) File(java.io.File) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) Button(com.vaadin.ui.Button) ChangeType(de.catma.project.event.ChangeType) CRC32(java.util.zip.CRC32) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) Grid(com.vaadin.ui.Grid) MenuItem(com.vaadin.ui.MenuBar.MenuItem) GenericUploadDialog(de.catma.ui.dialog.GenericUploadDialog) URISyntaxException(java.net.URISyntaxException) UI(com.vaadin.ui.UI) FlexWrap(de.catma.ui.layout.FlexLayout.FlexWrap) ConfirmDialog(org.vaadin.dialogs.ConfirmDialog) SearchFilterProvider(de.catma.ui.component.actiongrid.SearchFilterProvider) RouteToAnalyzeEvent(de.catma.ui.events.routing.RouteToAnalyzeEvent) TikaContentHandler(de.catma.document.source.contenthandler.TikaContentHandler) ByteArrayInputStream(java.io.ByteArrayInputStream) HorizontalFlexLayout(de.catma.ui.layout.HorizontalFlexLayout) ErrorHandler(de.catma.ui.module.main.ErrorHandler) Locale(java.util.Locale) CatmaApplication(de.catma.ui.CatmaApplication) VaadinIcons(com.vaadin.icons.VaadinIcons) Version(de.catma.tag.Version) RouteToConflictedProjectEvent(de.catma.ui.events.routing.RouteToConflictedProjectEvent) ProgressBar(com.vaadin.ui.ProgressBar) IconButton(de.catma.ui.component.IconButton) CATMAPropertyKey(de.catma.properties.CATMAPropertyKey) Collection(java.util.Collection) TreeGrid(com.vaadin.ui.TreeGrid) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) SourceDocumentInfo(de.catma.document.source.SourceDocumentInfo) ProjectReference(de.catma.project.ProjectReference) TagReference(de.catma.document.annotation.TagReference) List(java.util.List) CloseSafe(de.catma.util.CloseSafe) Corpus(de.catma.document.corpus.Corpus) TagDefinition(de.catma.tag.TagDefinition) RBACConstraintEnforcer(de.catma.rbac.RBACConstraintEnforcer) RouteToAnnotateEvent(de.catma.ui.events.routing.RouteToAnnotateEvent) Optional(java.util.Optional) FileType(de.catma.document.source.FileType) RBACPermission(de.catma.rbac.RBACPermission) CorpusImportDialog(de.catma.ui.module.project.corpusimport.CorpusImportDialog) ProjectManager(de.catma.project.ProjectManager) PropertyDefinition(de.catma.tag.PropertyDefinition) UploadFile(de.catma.ui.module.project.documentwizard.UploadFile) RBACRole(de.catma.rbac.RBACRole) Multimap(com.google.common.collect.Multimap) Function(java.util.function.Function) User(de.catma.user.User) Level(java.util.logging.Level) HashSet(java.util.HashSet) EventBus(com.google.common.eventbus.EventBus) Charset(java.nio.charset.Charset) Notification(com.vaadin.ui.Notification) Label(com.vaadin.ui.Label) TagsetDefinition(de.catma.tag.TagsetDefinition) IDGenerator(de.catma.util.IDGenerator) Subscribe(com.google.common.eventbus.Subscribe) TagLibrary(de.catma.tag.TagLibrary) PropertyChangeEvent(java.beans.PropertyChangeEvent) OpenProjectListener(de.catma.project.OpenProjectListener) ListDataProvider(com.vaadin.data.provider.ListDataProvider) FileOSType(de.catma.document.source.FileOSType) ClickEvent(com.vaadin.ui.Button.ClickEvent) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) Project(de.catma.project.Project) RepositoryChangeEvent(de.catma.project.Project.RepositoryChangeEvent) ConflictedProject(de.catma.project.conflict.ConflictedProject) TagsetDefinitionImportStatus(de.catma.serialization.TagsetDefinitionImportStatus) ContextMenu(com.vaadin.contextmenu.ContextMenu) SourceContentHandler(de.catma.document.source.contenthandler.SourceContentHandler) TagsetImportState(de.catma.ui.module.project.documentwizard.TagsetImportState) BOMFilterInputStream(de.catma.document.source.contenthandler.BOMFilterInputStream) DateTimeFormatter(java.time.format.DateTimeFormatter) HierarchicalQuery(com.vaadin.data.provider.HierarchicalQuery) Parameter(de.catma.ui.Parameter) Comparator(java.util.Comparator) Collections(java.util.Collections) BackgroundService(de.catma.backgroundservice.BackgroundService) InputStream(java.io.InputStream) Component(com.vaadin.ui.Component) Grid(com.vaadin.ui.Grid) TreeGrid(com.vaadin.ui.TreeGrid) Label(com.vaadin.ui.Label) TreeGrid(com.vaadin.ui.TreeGrid) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) HorizontalFlexLayout(de.catma.ui.layout.HorizontalFlexLayout)

Example 2 with ActionGridComponent

use of de.catma.ui.component.actiongrid.ActionGridComponent in project catma by forTEXT.

the class CorpusImportDialog method addContent.

@Override
protected void addContent(ComponentContainer content) {
    HorizontalLayout credentialPanel = new HorizontalLayout();
    content.addComponent(credentialPanel);
    nameField = new TextField("Username");
    credentialPanel.addComponent(nameField);
    passField = new PasswordField("Password");
    credentialPanel.addComponent(passField);
    btListCorpora = new Button("List Corpora");
    btListCorpora.addClickListener(event -> handleListCorpora());
    credentialPanel.addComponent(btListCorpora);
    corporaGrid = new Grid<CorpusImportMetadata>(corpusMetadataProvider);
    corporaGrid.setSizeFull();
    corporaGrid.addColumn(cm -> cm.getID()).setCaption("ID").setExpandRatio(1);
    corporaGrid.addColumn(cm -> cm.getName()).setCaption("Name").setExpandRatio(2);
    ActionGridComponent<Grid<CorpusImportMetadata>> corporaActionGridComponent = new ActionGridComponent<Grid<CorpusImportMetadata>>(new Label("Available Corpora"), corporaGrid);
    corporaActionGridComponent.setMargin(false);
    corporaActionGridComponent.getActionGridBar().setAddBtnVisible(false);
    corporaActionGridComponent.getActionGridBar().setMoreOptionsBtnVisible(false);
    corporaActionGridComponent.setSelectionModeFixed(SelectionMode.SINGLE);
    corporaActionGridComponent.getActionGridBar().setMargin(new MarginInfo(false, true, false, true));
    content.addComponent(corporaActionGridComponent);
    ((AbstractOrderedLayout) content).setExpandRatio(corporaActionGridComponent, 0.6f);
    this.progressBar = new ProgressBar();
    progressBar.setVisible(false);
    content.addComponent(progressBar);
}
Also used : Grid(com.vaadin.ui.Grid) Label(com.vaadin.ui.Label) HorizontalLayout(com.vaadin.ui.HorizontalLayout) Button(com.vaadin.ui.Button) MarginInfo(com.vaadin.shared.ui.MarginInfo) TextField(com.vaadin.ui.TextField) PasswordField(com.vaadin.ui.PasswordField) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) ProgressBar(com.vaadin.ui.ProgressBar) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout)

Example 3 with ActionGridComponent

use of de.catma.ui.component.actiongrid.ActionGridComponent in project catma by forTEXT.

the class TagResourcePanel method initComponents.

private void initComponents() {
    setWidth("400px");
    setHeight("100%");
    Label tagsetLabel = new Label("Tagsets");
    tagsetGrid = new Grid<>();
    tagsetGrid.addStyleNames("resource-grid", "flat-undecorated-icon-buttonrenderer", "no-focused-before-border");
    tagsetGrid.setSelectionMode(SelectionMode.MULTI);
    tagsetGrid.setSizeFull();
    tagsetGrid.addColumn(tagset -> tagset.getName()).setCaption("Name").setWidth(150);
    tagsetGrid.addColumn(tagset -> project.hasPermission(project.getRoleForTagset(tagset.getUuid()), RBACPermission.TAGSET_WRITE) ? VaadinIcons.UNLOCK.getHtml() : VaadinIcons.LOCK.getHtml(), new HtmlRenderer()).setWidth(50);
    tagsetGrid.addColumn(tagset -> VaadinIcons.TAGS.getHtml(), new HtmlRenderer()).setExpandRatio(1);
    tagsetActionGridComponent = new ActionGridComponent<Grid<TagsetDefinition>>(tagsetLabel, tagsetGrid);
    tagsetActionGridComponent.setSelectionModeFixed(SelectionMode.MULTI);
    tagsetActionGridComponent.getActionGridBar().setMargin(new MarginInfo(false, false, false, true));
    addComponent(tagsetActionGridComponent);
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) SelectionEvent(com.vaadin.event.selection.SelectionEvent) UI(com.vaadin.ui.UI) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) SearchFilterProvider(de.catma.ui.component.actiongrid.SearchFilterProvider) EventBus(com.google.common.eventbus.EventBus) ErrorHandler(de.catma.ui.module.main.ErrorHandler) Label(com.vaadin.ui.Label) TagsetDefinition(de.catma.tag.TagsetDefinition) VaadinIcons(com.vaadin.icons.VaadinIcons) Version(de.catma.tag.Version) IDGenerator(de.catma.util.IDGenerator) Subscribe(com.google.common.eventbus.Subscribe) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) PropertyChangeEvent(java.beans.PropertyChangeEvent) ListDataProvider(com.vaadin.data.provider.ListDataProvider) Project(de.catma.project.Project) Collection(java.util.Collection) RepositoryChangeEvent(de.catma.project.Project.RepositoryChangeEvent) ProjectReadyEvent(de.catma.project.event.ProjectReadyEvent) MarginInfo(com.vaadin.shared.ui.MarginInfo) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) PropertyChangeListener(java.beans.PropertyChangeListener) SerializablePredicate(com.vaadin.server.SerializablePredicate) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) SingleTextInputDialog(de.catma.ui.dialog.SingleTextInputDialog) SelectionMode(com.vaadin.ui.Grid.SelectionMode) RBACPermission(de.catma.rbac.RBACPermission) Grid(com.vaadin.ui.Grid) MarginInfo(com.vaadin.shared.ui.MarginInfo) Grid(com.vaadin.ui.Grid) Label(com.vaadin.ui.Label) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer)

Example 4 with ActionGridComponent

use of de.catma.ui.component.actiongrid.ActionGridComponent in project catma by forTEXT.

the class AnnotateResourcePanel method initComponents.

private void initComponents() {
    addStyleName("annotate-resource-panel");
    Label documentTreeLabel = new Label("Documents & Annotations");
    documentTree = TreeGridFactory.createDefaultTreeGrid();
    documentTree.addStyleNames("resource-grid", "flat-undecorated-icon-buttonrenderer");
    ButtonRenderer<DocumentTreeItem> documentSelectionRenderer = new ButtonRenderer<DocumentTreeItem>(documentSelectionClick -> handleVisibilityClickEvent(documentSelectionClick));
    documentSelectionRenderer.setHtmlContentAllowed(true);
    Column<DocumentTreeItem, String> selectionColumn = documentTree.addColumn(documentTreeItem -> documentTreeItem.getSelectionIcon(), documentSelectionRenderer).setWidth(100);
    documentTree.setHierarchyColumn(selectionColumn);
    documentTree.addColumn(documentTreeItem -> documentTreeItem.getName()).setCaption("Name").setWidth(150);
    documentTree.setHeight("250px");
    documentTree.addColumn(documentTreeItem -> documentTreeItem.getPermissionIcon(), new HtmlRenderer()).setWidth(50);
    documentTree.addColumn(documentTreeItem -> documentTreeItem.getIcon(), new HtmlRenderer()).setExpandRatio(1);
    documentActionGridComponent = new ActionGridComponent<TreeGrid<DocumentTreeItem>>(documentTreeLabel, documentTree);
    documentActionGridComponent.getActionGridBar().setMoreOptionsBtnVisible(false);
    addComponent(documentActionGridComponent);
    Label tagsetLabel = new Label("Tagsets");
    tagsetGrid = new Grid<>();
    tagsetGrid.addStyleNames("resource-grid", "flat-undecorated-icon-buttonrenderer", "no-focused-before-border");
    tagsetGrid.setHeight("250px");
    tagsetGrid.addColumn(tagset -> tagset.getName()).setCaption("Name").setWidth(150);
    tagsetGrid.addColumn(tagset -> project.hasPermission(project.getRoleForTagset(tagset.getUuid()), RBACPermission.TAGSET_WRITE) ? VaadinIcons.UNLOCK.getHtml() : VaadinIcons.LOCK.getHtml(), new HtmlRenderer()).setWidth(50);
    tagsetGrid.addColumn(tagset -> VaadinIcons.TAGS.getHtml(), new HtmlRenderer()).setExpandRatio(1);
    tagsetActionGridComponent = new ActionGridComponent<Grid<TagsetDefinition>>(tagsetLabel, tagsetGrid);
    tagsetActionGridComponent.setSelectionModeFixed(SelectionMode.MULTI);
    tagsetActionGridComponent.getActionGridBar().setMoreOptionsBtnVisible(false);
    tagsetActionGridComponent.getActionGridBar().setMargin(new MarginInfo(false, false, false, true));
    addComponent(tagsetActionGridComponent);
}
Also used : SelectionEvent(com.vaadin.event.selection.SelectionEvent) UI(com.vaadin.ui.UI) 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) DocumentChangeEvent(de.catma.project.event.DocumentChangeEvent) Version(de.catma.tag.Version) Collection(java.util.Collection) Set(java.util.Set) TreeGrid(com.vaadin.ui.TreeGrid) Collectors(java.util.stream.Collectors) MarginInfo(com.vaadin.shared.ui.MarginInfo) List(java.util.List) Type(com.vaadin.ui.Notification.Type) RendererClickEvent(com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent) PropertyChangeListener(java.beans.PropertyChangeListener) Optional(java.util.Optional) SingleTextInputDialog(de.catma.ui.dialog.SingleTextInputDialog) CollectionChangeEvent(de.catma.project.event.CollectionChangeEvent) SelectionMode(com.vaadin.ui.Grid.SelectionMode) RBACPermission(de.catma.rbac.RBACPermission) Column(com.vaadin.ui.Grid.Column) VerticalLayout(com.vaadin.ui.VerticalLayout) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) HashSet(java.util.HashSet) EventBus(com.google.common.eventbus.EventBus) Notification(com.vaadin.ui.Notification) Label(com.vaadin.ui.Label) TagsetDefinition(de.catma.tag.TagsetDefinition) 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) RepositoryChangeEvent(de.catma.project.Project.RepositoryChangeEvent) SourceDocument(de.catma.document.source.SourceDocument) ProjectReadyEvent(de.catma.project.event.ProjectReadyEvent) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) ChangeType(de.catma.project.event.ChangeType) SerializablePredicate(com.vaadin.server.SerializablePredicate) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) Collections(java.util.Collections) Grid(com.vaadin.ui.Grid) TreeGrid(com.vaadin.ui.TreeGrid) Grid(com.vaadin.ui.Grid) Label(com.vaadin.ui.Label) MarginInfo(com.vaadin.shared.ui.MarginInfo) TreeGrid(com.vaadin.ui.TreeGrid) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) ButtonRenderer(com.vaadin.ui.renderers.ButtonRenderer)

Example 5 with ActionGridComponent

use of de.catma.ui.component.actiongrid.ActionGridComponent in project catma by forTEXT.

the class KwicPanel method initComponents.

private void initComponents() {
    setSizeFull();
    setMargin(false);
    setSpacing(false);
    btExpandCompress = new IconButton(expandResource);
    btExpandCompress.setVisible(false);
    kwicDataProvider = new ListDataProvider<>(new HashSet<>());
    kwicGrid = new Grid<QueryResultRow>(kwicDataProvider);
    kwicGrid.setSizeFull();
    kwicGrid.addColumn(row -> kwicItemHandler.getDocumentName(row)).setCaption("Document").setWidth(200).setHidable(true);
    kwicGrid.addColumn(row -> kwicItemHandler.getCollectionName(row)).setCaption("Collection").setWidth(200).setId(ColumnId.COLLECION_NAME.name()).setHidable(true).setHidden(true);
    Column<QueryResultRow, ?> backwardCtxColumn = kwicGrid.addColumn(row -> kwicItemHandler.getBackwardContext(row)).setCaption("Left Context").setStyleGenerator(row -> kwicItemHandler.getBackwardContextStyle(row)).setWidth(200);
    Column<QueryResultRow, ?> keywordColumn = kwicGrid.addColumn(row -> kwicItemHandler.getKeyword(row)).setCaption("Keyword").setWidth(200).setRenderer(new HtmlRenderer()).setStyleGenerator(row -> kwicItemHandler.getKeywordStyle(row)).setDescriptionGenerator(row -> kwicItemHandler.getKeywordDescription(row), ContentMode.HTML);
    kwicGrid.addColumn(row -> kwicItemHandler.getForwardContext(row)).setCaption("Right Context").setStyleGenerator(row -> kwicItemHandler.getForwardContextStyle(row)).setWidth(200);
    kwicGrid.addColumn(row -> row.getRange().getStartPoint()).setCaption("Start Point").setWidth(100).setId(ColumnId.START_POS.name()).setHidable(true);
    kwicGrid.addColumn(row -> row.getRange().getEndPoint()).setCaption("End Point").setWidth(100).setHidable(true);
    kwicGrid.addColumn(row -> kwicItemHandler.getTagPath(row)).setCaption("Tag").setHidable(true).setHidden(true).setId(ColumnId.TAG.name()).setWidth(200);
    kwicGrid.addColumn(row -> kwicItemHandler.getPropertyName(row)).setCaption("Property").setHidable(true).setHidden(true).setId(ColumnId.PROPERTY_NAME.name()).setWidth(200);
    kwicGrid.addColumn(row -> kwicItemHandler.getPropertyValue(row)).setCaption("Value").setHidable(true).setHidden(true).setId(ColumnId.PROPERTY_VALUE.name()).setWidth(200);
    kwicGrid.sort(keywordColumn);
    kwicGrid.getDefaultHeaderRow().getCell(keywordColumn).setStyleName("kwic-panel-keyword-header");
    kwicGrid.getDefaultHeaderRow().getCell(backwardCtxColumn).setStyleName("kwic-panel-backwardctx-header");
    kwicGridComponent = new ActionGridComponent<>(new Label("Keyword in context"), kwicGrid);
    kwicGridComponent.getActionGridBar().setAddBtnVisible(false);
    kwicGridComponent.getActionGridBar().addButtonRight(btExpandCompress);
    kwicGridComponent.setMargin(new MarginInfo(false, false, false, true));
    addComponent(kwicGridComponent);
    setExpandRatio(kwicGridComponent, 1f);
    btnClearSelectedRows = new IconButton(VaadinIcons.ERASER);
    btnClearSelectedRows.setVisible(false);
    btnClearSelectedRows.setDescription("Remove the selected rows from this list");
}
Also used : BackgroundServiceProvider(de.catma.backgroundservice.BackgroundServiceProvider) DisplaySetting(de.catma.ui.module.analyze.queryresultpanel.DisplaySetting) MenuItem(com.vaadin.ui.MenuBar.MenuItem) LoadingCache(com.google.common.cache.LoadingCache) ZonedDateTime(java.time.ZonedDateTime) UI(com.vaadin.ui.UI) QueryResultRowArray(de.catma.queryengine.result.QueryResultRowArray) SearchFilterProvider(de.catma.ui.component.actiongrid.SearchFilterProvider) KwicProvider(de.catma.indexer.KwicProvider) ErrorHandler(de.catma.ui.module.main.ErrorHandler) Map(java.util.Map) TagQueryResultRow(de.catma.queryengine.result.TagQueryResultRow) VaadinIcons(com.vaadin.icons.VaadinIcons) Version(de.catma.tag.Version) AnnotationWizard(de.catma.ui.module.analyze.visualization.kwic.annotation.AnnotationWizard) IconButton(de.catma.ui.component.IconButton) ExpansionListener(de.catma.ui.module.analyze.visualization.ExpansionListener) Set(java.util.Set) TagInstance(de.catma.tag.TagInstance) Collectors(java.util.stream.Collectors) MarginInfo(com.vaadin.shared.ui.MarginInfo) ItemClick(com.vaadin.ui.Grid.ItemClick) ItemClickListener(com.vaadin.ui.components.grid.ItemClickListener) TagReference(de.catma.document.annotation.TagReference) CacheLoader(com.google.common.cache.CacheLoader) List(java.util.List) Type(com.vaadin.ui.Notification.Type) TagDefinition(de.catma.tag.TagDefinition) CacheBuilder(com.google.common.cache.CacheBuilder) SelectionMode(com.vaadin.ui.Grid.SelectionMode) RBACPermission(de.catma.rbac.RBACPermission) StreamResource(com.vaadin.server.StreamResource) Range(de.catma.document.Range) ClickListener(com.vaadin.ui.Button.ClickListener) Column(com.vaadin.ui.Grid.Column) VerticalLayout(com.vaadin.ui.VerticalLayout) AnnotationCollectionManager(de.catma.document.annotation.AnnotationCollectionManager) LocalDateTime(java.time.LocalDateTime) Query(com.vaadin.data.provider.Query) WizardContext(de.catma.ui.dialog.wizard.WizardContext) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) ActionGridBar(de.catma.ui.component.actiongrid.ActionGridBar) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) EventBus(com.google.common.eventbus.EventBus) Registration(com.vaadin.shared.Registration) Notification(com.vaadin.ui.Notification) Label(com.vaadin.ui.Label) IDGenerator(de.catma.util.IDGenerator) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) CSVExportGroupedStreamSource(de.catma.ui.module.analyze.CSVExportGroupedStreamSource) ListDataProvider(com.vaadin.data.provider.ListDataProvider) ContentMode(com.vaadin.shared.ui.ContentMode) Property(de.catma.tag.Property) ClickEvent(com.vaadin.ui.Button.ClickEvent) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) Project(de.catma.project.Project) QueryResultRow(de.catma.queryengine.result.QueryResultRow) SourceDocument(de.catma.document.source.SourceDocument) Visualization(de.catma.ui.module.analyze.visualization.Visualization) ContextMenu(com.vaadin.contextmenu.ContextMenu) QueryResultRowInAnnotateEvent(de.catma.ui.events.QueryResultRowInAnnotateEvent) DateTimeFormatter(java.time.format.DateTimeFormatter) FileDownloader(com.vaadin.server.FileDownloader) SerializablePredicate(com.vaadin.server.SerializablePredicate) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) CSVExportFlatStreamSource(de.catma.ui.module.analyze.CSVExportFlatStreamSource) AnnotationWizardContextKey(de.catma.ui.module.analyze.visualization.kwic.annotation.AnnotationWizardContextKey) Grid(com.vaadin.ui.Grid) IconButton(de.catma.ui.component.IconButton) TagQueryResultRow(de.catma.queryengine.result.TagQueryResultRow) QueryResultRow(de.catma.queryengine.result.QueryResultRow) MarginInfo(com.vaadin.shared.ui.MarginInfo) Label(com.vaadin.ui.Label) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) HashSet(java.util.HashSet)

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