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