Example usage for com.vaadin.ui CustomLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:de.symeda.sormas.ui.caze.CaseDataView.java

License:Open Source License

@Override
public void enter(ViewChangeEvent event) {
    super.enter(event);
    setHeightUndefined();/*from w  ww . j a  v  a  2  s  .c  o m*/

    CaseDataDto caze = FacadeProvider.getCaseFacade().getCaseDataByUuid(getCaseRef().getUuid());

    String htmlLayout = LayoutUtil.fluidRow(LayoutUtil.fluidColumnLoc(8, 0, 12, 0, CASE_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, TASKS_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, SAMPLES_LOC));

    VerticalLayout container = new VerticalLayout();
    container.setWidth(100, Unit.PERCENTAGE);
    container.setMargin(true);
    setSubComponent(container);
    CustomLayout layout = new CustomLayout();
    layout.addStyleName(CssStyles.ROOT_COMPONENT);
    layout.setTemplateContents(htmlLayout);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setHeightUndefined();
    container.addComponent(layout);

    CommitDiscardWrapperComponent<?> editComponent;
    if (getViewMode() == ViewMode.SIMPLE) {
        editComponent = ControllerProvider.getCaseController()
                .getCaseCombinedEditComponent(getCaseRef().getUuid(), ViewMode.SIMPLE);
    } else {
        editComponent = ControllerProvider.getCaseController().getCaseDataEditComponent(getCaseRef().getUuid(),
                ViewMode.NORMAL);
    }

    // setSubComponent(editComponent);
    editComponent.setMargin(false);
    editComponent.setWidth(100, Unit.PERCENTAGE);
    editComponent.getWrappedComponent().setWidth(100, Unit.PERCENTAGE);
    editComponent.addStyleName(CssStyles.MAIN_COMPONENT);
    layout.addComponent(editComponent, CASE_LOC);

    TaskListComponent taskList = new TaskListComponent(TaskContext.CASE, getCaseRef());
    taskList.addStyleName(CssStyles.SIDE_COMPONENT);
    layout.addComponent(taskList, TASKS_LOC);

    if (UserProvider.getCurrent().hasUserRight(UserRight.SAMPLE_VIEW) && !caze.isUnreferredPortHealthCase()) {
        SampleListComponent sampleList = new SampleListComponent(getCaseRef());
        sampleList.addStyleName(CssStyles.SIDE_COMPONENT);
        layout.addComponent(sampleList, SAMPLES_LOC);
    }
}

From source file:de.symeda.sormas.ui.contact.ContactDataView.java

License:Open Source License

@Override
public void enter(ViewChangeEvent event) {
    super.enter(event);
    setHeightUndefined();//w  w  w .  j a  va2  s . c  o m

    String htmlLayout = LayoutUtil.fluidRow(LayoutUtil.fluidColumnLoc(8, 0, 12, 0, EDIT_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, CASE_LOC), LayoutUtil.fluidColumnLoc(4, 0, 6, 0, TASKS_LOC));

    VerticalLayout container = new VerticalLayout();
    container.setWidth(100, Unit.PERCENTAGE);
    container.setMargin(true);
    setSubComponent(container);
    CustomLayout layout = new CustomLayout();
    layout.addStyleName(CssStyles.ROOT_COMPONENT);
    layout.setTemplateContents(htmlLayout);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setHeightUndefined();
    container.addComponent(layout);

    CommitDiscardWrapperComponent<?> editComponent = ControllerProvider.getContactController()
            .getContactDataEditComponent(getContactRef().getUuid());
    editComponent.setMargin(false);
    editComponent.setWidth(100, Unit.PERCENTAGE);
    editComponent.getWrappedComponent().setWidth(100, Unit.PERCENTAGE);
    editComponent.addStyleName(CssStyles.MAIN_COMPONENT);
    layout.addComponent(editComponent, EDIT_LOC);

    ContactDto contactDto = FacadeProvider.getContactFacade().getContactByUuid(getContactRef().getUuid());
    CaseDataDto caseDto = FacadeProvider.getCaseFacade().getCaseDataByUuid(contactDto.getCaze().getUuid());
    CaseInfoLayout caseInfoLayout = new CaseInfoLayout(caseDto);
    caseInfoLayout.addStyleName(CssStyles.SIDE_COMPONENT);
    layout.addComponent(caseInfoLayout, CASE_LOC);

    TaskListComponent taskList = new TaskListComponent(TaskContext.CONTACT, getContactRef());
    taskList.addStyleName(CssStyles.SIDE_COMPONENT);
    layout.addComponent(taskList, TASKS_LOC);
}

