Example usage for com.vaadin.ui CssLayout setWidth

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

Introduction

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

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

From source file:fr.amapj.view.engine.menu.MenuPart.java

License:Open Source License

public void buildMainView(final AmapUI ui, ValoMenuLayout root) {
    root.prepareForMainPage();//from   www .  j  a v a  2 s. c om

    viewNameToMenuButton = new HashMap<String, Button>();

    CssLayout menu = new CssLayout();
    CssLayout menuItemsLayout = new CssLayout();

    if (ui.getPage().getWebBrowser().isIE() && ui.getPage().getWebBrowser().getBrowserMajorVersion() == 9) {
        menu.setWidth("320px");
    }

    // Chargement de tous les menus accesibles par l'utilisateur
    // et cration du "navigator"
    List<MenuDescription> allMenus = MenuInfo.getInstance().getMenu();

    Navigator nav = new Navigator(ui, root.getContentContainer());
    nav.addViewChangeListener(new ViewChangeListener() {

        @Override
        public boolean beforeViewChange(ViewChangeEvent event) {
            logger.info("Entre dans l'cran {}", event.getViewName());
            return true;
        }

        @Override
        public void afterViewChange(ViewChangeEvent event) {
            menu.removeStyleName("valo-menu-visible");
        }
    });

    if (allMenus.size() > 0) {
        MenuDescription first = allMenus.get(0);
        nav.setErrorView(first.getViewClass());
    }

    for (MenuDescription mD : allMenus) {
        nav.addView("/" + mD.getMenuName().name().toLowerCase(), mD.getViewClass());
    }

    // Cration du menu 
    root.addMenu(buildMenu(menu, menuItemsLayout, allMenus, nav, ui));

}

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

License:Open Source License

public void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("Access Control Decisioning Logs - "
            + AdminContext.getSessionAttributes().getSelectedPatientName());

    table = new Table();
    table.setWidth("100%");
    table.setHeight("350px");
    table.setMultiSelect(false);/*from www  .jav  a2s  .  c  om*/
    table.setSelectable(true);
    table.setImmediate(true); // react at once when something is selected
    table.setEditable(false);
    table.setWriteThrough(true);
    table.setContainerDataSource(populateAuthorizationRequests());

    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(false);
    table.setVisibleColumns(new Object[] { "msgDate", "healthcareObject", "purposeOfUse", "requestor",
            "uniqueIdentifier", "decision", "responsetime", "messageId" });
    table.setColumnHeaders(new String[] { "Date", "Resource", "POU", "Recipient", "Patient ID", "PDP Decision",
            "Resp. Time(ms)", "Message ID" });

    content.addComponent(table);

    Button obligationsBTN = new Button("Obligations");
    Button rulesGeneratedBTN = new Button("SLS - Rules Generated");
    Button rulesExecutedBTN = new Button("SLS - Rules Executed");

    HorizontalComponentGroup hGroup = new HorizontalComponentGroup();
    hGroup.setWidth("100%");

    hGroup.addComponent(obligationsBTN);
    hGroup.addComponent(rulesGeneratedBTN);
    hGroup.addComponent(rulesExecutedBTN);

    content.addComponent(hGroup);

    obligationsBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            AuthLog log = getAuthLogObject();
            if (log != null) {
                String drl = log.getObligations();
                Popover popover = getPopoverTextArea(drl, "XACML Response - Obligations");
                popover.showRelativeTo(getNavigationBar());
            }
        }
    });

    rulesGeneratedBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            AuthLog log = getAuthLogObject();
            if (log != null) {
                String drl = log.getGenDrl();
                Popover popover = getPopoverTextArea(drl, "Generated DRL (Annotation Rules)");
                popover.showRelativeTo(getNavigationBar());
            }
        }
    });

    rulesExecutedBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            AuthLog log = getAuthLogObject();
            if (log != null) {
                String drl = log.getExecRules();
                Popover popover = getPopoverTextArea(drl, "Executed Annotation Rules");
                popover.showRelativeTo(getNavigationBar());
            }
        }
    });

    setContent(content);
}

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

License:Open Source License

