Example usage for com.vaadin.ui CssLayout CssLayout

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

Introduction

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

Prototype

public CssLayout() 

Source Link

Document

Constructs an empty CssLayout.

Usage

From source file:gov.va.ds4p.ds4pmobileportal.ui.eHealthExchange.java

License:Open Source License

private Popover getPopoverTextArea(String val, String title) {
    Popover popover = new Popover();
    popover.setModal(true);//from   w ww .  j  a v a 2s . co m
    popover.setClosable(true);
    popover.setWidth("700px");
    popover.setHeight("100%");
    CssLayout popLayout = new CssLayout();
    popLayout.setSizeFull();
    popLayout.setMargin(true);

    NavigationView navView = new NavigationView(popLayout);
    navView.setCaption(title);

    CssLayout layout2 = new CssLayout();
    TextArea textArea = new TextArea();
    textArea.setWidth("100%");
    textArea.setHeight("700px");
    textArea.setValue(val);
    textArea.setReadOnly(true);
    layout2.addComponent(textArea);

    popLayout.addComponent(layout2);

    Button close = new Button(null, new ClickListener() {

        public void buttonClick(ClickEvent event) {
            event.getButton().getWindow().getParent().removeWindow(event.getButton().getWindow());
        }
    });
    close.setIcon(new ThemeResource("../runo/icons/64/cancel.png"));
    navView.setRightComponent(close);

    popover.setContent(navView);

    return popover;
}

From source file:gov.va.ds4p.ds4pmobileportal.ui.eHealthExchange.java

License:Open Source License

private Popover getPopoverLabel(String val, String title) {
    Popover popover = new Popover();
    popover.setModal(true);/*  w w  w .  j  av a 2s . co m*/
    popover.setClosable(true);
    popover.setWidth("700px");
    popover.setHeight("100%");
    CssLayout popLayout = new CssLayout();
    popLayout.setSizeFull();
    popLayout.setMargin(true);

    NavigationView navView = new NavigationView(popLayout);
    navView.setCaption(title);

    CssLayout layout2 = new CssLayout();
    Label lbl = new Label();
    lbl.setContentMode(Label.CONTENT_XHTML);
    lbl.setStyleName(Runo.LABEL_SMALL);
    lbl.setValue(val);
    layout2.addComponent(lbl);

    popLayout.addComponent(layout2);

    Button close = new Button(null, new ClickListener() {

        public void buttonClick(ClickEvent event) {
            event.getButton().getWindow().getParent().removeWindow(event.getButton().getWindow());
        }
    });
    close.setIcon(new ThemeResource("../runo/icons/64/cancel.png"));
    navView.setRightComponent(close);

    popover.setContent(navView);

    return popover;
}

From source file:gov.va.ds4p.ds4pmobileportal.ui.eHealthExchange.java

License:Open Source License

private Popover getPopoverPDF(String val, String title) {
    Popover popover = new Popover();
    popover.setModal(true);/*from   w  ww  . ja  v a  2s  .  c  o  m*/
    popover.setClosable(true);
    popover.setWidth("700px");
    popover.setHeight("100%");
    CssLayout popLayout = new CssLayout();
    popLayout.setSizeFull();
    popLayout.setMargin(true);

    NavigationView navView = new NavigationView(popLayout);
    navView.setCaption(title);

    CssLayout layout2 = new CssLayout();
    Embedded pdf = new Embedded();
    pdf.setType(Embedded.TYPE_BROWSER);
    pdf.setMimeType("application/pdf");
    pdf.setSizeFull();
    pdf.setWidth("100%");
    pdf.setHeight("700px");

    pdf.setSource(createPdf(val));

    layout2.addComponent(pdf);

    popLayout.addComponent(layout2);

    Button close = new Button(null, new ClickListener() {

        public void buttonClick(ClickEvent event) {
            event.getButton().getWindow().getParent().removeWindow(event.getButton().getWindow());
        }
    });
    close.setIcon(new ThemeResource("../runo/icons/64/cancel.png"));
    navView.setRightComponent(close);

    popover.setContent(navView);

    return popover;
}