From source file:de.symeda.sormas.ui.events.EventDataView.java

License:Open Source License

@Override
public void enter(ViewChangeEvent event) {
    super.enter(event);
    setHeightUndefined();/*from ww  w  .  ja  v  a2s. co m*/

    String htmlLayout = LayoutUtil.fluidRow(LayoutUtil.fluidColumnLoc(8, 0, 12, 0, EVENT_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, TASKS_LOC));

    VerticalLayout container = new VerticalLayout();
    container.setWidth(100, Unit.PERCENTAGE);
    container.setMargin(true);
    setSubComponent(container);
    CustomLayout layout = new CustomLayout();
    layout.addStyleName(CssStyles.ROOT_COMPONENT);
    layout.setTemplateContents(htmlLayout);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setHeightUndefined();
    container.addComponent(layout);

    CommitDiscardWrapperComponent<?> editComponent = ControllerProvider.getEventController()
            .getEventDataEditComponent(getEventRef().getUuid());
    editComponent.setMargin(false);
    editComponent.setWidth(100, Unit.PERCENTAGE);
    editComponent.getWrappedComponent().setWidth(100, Unit.PERCENTAGE);
    editComponent.addStyleName(CssStyles.MAIN_COMPONENT);
    layout.addComponent(editComponent, EVENT_LOC);

    TaskListComponent taskList = new TaskListComponent(TaskContext.EVENT, getEventRef());
    taskList.addStyleName(CssStyles.SIDE_COMPONENT);
    layout.addComponent(taskList, TASKS_LOC);
}

From source file:de.symeda.sormas.ui.samples.SampleDataView.java

License:Open Source License

@Override
public void enter(ViewChangeEvent event) {
    super.enter(event);
    setHeightUndefined();/*from ww w  . j  av a2  s. com*/

    String htmlLayout = LayoutUtil.fluidRow(LayoutUtil.fluidColumnLoc(8, 0, 12, 0, EDIT_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, CASE_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, PATHOGEN_TESTS_LOC),
            LayoutUtil.fluidColumnLoc(4, 0, 6, 0, ADDITIONAL_TESTS_LOC));

    VerticalLayout container = new VerticalLayout();
    container.setWidth(100, Unit.PERCENTAGE);
    container.setMargin(true);
    setSubComponent(container);
    CustomLayout layout = new CustomLayout();
    layout.addStyleName(CssStyles.ROOT_COMPONENT);
    layout.setTemplateContents(htmlLayout);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setHeightUndefined();
    container.addComponent(layout);

    SampleDto sampleDto = FacadeProvider.getSampleFacade().getSampleByUuid(getSampleRef().getUuid());

    CommitDiscardWrapperComponent<SampleEditForm> editComponent = ControllerProvider.getSampleController()
            .getSampleEditComponent(getSampleRef().getUuid());
    editComponent.setMargin(false);
    editComponent.setWidth(100, Unit.PERCENTAGE);
    editComponent.getWrappedComponent().setWidth(100, Unit.PERCENTAGE);
    editComponent.addStyleName(CssStyles.MAIN_COMPONENT);
    layout.addComponent(editComponent, EDIT_LOC);

    BiConsumer<PathogenTestResultType, Boolean> pathogenTestChangedCallback = new BiConsumer<PathogenTestResultType, Boolean>() {
        @Override
        public void accept(PathogenTestResultType pathogenTestResult, Boolean verified) {
            if (verified) {
                SampleDto componentSample = editComponent.getWrappedComponent().getValue();
                if (pathogenTestResult != componentSample.getPathogenTestResult()) {
                    ControllerProvider.getSampleController().showChangePathogenTestResultWindow(editComponent,
                            componentSample.getUuid(), pathogenTestResult);
                }
            }

            editComponent.getWrappedComponent().makePathogenTestResultRequired();
        }
    };

    CaseDataDto caseDto = FacadeProvider.getCaseFacade()
            .getCaseDataByUuid(sampleDto.getAssociatedCase().getUuid());
    CaseInfoLayout caseInfoLayout = new CaseInfoLayout(caseDto);
    caseInfoLayout.addStyleName(CssStyles.SIDE_COMPONENT);
    layout.addComponent(caseInfoLayout, CASE_LOC);

    PathogenTestListComponent pathogenTestList = new PathogenTestListComponent(getSampleRef(),
            pathogenTestChangedCallback);
    pathogenTestList.addStyleName(CssStyles.SIDE_COMPONENT);
    layout.addComponent(pathogenTestList, PATHOGEN_TESTS_LOC);

    if (UserProvider.getCurrent().hasUserRight(UserRight.ADDITIONAL_TEST_VIEW)) {
        AdditionalTestListComponent additionalTestList = new AdditionalTestListComponent(
                getSampleRef().getUuid());
        additionalTestList.addStyleName(CssStyles.SIDE_COMPONENT);
        layout.addComponent(additionalTestList, ADDITIONAL_TESTS_LOC);
    }
}

