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");
}
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);
}
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);
}
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);
}
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);
}
Aggregations