Search in sources :

Example 1 with HorizontalFlexLayout

use of de.catma.ui.layout.HorizontalFlexLayout in project catma by forTEXT.

the class SelectProjectDialog method addContent.

@Override
protected void addContent(ComponentContainer content) {
    VerticalLayout scrollPanel = new VerticalLayout();
    scrollPanel.setSizeFull();
    content.addComponent(scrollPanel);
    HorizontalFlexLayout projectsLayout = new HorizontalFlexLayout();
    projectsLayout.setSizeFull();
    scrollPanel.addComponent(projectsLayout);
    projectsLayout.addStyleNames("select-project-dialog-list");
    HorizontalLayout descriptionBar = new HorizontalLayout();
    Label description = new Label("Please select the target Project:");
    Label title = new Label("Title");
    Button sortButton = new IconButton(VaadinIcons.ARROW_DOWN);
    sortButton.addClickListener(evt -> {
        if (sortButton.getIcon().equals(VaadinIcons.ARROW_DOWN)) {
            selectedSortOrder = sortByNameDesc;
            sortButton.setIcon(VaadinIcons.ARROW_UP);
        } else {
            selectedSortOrder = sortByNameAsc;
            sortButton.setIcon(VaadinIcons.ARROW_DOWN);
        }
        initData(projectsLayout);
    });
    descriptionBar.addComponent(description);
    descriptionBar.setExpandRatio(description, 1f);
    descriptionBar.addComponent(title);
    descriptionBar.addComponent(sortButton);
    descriptionBar.setComponentAlignment(sortButton, Alignment.MIDDLE_RIGHT);
    descriptionBar.setWidth("100%");
    content.addComponent(descriptionBar);
    content.addComponent(scrollPanel);
    ((AbstractOrderedLayout) content).setExpandRatio(scrollPanel, 1f);
    getBtOk().setVisible(false);
    initData(projectsLayout);
}
Also used : IconButton(de.catma.ui.component.IconButton) Button(com.vaadin.ui.Button) IconButton(de.catma.ui.component.IconButton) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalFlexLayout(de.catma.ui.layout.HorizontalFlexLayout) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 2 with HorizontalFlexLayout

use of de.catma.ui.layout.HorizontalFlexLayout 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 3 with HorizontalFlexLayout

use of de.catma.ui.layout.HorizontalFlexLayout in project catma by forTEXT.

the class ProjectView method initComponents.

/* build the GUI */
private void initComponents() {
    progressBar = new ProgressBar();
    progressBar.setIndeterminate(false);
    progressBar.setVisible(false);
    addComponent(progressBar);
    setComponentAlignment(progressBar, Alignment.TOP_CENTER);
    HorizontalFlexLayout mainPanel = new HorizontalFlexLayout();
    mainPanel.setFlexWrap(FlexWrap.WRAP);
    mainPanel.addStyleName("project-view-main-panel");
    VerticalFlexLayout resourcePanel = new VerticalFlexLayout();
    // don't set width 100%
    resourcePanel.setSizeUndefined();
    resourcePanel.addComponent(new Label("Resources"));
    mainPanel.addComponent(resourcePanel);
    addComponent(mainPanel);
    setExpandRatio(mainPanel, 1.f);
    resourcePanel.addComponent(initResourceContent());
    teamPanel = new VerticalFlexLayout();
    // don't set width 100%
    teamPanel.setSizeUndefined();
    teamPanel.setVisible(false);
    teamPanel.addComponent(new Label("Team"));
    mainPanel.addComponent(teamPanel);
    teamPanel.addComponent(initTeamContent());
    btSynchBell = new IconButton(VaadinIcons.BELL);
    btSynchBell.addStyleName("project-view-synch-bell");
    getHugeCardBar().addComponentBeforeMoreOptions(btSynchBell);
    btSynchBell.setVisible(false);
}
Also used : VerticalFlexLayout(de.catma.ui.layout.VerticalFlexLayout) IconButton(de.catma.ui.component.IconButton) Label(com.vaadin.ui.Label) HorizontalFlexLayout(de.catma.ui.layout.HorizontalFlexLayout) ProgressBar(com.vaadin.ui.ProgressBar)