From source file:org.fossa.rolp.ui.dashboard.AdminDashboard.java

License:Open Source License

public AdminDashboard(RolpApplication app) {
    super("./applicationMainLayout/adminLayout");
    this.app = app;

    buildButtonBattery();/*from ww  w  .  ja v a 2s.  co  m*/

    CustomLayout lehrerListe = new CustomLayout("./lehrerDashboards/liste");
    lehrerListe.addStyleName("liste");

    lehrerListe.addComponent(getLehrerList(), "list");
    lehrerListe.setHeight("260px");

    addComponent(lehrerListe, "liste");
    addComponent(horizontalButtonBattery, "horizontalButtonBattery");
    addComponent(verticalButtonBattery, "verticalButtonBattery");
}

From source file:org.fossa.rolp.ui.dashboard.FachlehrerDashboard.java

License:Open Source License

public FachlehrerDashboard(RolpApplication app) {
    super(app);//from www  .  j a  va 2  s  . co  m
    this.app = app;
    setCaption(" - FachlehrerDashboard - ");
    setWidth("100%");
    setHeight("100%");

    buildButtonBatteries();

    CustomLayout layout = new CustomLayout("./lehrerDashboards/fachLehrerDashboardMain");
    setContent(layout);

    CustomLayout headline = new CustomLayout("./lehrerDashboards/headline");
    headline.addStyleName("headline");

    Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH));
    logo.setType(Embedded.TYPE_IMAGE);
    logo.setWidth("100px");
    logo.setHeight("96px");

    headline.addComponent(logo, "logo");

    CustomLayout faecherListe = new CustomLayout("./lehrerDashboards/liste");
    faecherListe.addStyleName("liste");
    faecherList = getFaecherList();
    faecherList.setHeight("250px");
    faecherList.setStyleName("list");
    faecherListe.addComponent(faecherList, "list");
    faecherListe.setHeight("260px");

    layout.addComponent(faecherListe, "liste");
    layout.addComponent(headline, "headline");
    layout.addComponent(horizontalButtonBattery, "horizontalButtonBattery");

    lehrerBlog = getLehrerBlog();
    layout.addComponent(lehrerBlog, "blog");
    windowCloseButton.setWidth("100%");
    layout.addComponent(windowCloseButton, "windowCloseButton");

}

From source file:org.fossa.rolp.ui.dashboard.KlassenlehrerDashboard.java

License:Open Source License