From source file:gov.va.ds4p.ds4pmobileportal.ui.LoginView.java

License:Open Source License

private void buildView() {
    try {//from  ww w . j a  v a 2s.c o m
        CssLayout content = new CssLayout();
        content.setWidth("100%");
        content.setMargin(true, true, true, true);

        content.addComponent(getLoginPanel());
        setContent(content);
        setCaption("VA/SAMHSA DS4P Pilot Demonstrations - Please Login");
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:gov.va.ds4p.ds4pmobileportal.ui.LogoutView.java

License:Open Source License

private void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("Logout / End Session");

    VerticalComponentGroup vGroup = new VerticalComponentGroup();
    logoutAction = new Label(
            "<div style='color:#333;'><p>You have requested to end your session, if true continue by clicking the \"Ok\" button.</p></div>",
            Label.CONTENT_XHTML);
    Button okBTN = new Button("Ok");
    okBTN.addListener(new Button.ClickListener() {

        @Override// ww  w. j av  a2  s  .  co m
        public void buttonClick(ClickEvent event) {
            ((MyVaadinApplication) getApplication()).logoutRequest();
        }
    });
    vGroup.addComponent(logoutAction);
    vGroup.addComponent(okBTN);
    content.addComponent(vGroup);
    setContent(content);

}

From source file:gov.va.ds4p.ds4pmobileportal.ui.PatientSelectView.java

License:Open Source License

private void buildView() {
    try {/* w w w  .  j av  a2  s  . c  o m*/
        CssLayout content = new CssLayout();
        content.setWidth("100%");
        setCaption("Patient Selection");

        VerticalComponentGroup vGroup = new VerticalComponentGroup();

        Label selectaction = new Label(
                "<div style='color:#333;'><p>You must select a patient first prior to demonstrating"
                        + " <b>Data Segementation for Privacy</b> use cases.</p>"
                        + "<p> After patient is selected you may perform a secured"
                        + " eHealth Exchange (pull) or eHealth Direct (push) demonstration.</p></div>",
                Label.CONTENT_XHTML);

        patientList = new ComboBox("Available Patients");
        populatePatientList();

        patientList.addListener(new ComboBox.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                String val = (String) patientList.getValue();
                String valName = (String) patientList.getItemCaption(val);
                AdminContext.getSessionAttributes().setSelectedPatientId(val);
                AdminContext.getSessionAttributes().setSelectedPatientName(valName);
                setSessionValues(val);
            }
        });

        patientList.setImmediate(true);
        patientList.setTextInputAllowed(false);
        vGroup.addComponent(selectaction);
        vGroup.addComponent(patientList);

        content.addComponent(vGroup);

        setContent(content);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:gov.va.ds4p.ds4pmobileportal.ui.ProfileView.java

License:Open Source License

private void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("Profile View");

    VerticalComponentGroup vGroup = new VerticalComponentGroup();
    profileAction = new Label(
            "<div style='color:#333;'><p>This screen allows the user to modify their <b>Data Segmentation for Privacy</b> "
                    + "resource, sensitivity, purpose of use, and other privileges for test, and demonstration purposes.</d></div>",
            Label.CONTENT_XHTML);

    vGroup.addComponent(profileAction);//from   ww w.  j a  v a2s .  co m

    //Label identityLBL = new Label("<b>Identity</b>", Label.CONTENT_XHTML);
    TextField providerIdFLD = new TextField("Provider ID/Email Address");
    providerIdFLD.setEnabled(false);
    TextField userIdFLD = new TextField("User ID");
    userIdFLD.setEnabled(false);
    PasswordField userpassFLD = new PasswordField("Password");
    userpassFLD.setEnabled(false);

    providerIdFLD.setValue(AdminContext.getSessionAttributes().getProviderId());
    userIdFLD.setValue(AdminContext.getSessionAttributes().getUserId());
    userpassFLD.setValue("ds4p");

    providerIdFLD.setWidth("400px");
    userIdFLD.setWidth("400px");
    userpassFLD.setWidth("400px");

    VerticalComponentGroup vGroup2 = new VerticalComponentGroup();
    vGroup2.setCaption("Identity");
    //vGroup.addComponent(identityLBL);
    vGroup2.addComponent(providerIdFLD);
    vGroup2.addComponent(userIdFLD);
    vGroup2.addComponent(userpassFLD);

    //Label permissionsLBL = new Label("<b>Access Control Setting and Permissions</b>", Label.CONTENT_XHTML);
    pouCBX = new ComboBox("Current Purpose of Use");
    NavigationButton resourceNavBTN = new NavigationButton("Resource Privileges");
    confCBX = new ComboBox("Security Level");
    NavigationButton sensitivityNavBTN = new NavigationButton("Sensitivity Privileges");

    pouCBX.setWidth("400px");
    confCBX.setWidth("400px");
    pouCBX.setTextInputAllowed(false);
    confCBX.setTextInputAllowed(false);

    populateConfCBX();
    populatePouCBX();

    confCBX.setEnabled(false);

    VerticalComponentGroup vGroup3 = new VerticalComponentGroup();
    vGroup3.setCaption("Use and Permission Settings");
    //vGroup.addComponent(permissionsLBL);
    vGroup3.addComponent(pouCBX);
    vGroup3.addComponent(resourceNavBTN);
    vGroup3.addComponent(confCBX);
    vGroup3.addComponent(sensitivityNavBTN);

    pouCBX.setValue(AdminContext.getSessionAttributes().getPurposeOfUse());
    confCBX.setValue(AdminContext.getSessionAttributes().getSecurityLevel());

    //Label organizationLBL = new Label("<b>Organization Info</b>", Label.CONTENT_XHTML);
    TextField organizationFLD = new TextField("Organization");
    TextField organizationUnitFLD = new TextField("Facility");
    TextField organizationIdFLD = new TextField("Home Community");

    organizationFLD.setValue("Dept. of Veterans Affairs");
    organizationUnitFLD.setValue("Ft. Harrison VAMC");
    organizationIdFLD.setValue("2.16.840.1.113883.4.349");

    organizationFLD.setEnabled(false);
    organizationUnitFLD.setEnabled(false);
    organizationIdFLD.setEnabled(false);

    organizationFLD.setWidth("400px");
    organizationUnitFLD.setWidth("400px");
    organizationIdFLD.setWidth("400px");

    VerticalComponentGroup vGroup4 = new VerticalComponentGroup();
    vGroup4.setCaption("Organization Info");
    //vGroup.addComponent(organizationLBL);
    vGroup4.addComponent(organizationFLD);
    vGroup4.addComponent(organizationUnitFLD);
    vGroup4.addComponent(organizationIdFLD);

    //Label locationLBL = new Label("<b>Location</b>", Label.CONTENT_XHTML);
    TextField cityFLD = new TextField("City");
    TextField stateFLD = new TextField("State");
    TextField zipFLD = new TextField("Zip Code");
    TextField countryFLD = new TextField("Country");

    //set defaults and disable
    cityFLD.setValue("Helena");
    stateFLD.setValue("MT");
    zipFLD.setValue("59601");
    countryFLD.setValue("U.S.A");

    cityFLD.setEnabled(false);
    stateFLD.setEnabled(false);
    zipFLD.setEnabled(false);
    countryFLD.setEnabled(false);

    cityFLD.setWidth("400px");
    stateFLD.setWidth("400px");
    zipFLD.setWidth("400px");
    countryFLD.setWidth("400px");
    VerticalComponentGroup vGroup5 = new VerticalComponentGroup();
    vGroup5.setCaption("Location Info");
    //vGroup.addComponent(locationLBL);
    vGroup5.addComponent(cityFLD);
    vGroup5.addComponent(stateFLD);
    vGroup5.addComponent(zipFLD);
    vGroup5.addComponent(countryFLD);

    pouCBX.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            String val = (String) pouCBX.getValue();
            AdminContext.getSessionAttributes().setPurposeOfUse(val);
        }
    });

    confCBX.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            String val = (String) confCBX.getValue();
            AdminContext.getSessionAttributes().setSecurityLevel(val);
        }
    });

    pouCBX.setImmediate(true);
    confCBX.setImmediate(true);

    content.addComponent(vGroup);
    content.addComponent(vGroup2);
    content.addComponent(vGroup3);
    content.addComponent(vGroup4);
    content.addComponent(vGroup5);
    setContent(content);

}

