Search in sources :

Example 6 with IconButton

use of de.catma.ui.component.IconButton 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)

Example 7 with IconButton

use of de.catma.ui.component.IconButton in project catma by forTEXT.

the class VegaPanel method initComponents.

private void initComponents(EventBus eventBus, LoadingCache<String, KwicProvider> kwicProviderCache) {
    setSizeFull();
    setSplitPosition(100);
    leftSplitPanel = new VerticalSplitPanel();
    addComponent(leftSplitPanel);
    HorizontalLayout leftTopPanel = new HorizontalLayout();
    leftTopPanel.setSizeFull();
    leftSplitPanel.addComponent(leftTopPanel);
    leftSplitPanel.setSplitPosition(100);
    this.vega = new Vega();
    this.vega.addStyleName("catma-embedded-vega");
    leftTopPanel.addComponent(this.vega);
    leftTopPanel.setExpandRatio(this.vega, 1f);
    btShowCode = new IconButton(VaadinIcons.CODE);
    leftTopPanel.addComponent(btShowCode);
    btExpandCompressTopLeft = new IconButton(VaadinIcons.EXPAND_SQUARE);
    leftTopPanel.addComponent(btExpandCompressTopLeft);
    VerticalLayout leftBottomPanel = new VerticalLayout();
    leftBottomPanel.setMargin(false);
    leftBottomPanel.setSizeFull();
    leftSplitPanel.addComponent(leftBottomPanel);
    kwicPanel = new KwicPanel(eventBus, project, kwicProviderCache);
    leftBottomPanel.addComponent(kwicPanel);
    kwicPanel.setExpandResource(VaadinIcons.ANGLE_DOUBLE_UP);
    kwicPanel.setCompressResource(VaadinIcons.ANGLE_DOUBLE_DOWN);
    kwicPanel.setBtnClearSelectedRowsVisible(true);
    VerticalLayout codePanel = new VerticalLayout();
    codePanel.setSizeFull();
    addComponent(codePanel);
    HorizontalLayout buttonPanel = new HorizontalLayout();
    codePanel.addComponent(buttonPanel);
    buttonPanel.setMargin(false);
    buttonPanel.setSpacing(true);
    buttonPanel.setWidth("100%");
    btHideCode = new IconButton(VaadinIcons.ANGLE_DOUBLE_RIGHT);
    buttonPanel.addComponent(btHideCode);
    buttonPanel.setComponentAlignment(btHideCode, Alignment.TOP_LEFT);
    buttonPanel.setExpandRatio(btHideCode, 1f);
    btHelp = new IconButton(VaadinIcons.QUESTION_CIRCLE);
    buttonPanel.addComponent(btHelp);
    buttonPanel.setComponentAlignment(btHelp, Alignment.TOP_RIGHT);
    btUpdate = new IconButton(VaadinIcons.REFRESH);
    buttonPanel.addComponent(btUpdate);
    buttonPanel.setComponentAlignment(btUpdate, Alignment.TOP_RIGHT);
    btExpandCompressRight = new IconButton(VaadinIcons.EXPAND_SQUARE);
    buttonPanel.addComponent(btExpandCompressRight);
    buttonPanel.setComponentAlignment(btExpandCompressRight, Alignment.TOP_RIGHT);
    VerticalLayout queryResultInfoPanel = new VerticalLayout();
    queryResultInfoPanel.setWidth("100%");
    queryResultInfoPanel.setSpacing(true);
    codePanel.addComponent(queryResultInfoPanel);
    TextField queryResultUrlField = new TextField(MessageFormat.format("Data URL of your selection or use {0} placeholder for custom queries", CATMA_QUERY_URL), queryResultUrl);
    queryResultUrlField.setReadOnly(true);
    queryResultUrlField.setWidth("100%");
    queryResultInfoPanel.addComponent(queryResultUrlField);
    cbPublicExposure = new CheckBox("Expose the selected data for access in the Vega Online Editor");
    queryResultInfoPanel.addComponent(cbPublicExposure);
    specEditor = new TextArea("Vega Specification");
    specEditor.setSizeFull();
    codePanel.addComponent(specEditor);
    codePanel.setExpandRatio(specEditor, 1f);
}
Also used : IconButton(de.catma.ui.component.IconButton) KwicPanel(de.catma.ui.module.analyze.visualization.kwic.KwicPanel) TextArea(com.vaadin.ui.TextArea) CheckBox(com.vaadin.ui.CheckBox) VerticalLayout(com.vaadin.ui.VerticalLayout) TextField(com.vaadin.ui.TextField) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 8 with IconButton

use of de.catma.ui.component.IconButton in project catma by forTEXT.

the class DoubleTreePanel method initComponents.

private void initComponents() {
    setSizeFull();
    setMargin(true);
    setSpacing(true);
    HorizontalLayout headerPanel = new HorizontalLayout();
    headerPanel.setSpacing(true);
    headerPanel.setWidth("100%");
    cbCaseSensitive = new CheckBox("case sensitive", true);
    headerPanel.addComponent(cbCaseSensitive);
    headerPanel.setComponentAlignment(cbCaseSensitive, Alignment.TOP_LEFT);
    Link citeLink = new Link("About DoubleTreeJS", new ExternalResource("http://linguistics.chrisculy.net/lx/software/DoubleTreeJS/index.html"));
    // $NON-NLS-1$
    citeLink.setTargetName("_blank");
    headerPanel.addComponent(citeLink);
    headerPanel.setComponentAlignment(citeLink, Alignment.TOP_CENTER);
    btExpandCompressRight = new IconButton(VaadinIcons.EXPAND_SQUARE);
    headerPanel.addComponent(btExpandCompressRight);
    headerPanel.setComponentAlignment(btExpandCompressRight, Alignment.TOP_RIGHT);
    addComponent(headerPanel);
    setComponentAlignment(headerPanel, Alignment.TOP_CENTER);
    doubleTree = new DoubleTree();
    doubleTree.setSizeFull();
    addComponent(doubleTree);
    setExpandRatio(doubleTree, 1f);
}
Also used : IconButton(de.catma.ui.component.IconButton) CheckBox(com.vaadin.ui.CheckBox) ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 9 with IconButton

