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(Component... children) 

Source Link

Document

Constructs a CssLayout with the given components in the given order.

Usage

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

public HCSLogs() {
    session = ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("Standards Log Output");
    final VerticalComponentGroup content = new VerticalComponentGroup();

    createTable();/*from   w w  w . j  av  a  2 s.  c o m*/

    content.addComponent(logTable);

    Button refresh = new Button();
    refresh.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                logTable.removeAllItems();
                logTable.setContainerDataSource(populateHCSLogs());
                logTable.setColumnReorderingAllowed(true);
                logTable.setColumnCollapsingAllowed(false);
                logTable.setVisibleColumns(new Object[] { "date", "purposeofuse", "resourceType", "id" });
                logTable.setColumnHeaders(new String[] { "Date", "POU", "Resource Requested", "Resource ID" });

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

    });

    refresh.setImmediate(true);
    refresh.setIcon(FontAwesome.REFRESH);
    setRightComponent(refresh);

    HorizontalButtonGroup hGroup = new HorizontalButtonGroup();
    hGroup.setCaption("Click Button View Std Area");
    hGroup.setWidth("100%");

    Button resourceBtn = new Button("FHIR Resource");
    Button slsRulesExecBtn = new Button("SLS Rules");
    Button slsOutputBtn = new Button("SLS Actions");
    Button ppsRulesExecBtn = new Button("PPS Rules");
    Button ppsOutputBtn = new Button("PPS Actions");
    Button consentBtn = new Button("Consent");
    Button labeledResourceBtn = new Button("HCS Results");

    resourceBtn.setImmediate(true);
    slsRulesExecBtn.setImmediate(true);
    slsOutputBtn.setImmediate(true);
    ppsRulesExecBtn.setImmediate(true);
    ppsOutputBtn.setImmediate(true);
    consentBtn.setImmediate(true);
    labeledResourceBtn.setImmediate(true);

    resourceBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "resource").getValue();
                    Popover popover = getPopoverTextArea(obj, "FHIR Resource");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    slsRulesExecBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "slsrules").getValue();
                    Popover popover = getPopoverTextArea(obj, "SLS Rules");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    slsOutputBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "slsresults").getValue();
                    Popover popover = getPopoverTextArea(obj, "SLS Actions");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    ppsRulesExecBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "ppsrules").getValue();
                    Popover popover = getPopoverTextArea(obj, "PPS Rules");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    ppsOutputBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "ppsresults").getValue();
                    Popover popover = getPopoverTextArea(obj, "PPS Actions");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    consentBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "consent").getValue();
                    Popover popover = getPopoverTextArea(obj, "Consent");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    labeledResourceBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                Object rowId = logTable.getValue();
                if (rowId != null) {
                    String obj = (String) logTable.getContainerProperty(rowId, "labeledresource").getValue();
                    Popover popover = getPopoverTextArea(obj, "HCS Results");
                    popover.showRelativeTo(getNavigationBar());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });

    hGroup.addComponent(resourceBtn);
    hGroup.addComponent(slsRulesExecBtn);
    hGroup.addComponent(slsOutputBtn);
    hGroup.addComponent(consentBtn);
    hGroup.addComponent(ppsRulesExecBtn);
    hGroup.addComponent(ppsOutputBtn);
    hGroup.addComponent(labeledResourceBtn);
    content.addComponent(hGroup);

    setContent(new CssLayout(content));
}

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

public RunningFitness() {
    session = ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("Fitness - Running/Walking Activities");
    final VerticalComponentGroup content = new VerticalComponentGroup();

    createTable();//from   w  ww  .j  av a2 s .  c  o  m

    content.addComponent(runTable);

    setRightComponent(new Label(session.getPatientNameAgeGenderDisplay()));
    setContent(new CssLayout(content));

}

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

public Settings() {
    setCaption("Resource Server Selection");
    session = ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes();

    final VerticalComponentGroup content = new VerticalComponentGroup();

    final ComboBox baseURLCBX = new ComboBox("Resource Server");
    baseURLCBX.addItem("42CFRPart2");
    baseURLCBX.addItem("Military Health Systems");
    baseURLCBX.addItem("Tricare");
    baseURLCBX.addItem("Dept. of Veterans Affairs");
    baseURLCBX.addItem("HHS ONC - Health Infomation Exchange(HIE)");
    baseURLCBX.addItem("FHIR/VA - Health Information Exchange (HIE)");

    baseURLCBX.setTextInputAllowed(false);

    baseURLCBX.addValueChangeListener(new ComboBox.ValueChangeListener() {

        @Override//from   w w w .j a v  a2 s  .c  om
        public void valueChange(Property.ValueChangeEvent event) {

            String caption = (String) baseURLCBX.getValue();
            String newURL = getEndpoint(caption);
            ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes().setBaseURL(newURL);
            setTabDisplayName(caption);
            System.out.println("BASEURL: " + newURL);
        }
    });

    baseURLCBX.setImmediate(true);
    content.addComponent(baseURLCBX);

    setContent(new CssLayout(content));

}

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