From source file:gov.va.ds4p.ds4pmobileportal.ui.SensitivityPrivilegeView.java

License:Open Source License

private void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("User Sensitivity Privileges");
    setLeftComponent(navBack);/*w w w .j av a2 s  .com*/
    final NavigationManager navMgr = getNavigationManager();

    navBack.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            saveSensitivityCodes();
            navMgr.navigateBack();
        }
    });

    VerticalComponentGroup vGroup = new VerticalComponentGroup();
    Label profileAction = new Label(
            "<div style='color:#333;'><p>This screen allows the user to modify some of their <b>Data Segmentation for Privacy</b> "
                    + "sensitivity privileges for test and demonstration purposes.</d></div>",
            Label.CONTENT_XHTML);

    vGroup.addComponent(profileAction);

    ethCHK.setCaption("Substance Abuse (ETH)");
    hivCHK.setCaption("Human Immunodeficiency Virus (HIV)");
    psyCHK.setCaption("Mental Health Related (PSY)");
    stdCHK.setCaption("Sexually Transmitted Disease (STD)");
    sickleCHK.setCaption("Sickle Cell Anemia (SICKLE)");
    tbooCHK.setCaption("Taboo (TBOO)");

    ethCHK.setWidth("400px");
    hivCHK.setWidth("400px");
    psyCHK.setWidth("400px");
    stdCHK.setWidth("400px");
    sickleCHK.setWidth("400px");
    tbooCHK.setWidth("400px");

    populateSensitivitySwitches();

    ethCHK.setImmediate(true);
    hivCHK.setImmediate(true);
    psyCHK.setImmediate(true);
    stdCHK.setImmediate(true);
    sickleCHK.setImmediate(true);
    tbooCHK.setImmediate(true);

    VerticalComponentGroup vGroup2 = new VerticalComponentGroup();
    vGroup2.addComponent(ethCHK);
    vGroup2.addComponent(hivCHK);
    vGroup2.addComponent(psyCHK);
    vGroup2.addComponent(stdCHK);
    vGroup2.addComponent(sickleCHK);
    vGroup2.addComponent(tbooCHK);

    content.addComponent(vGroup);
    content.addComponent(vGroup2);
    setContent(content);
}