use of de.catma.ui.component.IconButton in project catma by forTEXT.

the class RefreshQueryResultPanel method initComponents.

private void initComponents() {
    addStyleName("analyze-card");
    setMargin(false);
    setSpacing(false);
    queryInfo = new Label(queryId.toString());
    queryInfo.addStyleName("analyze-card-infobar");
    addComponent(queryInfo);
    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setWidth("100%");
    refreshButton = new IconButton(VaadinIcons.REFRESH);
    refreshButton.addStyleName("refresh-query-result-panel-refresh-button");
    buttonPanel.addComponent(refreshButton);
    TextField searchField = new TextField();
    searchField.setPlaceholder("\u2315");
    searchField.setEnabled(false);
    buttonPanel.addComponent(searchField);
    buttonPanel.setComponentAlignment(searchField, Alignment.MIDDLE_RIGHT);
    buttonPanel.setExpandRatio(searchField, 1f);
    IconButton caretRightBt = new IconButton(VaadinIcons.CARET_RIGHT);
    caretRightBt.setEnabled(false);
    IconButton optionsBt = new IconButton(VaadinIcons.ELLIPSIS_DOTS_V);
    optionsBt.setEnabled(false);
    removeBt = new IconButton(VaadinIcons.ERASER);
    buttonPanel.addComponents(removeBt, optionsBt, caretRightBt);
    buttonPanel.setComponentAlignment(caretRightBt, Alignment.MIDDLE_RIGHT);
    buttonPanel.setComponentAlignment(optionsBt, Alignment.MIDDLE_RIGHT);
    buttonPanel.setComponentAlignment(removeBt, Alignment.MIDDLE_RIGHT);
    buttonPanel.addStyleName("analyze-card-buttonbar");
    searchField.setEnabled(false);
    addComponent(buttonPanel);
}
Also used : IconButton(de.catma.ui.component.IconButton) Label(com.vaadin.ui.Label) TextField(com.vaadin.ui.TextField) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 10 with IconButton

use of de.catma.ui.component.IconButton in project catma by forTEXT.

the class QueryResultPanel method createButtonBar.

private void createButtonBar(boolean cardStyle) {
    buttonPanel = new HorizontalLayout();
    buttonPanel.setWidth("100%");
    searchField = new TextField();
    searchField.setPlaceholder("\u2315");
    buttonPanel.addComponent(searchField);
    buttonPanel.setComponentAlignment(searchField, Alignment.MIDDLE_RIGHT);
    buttonPanel.setExpandRatio(searchField, 1f);
    caretRightBt = new IconButton(VaadinIcons.CARET_RIGHT);
    caretRightBt.setVisible(cardStyle);
    caretDownBt = new IconButton(VaadinIcons.CARET_DOWN);
    caretDownBt.setVisible(cardStyle);
    optionsBt = new IconButton(VaadinIcons.ELLIPSIS_DOTS_V);
    optionsMenu = new ContextMenu(optionsBt, true);
    removeBt = new IconButton(VaadinIcons.ERASER);
    buttonPanel.addComponents(removeBt, optionsBt, caretRightBt);
    buttonPanel.setComponentAlignment(caretRightBt, Alignment.MIDDLE_RIGHT);
    buttonPanel.setComponentAlignment(optionsBt, Alignment.MIDDLE_RIGHT);
    buttonPanel.setComponentAlignment(removeBt, Alignment.MIDDLE_RIGHT);
    if (cardStyle) {
        buttonPanel.addStyleName("analyze-card-buttonbar");
        searchField.setEnabled(false);
    } else {
        buttonPanel.addStyleName("analyze-query-result-panel-buttonbar");
    }
    addComponent(buttonPanel);
}
Also used : IconButton(de.catma.ui.component.IconButton) TextField(com.vaadin.ui.TextField) ContextMenu(com.vaadin.contextmenu.ContextMenu) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

IconButton (de.catma.ui.component.IconButton)20 HorizontalLayout (com.vaadin.ui.HorizontalLayout)13 Label (com.vaadin.ui.Label)11 VerticalLayout (com.vaadin.ui.VerticalLayout)10 VaadinIcons (com.vaadin.icons.VaadinIcons)7 Button (com.vaadin.ui.Button)6 Notification (com.vaadin.ui.Notification)5 Type (com.vaadin.ui.Notification.Type)5 TextField (com.vaadin.ui.TextField)5 UI (com.vaadin.ui.UI)5 Project (de.catma.project.Project)5 MarginInfo (com.vaadin.shared.ui.MarginInfo)4 Alignment (com.vaadin.ui.Alignment)4 VerticalSplitPanel (com.vaadin.ui.VerticalSplitPanel)4 AnnotationCollectionManager (de.catma.document.annotation.AnnotationCollectionManager)4 SourceDocument (de.catma.document.source.SourceDocument)4 KwicProvider (de.catma.indexer.KwicProvider)4 RBACPermission (de.catma.rbac.RBACPermission)4 Property (de.catma.tag.Property)4 TagDefinition (de.catma.tag.TagDefinition)4