Search in sources :

Example 16 with IconButton

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

Example 17 with IconButton

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

the class PagerComponent method initComponents.

private void initComponents() {
    setSpacing(false);
    firstPageButton = new IconButton(VaadinIcons.FAST_BACKWARD);
    addComponent(firstPageButton);
    previousPageButton = new IconButton(VaadinIcons.BACKWARDS);
    addComponent(previousPageButton);
    pageInput = new NumberField(1);
    // $NON-NLS-1$
    pageInput.setStyleName("pager-pageinput");
    addComponent(pageInput);
    lastPageNumberLabel = new Label("N/A");
    addComponent(lastPageNumberLabel);
    this.setComponentAlignment(lastPageNumberLabel, Alignment.MIDDLE_LEFT);
    nextPageButton = new IconButton(VaadinIcons.FORWARD);
    addComponent(nextPageButton);
    lastPageButton = new IconButton(VaadinIcons.FAST_FORWARD);
    addComponent(lastPageButton);
}
Also used : IconButton(de.catma.ui.component.IconButton) Label(com.vaadin.ui.Label)

Example 18 with IconButton

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

the class EditPropertyTab method initComponents.

private void initComponents() {
    setSizeFull();
    setSpacing(true);
    setMargin(true);
    ArrayList<String> valueList = new ArrayList<>(proposedValueList);
    for (String value : property.getPropertyValueList()) {
        if (!valueList.contains(value)) {
            valueList.add(value);
        }
    }
    valueProvider = new ListDataProvider<>(valueList);
    valueGrid = new Grid<>("Assigned values", valueProvider);
    valueGrid.setSelectionMode(SelectionMode.MULTI);
    valueGrid.setSizeFull();
    valueGrid.asMultiSelect().selectItems(property.getPropertyValueList().toArray(new String[] {}));
    valueGrid.addColumn(value -> value.toString()).setCaption("Value");
    addComponent(valueGrid);
    VerticalLayout customValuePanel = new VerticalLayout();
    customValuePanel.setSizeFull();
    adhocValueArea = new TextArea("Add a custom value");
    adhocValueArea.setSizeFull();
    customValuePanel.addComponent(adhocValueArea);
    customValuePanel.setExpandRatio(adhocValueArea, 1.0f);
    btAdd = new IconButton(VaadinIcons.PLUS);
    btAdd.setDescription("Add another custom value");
    customValuePanel.addComponent(btAdd);
    customValuePanel.setComponentAlignment(btAdd, Alignment.TOP_RIGHT);
    addComponent(customValuePanel);
}
Also used : TextArea(com.vaadin.ui.TextArea) ListDataProvider(com.vaadin.data.provider.ListDataProvider) SelectionListener(com.vaadin.event.selection.SelectionListener) Property(de.catma.tag.Property) VerticalLayout(com.vaadin.ui.VerticalLayout) Alignment(com.vaadin.ui.Alignment) ArrayList(java.util.ArrayList) List(java.util.List) Type(com.vaadin.ui.Notification.Type) HorizontalLayout(com.vaadin.ui.HorizontalLayout) Notification(com.vaadin.ui.Notification) VaadinIcons(com.vaadin.icons.VaadinIcons) SelectionMode(com.vaadin.ui.Grid.SelectionMode) IconButton(de.catma.ui.component.IconButton) Grid(com.vaadin.ui.Grid) IconButton(de.catma.ui.component.IconButton) TextArea(com.vaadin.ui.TextArea) ArrayList(java.util.ArrayList) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 19 with IconButton

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

the class CatmaHeader method initComponents.

private void initComponents(IRemoteGitManagerPrivileged gitManagerPrivileged) {
    addStyleName("header");
    setWidth("100%");
    btHome = new Button("Catma " + Version.LATEST);
    btHome.addClickListener((evt) -> eventBus.post(new RouteToDashboardEvent()));
    btHome.addStyleNames(ValoTheme.BUTTON_LINK, ValoTheme.LABEL_H3);
    btHome.addStyleName("header-home-button");
    addComponent(btHome);
    setComponentAlignment(btHome, Alignment.MIDDLE_LEFT);
    contextInformation.addStyleName("header__context");
    addComponent(contextInformation);
    setComponentAlignment(contextInformation, Alignment.MIDDLE_CENTER);
    setExpandRatio(contextInformation, 1f);
    IconButton btnAccount = new IconButton(VaadinIcons.USER);
    btnAccount.setDescription(loginService.getAPI().getUser().getName());
    ContextMenu ctxAccount = new ContextMenu(btnAccount, true);
    ctxAccount.addItem("Edit Account", (item) -> {
        EditAccountDialog editAccount = new EditAccountDialog(gitManagerPrivileged, loginService, eventBus);
        editAccount.show();
    });
    ctxAccount.addItem("Get Access Token", (item) -> {
        AccessTokenDialog accessTokenDialog = new AccessTokenDialog(gitManagerPrivileged, loginService);
        accessTokenDialog.show();
    });
    ctxAccount.addItem("Sign Out", (item) -> {
        loginService.logout();
    });
    btnAccount.addClickListener((evt) -> ctxAccount.open(evt.getClientX(), evt.getClientY()));
    addComponent(btnAccount);
    setComponentAlignment(btHome, Alignment.MIDDLE_RIGHT);
}
Also used : EditAccountDialog(de.catma.ui.module.account.EditAccountDialog) AccessTokenDialog(de.catma.ui.module.account.AccessTokenDialog) IconButton(de.catma.ui.component.IconButton) Button(com.vaadin.ui.Button) IconButton(de.catma.ui.component.IconButton) ContextMenu(com.vaadin.contextmenu.ContextMenu) RouteToDashboardEvent(de.catma.ui.events.routing.RouteToDashboardEvent)

Example 20 with IconButton

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

the class ProjectListView method initComponents.

protected void initComponents() {
    helpWindow = new ProjectManagerHelpWindow();
    addStyleName("projectlist");
    projectsLayout.addStyleNames("projectlist__list");
    setSizeFull();
    HorizontalLayout descriptionBar = new HorizontalLayout();
    Label description = new Label("All Projects");
    Label title = new Label("Title");
    sortButton = new IconButton(VaadinIcons.ARROW_DOWN);
    descriptionBar.addComponent(description);
    descriptionBar.setExpandRatio(description, 1f);
    descriptionBar.addComponent(title);
    descriptionBar.addComponent(sortButton);
    descriptionBar.setComponentAlignment(sortButton, Alignment.MIDDLE_RIGHT);
    helpButton = new IconButton(VaadinIcons.QUESTION_CIRCLE);
    descriptionBar.addComponent(helpButton);
    descriptionBar.setComponentAlignment(helpButton, Alignment.MIDDLE_RIGHT);
    descriptionBar.setWidth("100%");
    addComponent(descriptionBar);
    addComponent(projectsLayout);
    setExpandRatio(projectsLayout, 1f);
}
Also used : IconButton(de.catma.ui.component.IconButton) Label(com.vaadin.ui.Label) 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