From source file:gov.va.ds4p.ds4pmobileportal.ui.SettingsView.java

License:Open Source License

private void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("Settings");

    VerticalComponentGroup vGroup = new VerticalComponentGroup();

    TextField username = new TextField("Username");
    PasswordField password = new PasswordField("Password");

    vGroup.addComponent(username);//from  w ww.j a  v  a2  s  . c o m
    vGroup.addComponent(password);

    content.addComponent(vGroup);

    setContent(content);
}

From source file:gov.va.ehtac.appsonfhir.ui.HCSLogs.java

private Popover getPopoverTextArea(String val, String title) {
    popover = new Popover();
    popover.setModal(true);/*  ww  w .j  a  v a  2 s .  co m*/
    popover.setClosable(true);
    popover.setWidth("700px");
    popover.setHeight("550px");

    CssLayout popLayout = new CssLayout();
    popLayout.setSizeFull();

    NavigationView navView = new NavigationView(popLayout);
    navView.setCaption(title);

    CssLayout layout2 = new CssLayout();
    TextArea textArea = new TextArea();
    textArea.setWidth("100%");
    textArea.setHeight("490px");
    textArea.setValue(val);
    //        textArea.setReadOnly(true);
    //        textArea.setStyleName(Runo.LABEL_SMALL);
    layout2.addComponent(textArea);

    popLayout.addComponent(layout2);

    Button close = new Button(null, new Button.ClickListener() {

        public void buttonClick(Button.ClickEvent event) {
            popover.removeFromParent();
        }
    });
    close.setIcon(new ThemeResource("../runo/icons/64/cancel.png"));
    navView.setRightComponent(close);

    popover.setContent(navView);

    return popover;
}