private void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("eHealth Direct - " + AdminContext.getSessionAttributes().getUserId());

    hp.setStyleName(Runo.SPLITPANEL_SMALL);
    hp.setSplitPosition(20, Sizeable.UNITS_PERCENTAGE);
    hp.setHeight("450px");
    hp.setLocked(false);//w  ww .j a  va 2 s. c  o m
    hp.setFirstComponent(getDropArea());
    hp.setSecondComponent(getResultsTable());

    HorizontalComponentGroup hg = new HorizontalComponentGroup();
    hg.setWidth("100%");
    hg.addComponent(refresh);
    hg.addComponent(viewMetaData);
    hg.addComponent(viewEncryptedDoc);
    hg.addComponent(viewTransformed);
    hg.addComponent(testDisclosure);

    viewMetaData.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            processMetaDataForViewing();
        }
    });

    viewTransformed.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            //test for selection
            Directprocessing obj = getTableObject();
            if (obj != null) {
                String refrainPolicy = obj.getRefrainPolicy();
                String doc = obj.getDocument();
                if (refrainPolicy.equals("NORDSLCD")) {
                    getWindow().showNotification("Warning", disclosure,
                            Window.Notification.TYPE_WARNING_MESSAGE);
                }
                Popover popover = getPopoverLabel(getHTMLVersionOfCDA(doc), "Transformed Clinical Summary");
                popover.showRelativeTo(getNavigationBar());

            }
        }
    });

    content.addComponent(hp);
    content.addComponent(hg);

    setContent(content);

}

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

License:Open Source License