public Tools() {
    setCaption("Patient Tools");
    final HorizontalButtonGroup hGroup = new HorizontalButtonGroup();
    Button weightBTN = new Button("Weight Scale");
    weightBTN.setIcon(FontAwesome.DELICIOUS);
    weightBTN.setWidth("310px");
    Button heartRateBTN = new Button("Heart Rate");
    heartRateBTN.setIcon(FontAwesome.HEART);
    heartRateBTN.setWidth("310px");
    Button bloodPressureBTN = new Button("Blood Pressure");
    bloodPressureBTN.setIcon(FontAwesome.HEART_O);
    bloodPressureBTN.setWidth("310px");
    Button glucoseBTN = new Button("Diabetes Management");
    glucoseBTN.setIcon(FontAwesome.FILE_CODE_O);
    glucoseBTN.setWidth("310px");
    hGroup.addComponent(weightBTN);/*from   w w  w  .  j a  v  a 2s.  c o m*/
    hGroup.addComponent(heartRateBTN);
    hGroup.addComponent(bloodPressureBTN);
    hGroup.addComponent(glucoseBTN);

    setContent(new CssLayout(hGroup));
}

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

public Vitals() {
    session = ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("Observations - " + session.getPatientNameAgeGenderDisplay());
    final VerticalComponentGroup content = new VerticalComponentGroup();

    createTable();/*ww w.j a v a2 s .  c om*/

    content.addComponent(vitalsTable);

    final Button submitButton = new Button("Submit");
    submitButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Notification.show("Thanks!");
        }
    });
    Button b = new Button("HCS");
    b.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                HCSOrchestratorService service = new HCSOrchestratorService();
                HCSOrchestrator port = service.getHCSOrchestratorPort();
                ((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                        "http://localhost:7080/HCSServices/HCSOrchestratorService?wsdl");

                List<HcsCategory> hcs = new ArrayList();
                ApplySecurityLabelsFHIRForResourceReleaseResponse.Return r = port
                        .applySecurityLabelsFHIRForResourceRelease(composeXMLStringFeed(bundle), "1", hcs,
                                session.getPurposeOfUse());
                System.out.println(r.getProcessedAtomFeed());
                //HcsTaggingResponse res = port.genFHIRConfidentialityLabels(composeXMLStringFeed(bundle), hcs);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }

    });

    b.setIcon(FontAwesome.SHARE);
    setRightComponent(b);
    setContent(new CssLayout(content));

}

From source file:gov.va.ehtac.myappsonfhir.ui.FitnessWellness.java

public FitnessWellness() {
    session = ((HealthElementsForPatientTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("My Health Apps");
    content = new VerticalComponentGroup();
    this.setWidth("100%");
    this.setHeight("100%");

    if (dRequest.equals("chart")) {
        content.addComponent(getChartLayout());
    } else if (dRequest.equals("raw")) {
        content.addComponent(getRawData());
    } else {// www.  java2s  . c  om
        //this is a problem
        content.addComponent(new Panel());
    }

    Button refresh = new Button();
    refresh.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                dRequest = "chart";
                refresh();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }

    });

    refresh.setImmediate(true);
    refresh.setIcon(FontAwesome.REFRESH);
    setRightComponent(refresh);

    setContent(new CssLayout(content));

}

From source file:gov.va.ehtac.myappsonfhir.ui.FitnessWellness.java

private void refresh() {
    content.removeAllComponents();/*from   w  w w .  j ava 2  s  .com*/
    if (dRequest.equals("chart")) {
        content.addComponent(getChartLayout());
    } else if (dRequest.equals("raw")) {
        content.addComponent(getRawData());
    } else {
        //this is a problem
        content.addComponent(new Panel());
    }

    setContent(new CssLayout(content));
}

From source file:gov.va.ehtac.myappsonfhir.ui.ImmunizationRequest.java

public ImmunizationRequest() {
    session = ((HealthElementsForPatientTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("Protected Resource Request - UMA Flow");
    final VerticalComponentGroup content = new VerticalComponentGroup();
    this.setWidth("100%");
    this.setHeight("100%");

    beginButton.setImmediate(true);// w  w  w  .j av a  2 s . co m
    beginButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            //call uma pofpatient and request immunizations

            //session.getPofPatient().loadImmunizationsUMA(session.getContext(), "http://va.edmondsci.com:8080/hapi-fhir-jpaserver/baseDstu2/");
            try {
                String res = performUMARequest();

                System.out.println(res);
                Popover popover = getPopoverResults(res);
                popover.showRelativeTo(getNavigationBar());

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

    content.addComponent(beginButton);

    setContent(new CssLayout(content));
}

From source file:gov.va.ehtac.myappsonfhir.ui.ValidicMarketPlace.java

public ValidicMarketPlace() {
    session = ((HealthElementsForPatientTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("Health App Marketplace");
    final VerticalComponentGroup content = new VerticalComponentGroup();
    BrowserFrame browser = new BrowserFrame("",
            new ExternalResource("https://app.validic.com/54d4fdb88ee42122c2000013/dbsvmtYYW8e_o6bn2DMs"));
    browser.setWidth("100%");
    browser.setHeight("500px");
    content.addComponent(browser);//ww  w .  ja va  2s.  co  m
    setContent(new CssLayout(content));
}

From source file:gov.va.ehtac.myappsonfhir.ui.Vitals.java

public Vitals() {
    session = ((HealthElementsForPatientTouchKitUI) UI.getCurrent()).getSessionAttributes();
    setCaption("Observations - " + session.getPatientNameGenderDisplay());
    final VerticalComponentGroup content = new VerticalComponentGroup();

    createTable();//ww  w. j av a2 s .  c o m

    content.addComponent(vitalsTable);

    final Button submitButton = new Button("Submit");
    submitButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Notification.show("Thanks!");
        }
    });

    setContent(new CssLayout(content));

}