Example usage for com.vaadin.ui CustomLayout CustomLayout

List of usage examples for com.vaadin.ui CustomLayout CustomLayout

Introduction

In this page you can find the example usage for com.vaadin.ui CustomLayout CustomLayout.

Prototype

public CustomLayout(String template) 

Source Link

Document

Constructor for custom layout with given template name.

Usage

From source file:de.openflorian.web.viewport.AlarmViewBrowser.java

License:Open Source License

@Override
public void init() {
    try {/*from   w w  w .  ja va2  s. c o  m*/
        layout = new CustomLayout(
                VelocityUtils.getRenderedTemplate("VAADIN/themes/" + view.getTheme() + "/layouts/alarm.html"));

        layout.addComponent(keyword, "keyword");
        layout.addComponent(buzzword, "buzzword");
        layout.addComponent(currentTime, "currentTime");
        layout.addComponent(operationNr, "operationNr");
        // layout.addComponent(object, "object");
        layout.addComponent(city, "city");
        layout.addComponent(street, "street");

        layout.addComponent(resourcesBox, "resources");
        layout.addComponent(externalResourcesBox, "externalResources");
        layout.addComponent(map, "map");

        map.addLayer(mapLayer);

        this.addComponent(layout);
        printAlarm(currentOperation);
    } catch (final Exception e) {
        log.error(e.getMessage(), e);
        throw new RuntimeException(e);
    }
}

From source file:de.symeda.sormas.ui.AboutView.java

License:Open Source License

public AboutView() {
    CustomLayout aboutContent = new CustomLayout("aboutview");
    aboutContent.setStyleName("about-content");

    // Info section
    VerticalLayout infoLayout = new VerticalLayout();
    infoLayout.setSpacing(false);/*from   w  ww. jav  a2s .c  o m*/
    infoLayout.setMargin(false);
    aboutContent.addComponent(infoLayout, "info");

    Label versionLabel = new Label(VaadinIcons.INFO_CIRCLE.getHtml() + " "
            + I18nProperties.getCaption(Captions.aboutSormasVersion) + ": " + InfoProvider.get().getVersion(),
            ContentMode.HTML);
    infoLayout.addComponent(versionLabel);

    Link whatsNewLink = new Link(I18nProperties.getCaption(Captions.aboutWhatsNew),
            new ExternalResource(
                    "https://github.com/hzi-braunschweig/SORMAS-Project/releases/tag/releases%2Fversion-"
                            + InfoProvider.get().getBaseVersion()));
    whatsNewLink.setTargetName("_blank");
    infoLayout.addComponent(whatsNewLink);

    Link sormasWebsiteLink = new Link(I18nProperties.getCaption(Captions.aboutSormasWebsite),
            new ExternalResource("https://sormasorg.helmholtz-hzi.de/"));
    sormasWebsiteLink.setTargetName("_blank");
    infoLayout.addComponent(sormasWebsiteLink);

    Link sormasGithubLink = new Link("SORMAS Github",
            new ExternalResource("https://github.com/hzi-braunschweig/SORMAS-Project"));
    sormasGithubLink.setTargetName("_blank");
    infoLayout.addComponent(sormasGithubLink);

    Link changelogLink = new Link(I18nProperties.getCaption(Captions.aboutChangelog),
            new ExternalResource("https://github.com/hzi-braunschweig/SORMAS-Project/releases"));
    changelogLink.setTargetName("_blank");
    infoLayout.addComponent(changelogLink);

    // Documents section
    VerticalLayout documentsLayout = new VerticalLayout();
    documentsLayout.setSpacing(false);
    documentsLayout.setMargin(false);
    aboutContent.addComponent(documentsLayout, "documents");

    Button classificationDocumentButton = new Button(
            I18nProperties.getCaption(Captions.aboutCaseClassificationRules));
    CssStyles.style(classificationDocumentButton, ValoTheme.BUTTON_LINK, CssStyles.BUTTON_COMPACT);
    documentsLayout.addComponent(classificationDocumentButton);

    try {
        String serverUrl = new URL(((VaadinServletRequest) VaadinService.getCurrentRequest())
                .getHttpServletRequest().getRequestURL().toString()).getAuthority();
        StreamResource classificationResource = DownloadUtil.createStringStreamResource(
                ClassificationHtmlRenderer.createHtmlForDownload(serverUrl,
                        FacadeProvider.getDiseaseConfigurationFacade().getAllActivePrimaryDiseases()),
                "classification_rules.html", "text/html");
        new FileDownloader(classificationResource).extend(classificationDocumentButton);
    } catch (MalformedURLException e) {

    }

    Button dataDictionaryButton = new Button(I18nProperties.getCaption(Captions.aboutDataDictionary));
    CssStyles.style(dataDictionaryButton, ValoTheme.BUTTON_LINK, CssStyles.BUTTON_COMPACT);
    documentsLayout.addComponent(dataDictionaryButton);
    FileDownloader dataDictionaryDownloader = new FileDownloader(
            new ClassResource("/doc/SORMAS_Data_Dictionary.xlsx"));
    dataDictionaryDownloader.extend(dataDictionaryButton);

    Link technicalManualLink = new Link(I18nProperties.getCaption(Captions.aboutTechnicalManual),
            new ExternalResource(
                    "https://github.com/hzi-braunschweig/SORMAS-Project/files/2585973/SORMAS_Technical_Manual_Webversion_20180911.pdf"));
    technicalManualLink.setTargetName("_blank");
    documentsLayout.addComponent(technicalManualLink);

    setSizeFull();
    setStyleName("about-view");
    addComponent(aboutContent);
    setComponentAlignment(aboutContent, Alignment.MIDDLE_CENTER);
}