private void buildView() {
    CssLayout content = new CssLayout();
    content.setWidth("100%");
    setCaption("eHealth Exchange - " + AdminContext.getSessionAttributes().getSelectedPatientName());

    VerticalComponentGroup vGroup = new VerticalComponentGroup();

    Label displayAction = new Label(
            "<div style='color:#333;'><p>First perform a secured <b>Search</b> (DocumentQuery) for all available patient documents."
                    + "  Then <b>highlight</b> the document of interest in the table, then click"
                    + " on the <b>Retrieve Document</b> button to perform a secured DocumentRetrieve."
                    + "  Decrpyt the document by clicking any of the 2 <b>Decryption</b> buttons results may vary depending"
                    + " on you privileges.  Once decrypted you may view the HTML form by clicking on the <b>View Clinical Document</b>.</p></div>",
            Label.CONTENT_XHTML);

    vGroup.addComponent(displayAction);/*from  ww w.  java2 s  .  c o  m*/

    Button searchBTN = new Button("Search");
    searchBTN.setStyleName(Runo.BUTTON_SMALL);
    searchBTN.setWidth("100");
    content.addComponent(vGroup);
    content.addComponent(searchBTN);

    table = new Table();
    table.setWidth("100%");
    table.setHeight("350px");
    table.setMultiSelect(false);
    table.setSelectable(true);
    table.setImmediate(true); // react at once when something is selected
    table.setEditable(false);
    table.setWriteThrough(true);
    table.setContainerDataSource(populateTable());

    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(false);
    table.setVisibleColumns(new Object[] { "patientId", "docId", "docType", "respId", "msgId" });
    table.setColumnHeaders(
            new String[] { "Patient ID", "Document ID", "Document Type", "Repository", "Message" });

    content.addComponent(table);

    retrieveBTN = new Button("Retrieve Document");
    decryptDocBTN = new Button("Decrypt Document");
    decryptDocMaskBTN = new Button("Decrypt Doc and Entries");
    viewHTMLBTN = new Button("View Clinical Document");
    viewPDFBTN = new Button("Consent PDF");
    viewXACMLBTN = new Button("Consent Policy");
    viewSAMLBTN = new Button("View Authorization (SAML)");
    viewMetaData = new Button("View Meta Data");

    HorizontalComponentGroup hGroup = new HorizontalComponentGroup();
    hGroup.setWidth("100%");

    retrieveBTN.setEnabled(false);
    decryptDocBTN.setEnabled(false);
    decryptDocMaskBTN.setEnabled(false);
    viewHTMLBTN.setEnabled(false);
    viewPDFBTN.setEnabled(false);
    viewXACMLBTN.setEnabled(false);
    viewSAMLBTN.setEnabled(false);
    viewMetaData.setEnabled(false);

    hGroup.addComponent(retrieveBTN);
    hGroup.addComponent(decryptDocBTN);
    hGroup.addComponent(decryptDocMaskBTN);
    hGroup.addComponent(viewHTMLBTN);
    hGroup.addComponent(viewPDFBTN);
    hGroup.addComponent(viewXACMLBTN);
    hGroup.addComponent(viewSAMLBTN);
    hGroup.addComponent(viewMetaData);

    content.addComponent(hGroup);

    searchBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            patientId = AdminContext.getSessionAttributes().getSelectedPatientId();
            patientName = AdminContext.getSessionAttributes().getSelectedPatientName();
            currentDocument = "";
            decryptDocument = "";
            requestedService = "DocQuery";
            //area.setValue(currentDocument);
            //area.setCaption("No Documents Selected");

            String decision = "Permit";
            if (patientId.equals("PUI100015060013")) {
                PolicyEnforcementObject pObj = policyEngine.enforceResouce(
                        AdminContext.getSessionAttributes().getPurposeOfUse(), "PSY", "DocumentQueryOut");
                decision = pObj.getPdpDecision();
            }
            if (decision.equals("Permit")) {
                String res = lookUpPatient();
                metaData = res;
                if (res.indexOf("XDSDocumentEntry.uniqueId") > -1) {
                    AdhocQueryResponse adhoc = getQueryResponse(res);

                    RegistryObjectListType rList = adhoc.getRegistryObjectList();
                    List<ExchangeResults> xList = processMetaData(rList);
                    refreshTable(xList);
                } else {
                    //throw warning 
                    docId = "NA";
                    docType = "NA";
                    messageId = "NA";
                    respId = "1.3.6.1.4.1.21367.2010.1.2.1040";
                    ExchangeResults eR = new ExchangeResults(patientName, patientId, docId, docType, "", "", "",
                            messageId, respId);
                    List<ExchangeResults> xList = new ArrayList();
                    xList.add(eR);
                    refreshTable(xList);
                    displayErrorMessage(res);
                }
                retrieveBTN.setEnabled(false);
                decryptDocBTN.setEnabled(false);
                decryptDocMaskBTN.setEnabled(false);
                viewHTMLBTN.setEnabled(false);
                viewPDFBTN.setEnabled(false);
                viewXACMLBTN.setEnabled(false);
                viewSAMLBTN.setEnabled(true);
                viewMetaData.setEnabled(true);
            } else {
                getWindow().showNotification("Warning",
                        "You do not have the necessary authorization privileges to perform this operation.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
            }
        }
    });

    table.addListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            Object rowId = table.getValue();
            if (rowId != null) {
                patientName = (String) table.getContainerProperty(rowId, "patientName").getValue();
                patientId = (String) table.getContainerProperty(rowId, "patientId").getValue();
                docId = (String) table.getContainerProperty(rowId, "docId").getValue();
                docType = (String) table.getContainerProperty(rowId, "docType").getValue();
                respId = (String) table.getContainerProperty(rowId, "respId").getValue();
                messageId = (String) table.getContainerProperty(rowId, "msgId").getValue();
                if (docType.equals("Consult Notes")) {
                    retrieveBTN.setEnabled(true);
                    decryptDocBTN.setEnabled(true);
                    decryptDocBTN.setCaption("Decrypt Document");
                    decryptDocMaskBTN.setEnabled(true);
                    viewHTMLBTN.setEnabled(true);
                    viewPDFBTN.setEnabled(false);
                    viewXACMLBTN.setEnabled(false);
                } else if (docType.equals("Consent Notes") || docType.equals("Consult")) {
                    retrieveBTN.setEnabled(true);
                    decryptDocBTN.setEnabled(true);
                    decryptDocBTN.setCaption("Extract Document");
                    decryptDocMaskBTN.setEnabled(false);
                    viewHTMLBTN.setEnabled(true);
                    viewPDFBTN.setEnabled(true);
                    viewXACMLBTN.setEnabled(true);
                } else {
                    getWindow().showNotification("Warning", "Could not determine document type for processing.",
                            Window.Notification.TYPE_WARNING_MESSAGE);
                }
            }

        }
    });

    retrieveBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            Object rowId = table.getValue();
            String decision = "Permit";
            if (patientId.equals("PUI100015060013")) {
                PolicyEnforcementObject pObj = policyEngine.enforceResouce(
                        AdminContext.getSessionAttributes().getPurposeOfUse(), "PSY", "DocumentRetrieveOut");
                decision = pObj.getPdpDecision();
            }
            if (decision.equals("Permit")) {
                if (rowId != null) {
                    getDocument();
                    requestedService = "DocRetrieve";
                    System.out.println("CURRENT DOCUMENT SIZE: " + currentDocument.length());
                    Popover popover = getPopoverTextArea(currentDocument, "Document Retrieve Response");
                    popover.showRelativeTo(getNavigationBar());
                } else {
                    getWindow().showNotification("Warning",
                            "No row selected, Please select document for retrieval.",
                            Window.Notification.TYPE_WARNING_MESSAGE);
                }
            } else {
                getWindow().showNotification("Warning",
                        "You do not have the necessary authorization privileges to perform this operation.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
            }
        }
    });

    decryptDocBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (currentDocument.length() == 0) {
                getWindow().showNotification("Warning", "You must select and retrieve document first.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
            } else {

                try {
                    String sOrg = AdminContext.getSessionAttributes().getSelectedOrg();
                    if (sOrg.equals("FEISystems")) {
                        ihe.iti.xds_b._2007.RetrieveDocumentSetResponse xdsbRetrieveDocumentSetResponse = unmarshallFromXml(
                                ihe.iti.xds_b._2007.RetrieveDocumentSetResponse.class, currentDocument);
                        ihe.iti.xds_b._2007.RetrieveDocumentSetResponse.DocumentResponse documentResponse = xdsbRetrieveDocumentSetResponse
                                .getDocumentResponse().get(0);
                        if (docType.equals("Consult Notes")) {
                            byte[] processDocBytes = documentResponse.getDocument();

                            decryptDocument = decryptDocumentExcludeElements(processDocBytes, keyD);
                        } else {
                            byte[] processDocBytes = documentResponse.getDocument();
                            decryptDocument = new String(processDocBytes);
                        }
                    } else {
                        decryptDocument = currentDocument;
                    }
                    Popover popover = getPopoverLabel(convertXMLtoXHTML(decryptDocument),
                            "Decrypted - Document Only");
                    popover.showRelativeTo(getNavigationBar());
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }
        }
    });

    decryptDocMaskBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (currentDocument.length() == 0) {
                getWindow().showNotification("Warning", "You must select and retrieve document first.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
            } else {
                String decision = "Permit";

                if (patientId.equals("PUI100015060013")) {
                    PolicyEnforcementObject pObj = policyEngine.enforceResouce(
                            AdminContext.getSessionAttributes().getPurposeOfUse(), "PSY",
                            "DocumentEntryUnMask");
                    decision = pObj.getPdpDecision();
                }
                if (decision.equals("Permit")) {
                    try {
                        ihe.iti.xds_b._2007.RetrieveDocumentSetResponse xdsbRetrieveDocumentSetResponse = unmarshallFromXml(
                                ihe.iti.xds_b._2007.RetrieveDocumentSetResponse.class, currentDocument);
                        ihe.iti.xds_b._2007.RetrieveDocumentSetResponse.DocumentResponse documentResponse = xdsbRetrieveDocumentSetResponse
                                .getDocumentResponse().get(0);
                        if (docType.equals("Consult Notes")) {
                            byte[] processDocBytes = documentResponse.getDocument();

                            decryptDocument = decryptDocument(processDocBytes, keyD, keyM);
                        } else {
                            byte[] processDocBytes = documentResponse.getDocument();
                            decryptDocument = new String(processDocBytes);
                        }
                        Popover popover = getPopoverLabel(convertXMLtoXHTML(decryptDocument),
                                "Decrypted - Document and Masked Entries");
                        popover.showRelativeTo(getNavigationBar());
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                } else {
                    getWindow().showNotification("Warning",
                            "You do not have the necessary authorization privileges to perform this operation.",
                            Window.Notification.TYPE_WARNING_MESSAGE);
                }
            }
        }
    });

    viewHTMLBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (decryptDocument.length() == 0) {
                getWindow().showNotification("Warning",
                        "You must select and retrieve document first, then view decrypted version, before attempting to transform it.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
            } else {
                String decision = "Permit";

                if (patientId.equals("PUI100015060013")) {
                    PolicyEnforcementObject pObj = policyEngine.enforceResouce(
                            AdminContext.getSessionAttributes().getPurposeOfUse(), "PSY", "DocumentView");
                    decision = pObj.getPdpDecision();
                }
                if (decision.equals("Permit")) {
                    String sOrg = AdminContext.getSessionAttributes().getSelectedOrg();
                    if (sOrg.equals("FEISystems")) {
                        getWindow().showNotification("Warning", disclosure,
                                Window.Notification.TYPE_WARNING_MESSAGE);
                    }
                    String title = "";
                    if (docType.equals("Consult Notes")) {
                        title = "Summary of Episode - C32";
                    } else if (docType.equals("Consent Notes")) {
                        title = "CDA R2 Consent Directive";
                    } else {
                        title = "Unknown Document Type";
                    }

                    Popover popover = getPopoverLabel(getHTMLVersionOfCDA(decryptDocument), title);
                    popover.showRelativeTo(getNavigationBar());
                } else {
                    getWindow().showNotification("Warning",
                            "You do not have the necessary authorization privileges to perform this operation.",
                            Window.Notification.TYPE_WARNING_MESSAGE);
                }
            }
        }
    });

    viewPDFBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            processPDFForViewing();
        }
    });

    viewXACMLBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            processXACMLForViewing();
        }
    });

    viewSAMLBTN.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            processSAMLForViewing();
        }
    });

    viewMetaData.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            processMetaDataForViewing();
        }
    });

    setContent(content);

}

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

License:Open Source License

private void buildView() {
    try {//from   w w w  .  j a va2  s. c om
        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/*  w  ww .  j a v  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 {//  ww  w .j a  v  a 2  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);//w  ww.  j  av  a2 s.c  om

    //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  .ja  v  a 2s.c o  m*/
    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);// w  w  w  .j  a  va 2  s  . c o m
    vGroup.addComponent(password);

    content.addComponent(vGroup);

    setContent(content);
}