Example 4 with HorizontalFlexLayout

use of de.catma.ui.layout.HorizontalFlexLayout in project catma by forTEXT.

the class NotLoggedInMainView method initComponents.

private void initComponents() {
    setSizeFull();
    setAlignItems(AlignItems.CENTER);
    addStyleName("home");
    HorizontalFlexLayout menuLayout = new HorizontalFlexLayout();
    menuLayout.setWidth("100%");
    menuLayout.setJustifyContent(JustifyContent.FLEX_END);
    menuLayout.setAlignItems(AlignItems.CENTER);
    menuLayout.addStyleName("home__menu");
    // $NON-NLS-1$
    menuLayout.setWidth("100%");
    addComponent(menuLayout);
    Link aboutLink = new Link("About", new ExternalResource(CATMAPropertyKey.AboutURL.getValue(CATMAPropertyKey.AboutURL.getDefaultValue())));
    // $NON-NLS-1$
    aboutLink.setTargetName("_blank");
    menuLayout.addComponent(aboutLink);
    Link imprintLink = new Link("Imprint", new ExternalResource(CATMAPropertyKey.ImprintURL.getValue(CATMAPropertyKey.ImprintURL.getDefaultValue())));
    imprintLink.setTargetName("_blank");
    menuLayout.addComponent(imprintLink);
    Link termsOfUseLink = new Link("Terms of Use", new ExternalResource(CATMAPropertyKey.TermsOfUseURL.getValue(CATMAPropertyKey.TermsOfUseURL.getDefaultValue())));
    // $NON-NLS-1$
    termsOfUseLink.setTargetName("_blank");
    menuLayout.addComponent(termsOfUseLink);
    Link privacyLink = new Link("Privacy Policy", new ExternalResource(CATMAPropertyKey.PrivacyPolicyURL.getValue(CATMAPropertyKey.PrivacyPolicyURL.getDefaultValue())));
    privacyLink.setTargetName("_blank");
    menuLayout.addComponent(privacyLink);
    statusLink = new Link("Status", new ExternalResource(CATMAPropertyKey.StatusURL.getValue(CATMAPropertyKey.StatusURL.getDefaultValue())));
    statusLink.setTargetName("_blank");
    menuLayout.addComponent(statusLink);
    IconButton btHelp = new IconButton(VaadinIcons.QUESTION_CIRCLE, click -> {
        if (uiHelpWindow.getParent() == null) {
            UI.getCurrent().addWindow(uiHelpWindow);
        } else {
            UI.getCurrent().removeWindow(uiHelpWindow);
        }
    });
    menuLayout.addComponent(btHelp);
    VerticalFlexLayout contentPanel = new VerticalFlexLayout();
    // $NON-NLS-1$
    contentPanel.setHeight("100%");
    // $NON-NLS-1$
    contentPanel.addStyleName("home__content");
    // $NON-NLS-1$
    ThemeResource logoResource = new ThemeResource("catma-tailright-final-cmyk.svg");
    Image logoImage = new Image(null, logoResource);
    logoImage.setStyleName("not-logged-in-main-view-logo");
    contentPanel.addComponent(logoImage);
    noticePanelVerticalLayout = new VerticalLayout();
    noticePanelVerticalLayout.addStyleName("vlayout");
    HorizontalFlexLayout noticePanel = new HorizontalFlexLayout(noticePanelVerticalLayout);
    noticePanel.addStyleName("not-logged-in-main-view-noticepanel");
    noticePanel.setJustifyContent(JustifyContent.CENTER);
    contentPanel.addComponent(noticePanel);
    renderNotices();
    LabelButton btn_signup = new LabelButton("Sign up", event -> new SignUpDialog("Sign Up").show());
    LabelButton btn_login = new LabelButton("Sign in", event -> new AuthenticationDialog("Sign In", CATMAPropertyKey.BaseURL.getValue(CATMAPropertyKey.BaseURL.getDefaultValue()), loginService, initService, hazelCastService, sqliteService, eventBus).show());
    Link newsLetterLink = new Link("Newsletter", new ExternalResource("https://catma.de/newsletter/"));
    newsLetterLink.setTargetName("_blank");
    newsLetterLink.addStyleName("button__label");
    HorizontalFlexLayout buttonPanel = new HorizontalFlexLayout(btn_signup, btn_login, newsLetterLink);
    buttonPanel.addStyleName("home__content__btns");
    buttonPanel.setJustifyContent(JustifyContent.CENTER);
    contentPanel.addComponent(buttonPanel);
    addComponent(contentPanel);
    HorizontalFlexLayout bottomPanel = new HorizontalFlexLayout();
    bottomPanel.addStyleName("not-logged-in-main-view-fortext-bottom-panel");
    addComponent(bottomPanel);
    Link fortextButton = new Link("", new ExternalResource("https://fortext.net"));
    fortextButton.setIcon(new ThemeResource("fortext_logo.png"));
    fortextButton.setTargetName("_blank");
    fortextButton.addStyleName("not-logged-in-main-view-fortext-button");
    Label fortextLabel = new Label("developed and maintained</br>in cooperation with");
    fortextLabel.setContentMode(ContentMode.HTML);
    fortextLabel.addStyleName("not-logged-in-main-view-fortext-label");
    bottomPanel.addComponent(fortextLabel);
    bottomPanel.addComponent(fortextButton);
}
Also used : VerticalFlexLayout(de.catma.ui.layout.VerticalFlexLayout) IconButton(de.catma.ui.component.IconButton) SignUpDialog(de.catma.ui.module.main.signup.SignUpDialog) AuthenticationDialog(de.catma.ui.module.main.login.AuthenticationDialog) Label(com.vaadin.ui.Label) ThemeResource(com.vaadin.server.ThemeResource) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalFlexLayout(de.catma.ui.layout.HorizontalFlexLayout) Image(com.vaadin.ui.Image) LabelButton(de.catma.ui.component.LabelButton) ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link)