From source file:eu.livotov.tpt.gui.dialogs.ui.DownloadDialogButtonsComponent.java

License:Apache License

private void initUI() {
    try {/*from w w  w.j a v  a  2s . co  m*/
        layout = new CustomLayout(DownloadDialogButtonsComponent.class
                .getResourceAsStream("DownloadDialogButtonsComponentLayout.html"));
    } catch (IOException e) {
        throw new RuntimeException("Unexpected absense of default layout: " + e.getMessage());
    }

    setCompositionRoot(layout);

    layout.addComponent(message, "ddbc.message");
    layout.addComponent(link, "ddbc.link");
    layout.addComponent(btnClose, "ddbc.btn.close");

    link.setIcon(new ClassResource(DownloadDialogButtonsComponent.class, "download.png", appReference));
    link.setTargetName("_new");
}

From source file:eu.livotov.tpt.gui.dialogs.ui.InputDialogButtonsComponent.java

License:Apache License

private void initUI() {
    try {/*from w ww .j  av a2  s  .c om*/
        layout = new CustomLayout(InputDialogButtonsComponent.class
                .getResourceAsStream("InputDialogButtonsComponentLayout.html"));
    } catch (IOException e) {
        throw new RuntimeException("Unexpected absense of default layout: " + e.getMessage());
    }

    setCompositionRoot(layout);

    layout.addComponent(message, "idbc.message");
    layout.addComponent(btnOk, "idbc.btn.ok");
    layout.addComponent(btnCancel, "idbc.btn.cancel");
    layout.addComponent(input, "idbc.input");

    input.setWidth("100%");

    btnOk.setData(OptionKind.OK);
    btnCancel.setData(OptionKind.CANCEL);
}

From source file:eu.livotov.tpt.gui.dialogs.ui.OptionDialogButtonsComponent.java

License:Apache License

private void initUI() {
    try {// w  ww  .  j a va2 s  . c  o  m
        layout = new CustomLayout(OptionDialogButtonsComponent.class
                .getResourceAsStream("OptionDialogButtonsComponentLayout.html"));
    } catch (IOException e) {
        throw new RuntimeException("Unexpected absense of default layout: " + e.getMessage());
    }

    setCompositionRoot(layout);

    layout.addComponent(message, "odbc.message");
    layout.addComponent(btnOk, "odbc.btn.ok");
    layout.addComponent(btnCancel, "odbc.btn.cancel");
    layout.addComponent(btnYes, "odbc.btn.yes");
    layout.addComponent(btnNo, "odbc.btn.no");

    btnOk.setData(OptionKind.OK);
    btnCancel.setData(OptionKind.CANCEL);
    btnYes.setData(OptionKind.YES);
    btnNo.setData(OptionKind.NO);
}

From source file:info.joseluismartin.gtc.admin.AdminApplication.java

License:Apache License

/**
 * {@inheritDoc}//  w w w  .j  a  v a2s . c  o  m
 */
@Override
public void init() {
    ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(
            ((WebApplicationContext) getContext()).getHttpSession().getServletContext());
    TilaGuiFactory guiFactory = (TilaGuiFactory) ctx.getBean("guiFactory");
    setTheme("tila");
    Window mainWindow = new Window("Tila Administration");
    CustomLayout cl = new CustomLayout("main");
    Component main = guiFactory.getComponent("main");
    cl.addComponent(main, "main");
    cl.setSizeFull();
    mainWindow.setContent(cl);
    setMainWindow(mainWindow);
}

From source file:it.vige.greenarea.bpm.custom.ui.home.HomePage.java

License:Apache License

protected Component getIntroComponent() {
    return new CustomLayout("intro");
}

From source file:it.vige.greenarea.bpm.custom.ui.home.HomePage.java

License:Apache License

protected Component getNewsComponent() {
    return new CustomLayout("news");
}

From source file:it.vige.greenarea.bpm.custom.ui.mainlayout.GreenareaMainLayout.java

License:Apache License

@Override
protected void initHeader() {
    customLayout = new CustomLayout("home");
    addComponent(customLayout);//from www  . java2 s  . c  o m
    initTitle2();

    this.mainMenuBar = get().getComponentFactory(MainMenuBarFactory.class).create();
    customLayout.addComponent(mainMenuBar, "nav");

}

From source file:it.vige.greenarea.bpm.custom.ui.mainlayout.GreenareaMainLayout.java

License:Apache License

protected void initTitle2() {
    CustomLayout title = null;// w  ww.j  a  v  a 2  s .  c  o m
    UserConverter userConverter = new UserConverter();
    if (userConverter.isUserInGroup(get().getLoggedInUser().getGroups(), PA)) {

        if (userConverter.isUserInGroup(get().getLoggedInUser().getGroups(), GUIDONIA))
            title = new CustomLayout("logoguidonia");
        else if (userConverter.isUserInGroup(get().getLoggedInUser().getGroups(), POMEZIA))
            title = new CustomLayout("logopomezia");
        else if (userConverter.isUserInGroup(get().getLoggedInUser().getGroups(), LIVORNO))
            title = new CustomLayout("logolivorno");
        customLayout.addComponent(title, "logo");

    }
}