public KlassenlehrerDashboard(RolpApplication app) {
    super(app);/*from  ww  w .  jav  a 2s  .c  o  m*/
    this.app = app;
    setCaption(" - KlassenlehrerDashboard - ");
    setWidth("100%");
    setHeight("100%");

    buildButtonBatteries();

    CustomLayout layout = new CustomLayout("./lehrerDashboards/klassenLehrerDashboardMain");
    setContent(layout);

    CustomLayout headline = new CustomLayout("./lehrerDashboards/headline");
    headline.addStyleName("headline");

    Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH));
    logo.setType(Embedded.TYPE_IMAGE);
    logo.setWidth("100px");
    logo.setHeight("96px");

    headline.addComponent(logo, "logo");
    headline.addComponent(headdataEditingPanel, "headdataEditingPanel");

    Panel hints = new Panel();
    hints.addStyleName("hints");
    hinweistext = new Label();
    hinweistext.setContentMode(Label.CONTENT_XHTML);
    hinweistext.setReadOnly(true);
    hinweistext.setHeight("250px");
    hints.setHeight("250px");
    hints.setScrollable(true);
    hints.addComponent(hinweistext);
    refreshHinweistext();

    CustomLayout schuelerListe = new CustomLayout("./lehrerDashboards/liste");
    schuelerListe.addStyleName("liste");
    schuelerList = getSchuelerList();
    schuelerList.setHeight("250px");
    schuelerList.setStyleName("list");
    schuelerListe.addComponent(schuelerList, "list");
    schuelerListe.setHeight("260px");
    layout.addComponent(schuelerListe, "liste");

    layout.addComponent(headline, "headline");
    layout.addComponent(horizontalButtonBattery, "horizontalButtonBattery");
    layout.addComponent(verticalButtonBattery, "verticalButtonBattery");

    layout.addComponent(hints, "hints");
    windowCloseButton.setWidth("100%");
    layout.addComponent(windowCloseButton, "windowCloseButton");
    //      app.getAnimator().animate(horizontalButtonBattery, AnimType.ROLL_DOWN_OPEN_POP).setDuration(500).setDelay(500);
}

From source file:org.opennms.features.pluginmgr.vaadin.config.opennms.PluginManagerAdminApplication.java

License:Open Source License

private void addHeader(VaadinRequest request) {
    if (m_headerProvider != null) {
        try {/*from  w w  w.j a va  2 s.  c om*/
            setHeaderHtml(
                    m_headerProvider.getHeaderHtml(((VaadinServletRequest) request).getHttpServletRequest()));
        } catch (final Exception e) {
            LOG.error("failed to get header HTML for request " + request.getPathInfo(), e.getCause());
        }
    }
    if (m_headerHtml != null) {
        InputStream is = null;
        try {
            is = new ByteArrayInputStream(m_headerHtml.getBytes());
            final CustomLayout headerLayout = new CustomLayout(is);
            headerLayout.setWidth("100%");
            headerLayout.addStyleName("onmsheader");
            m_rootLayout.addComponent(headerLayout);
        } catch (final IOException e) {
            closeQuietly(is);
            LOG.debug("failed to get header layout data", e);
        }
    }
}

From source file:org.opennms.features.topology.app.internal.TopologyUI.java

License:Open Source License

private void addHeader() {
    if (m_headerHtml != null && m_showHeader) {
        InputStream is = null;// w  ww.  j av a  2  s.com
        try {
            is = new ByteArrayInputStream(m_headerHtml.getBytes());
            final CustomLayout headerLayout = new CustomLayout(is);
            headerLayout.setWidth("100%");
            headerLayout.addStyleName("onmsheader");
            m_rootLayout.addComponent(headerLayout);
        } catch (final IOException e) {
            try {
                is.close();
            } catch (final IOException closeE) {
                LOG.debug("failed to close HTML input stream", closeE);
            }
            LOG.debug("failed to get header layout data", e);
        }
    }
}

From source file:org.opennms.features.vaadin.nodemaps.internal.NodeMapsApplication.java

License:Open Source License

private void addHeader() {
    if (m_headerProvider != null) {
        try {/*from w w w  .  j  a v a2 s . co  m*/
            URL pageUrl = Page.getCurrent().getLocation().toURL();
            setHeaderHtml(m_headerProvider.getHeaderHtml(new HttpServletRequestVaadinImpl(m_request, pageUrl)));
        } catch (final Exception e) {
            LOG.error("failed to get header HTML for request " + m_request.getPathInfo(), e.getCause());
        }
    }
    if (m_headerHtml != null) {
        InputStream is = null;
        try {
            is = new ByteArrayInputStream(m_headerHtml.getBytes());
            final CustomLayout headerLayout = new CustomLayout(is);
            headerLayout.setWidth("100%");
            headerLayout.addStyleName("onmsheader");
            m_rootLayout.addComponent(headerLayout);
        } catch (final IOException e) {
            closeQuietly(is);
            LOG.debug("failed to get header layout data", e);
        }
    }
}