Example 5 with HorizontalFlexLayout

use of de.catma.ui.layout.HorizontalFlexLayout in project catma by forTEXT.

the class JoinProjectCard method initComponents.

private void initComponents() {
    addStyleName("projectlist__newproject");
    CssLayout newproject = new CssLayout();
    newproject.addStyleName("projectlist__newproject__link");
    Label labelDesc = new Label("join project");
    labelDesc.setWidth("100%");
    newproject.addComponents(labelDesc);
    newproject.addLayoutClickListener(evt -> {
        new JoinProjectDialog(currentUser, eventBus).show();
    });
    addComponent(newproject);
    HorizontalFlexLayout descriptionBar = new HorizontalFlexLayout();
    descriptionBar.addStyleName("projectlist__card__descriptionbar");
    descriptionBar.setAlignItems(FlexLayout.AlignItems.BASELINE);
    descriptionBar.setWidth("100%");
    addComponents(descriptionBar);
}
Also used : CssLayout(com.vaadin.ui.CssLayout) Label(com.vaadin.ui.Label) HorizontalFlexLayout(de.catma.ui.layout.HorizontalFlexLayout)

Aggregations

Label (com.vaadin.ui.Label)8 HorizontalFlexLayout (de.catma.ui.layout.HorizontalFlexLayout)7 IconButton (de.catma.ui.component.IconButton)5 VerticalFlexLayout (de.catma.ui.layout.VerticalFlexLayout)5 EventBus (com.google.common.eventbus.EventBus)4 VaadinIcons (com.vaadin.icons.VaadinIcons)3 Button (com.vaadin.ui.Button)3 CssLayout (com.vaadin.ui.CssLayout)3 ProgressBar (com.vaadin.ui.ProgressBar)3 UI (com.vaadin.ui.UI)3 ProjectManager (de.catma.project.ProjectManager)3 ProjectChangedEvent (de.catma.ui.events.ProjectChangedEvent)3 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)2 Multimap (com.google.common.collect.Multimap)2 Subscribe (com.google.common.eventbus.Subscribe)2 ContextMenu (com.vaadin.contextmenu.ContextMenu)2 TreeData (com.vaadin.data.TreeData)2 HierarchicalQuery (com.vaadin.data.provider.HierarchicalQuery)2 ListDataProvider (com.vaadin.data.provider.ListDataProvider)2 TreeDataProvider (com.vaadin.data.provider.TreeDataProvider)2