List of usage examples for com.vaadin.ui CssLayout addComponent
@Override public void addComponent(Component c)
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 www. ja va 2s . 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);// ww w. ja v a2s . c om 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 w w . j a va 2s . com 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);/*from ww w . jav a 2 s.com*/ 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; }
From source file:gov.va.ehtac.appsonfhir.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 ava2 s .c o m*/ public void buttonClick(ClickEvent event) { ((HealthElementsTouchKitUI) UI.getCurrent()).getSession().close(); } }); vGroup.addComponent(logoutAction); vGroup.addComponent(okBTN); content.addComponent(vGroup); setContent(content); }
From source file:gov.va.ehtac.appsonfhir.ui.PatientSearch.java
private Popover getPopoverResults() { popover = new Popover(); popover.setModal(true);/* w ww.ja v a2s . c o m*/ popover.setClosable(true); popover.setWidth("500px"); popover.setHeight("350px"); CssLayout popLayout = new CssLayout(); popLayout.setSizeFull(); NavigationView navView = new NavigationView(popLayout); navView.setCaption("Search Results"); CssLayout layout2 = new CssLayout(); createTable(); layout2.addComponent(searchTable); Button selectPatient = new Button("Select", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { Object rowId = searchTable.getValue(); if (rowId != null) { String id = (String) searchTable.getContainerProperty(rowId, "patientid").getValue(); String last = (String) searchTable.getContainerProperty(rowId, "lastname").getValue(); String first = (String) searchTable.getContainerProperty(rowId, "firstname").getValue(); String gender = (String) searchTable.getContainerProperty(rowId, "gender").getValue(); String dob = (String) searchTable.getContainerProperty(rowId, "dob").getValue(); PatientSearchResults results = (PatientSearchResults) searchTable .getContainerProperty(rowId, "oResults").getValue(); session.setPatientId(id); session.setPatientNameAgeGenderDisplay(last + ", " + first + " " + gender + " " + dob); patientDisplayName.setValue(session.getPatientNameAgeGenderDisplay()); System.out.println("PATIENT NameAgeGender: " + session.getPatientNameAgeGenderDisplay() + " PATIENT ID: " + session.getPatientId()); System.out.println(results.getPayload()); popover.close(); grabAllPatientData(); } } catch (Exception ex) { ex.printStackTrace(); } } }); layout2.addComponent(selectPatient); popLayout.addComponent(layout2); Button close = new Button(null, new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { popover.removeFromParent(); } }); close.setIcon(new ThemeResource("../runo/icons/64/cancel.png")); navView.setLeftComponent(close); navView.setRightComponent(selectPatient); popover.setContent(navView); return popover; }
From source file:gov.va.ehtac.appsonfhir.ui.ProfileView.java
License:Open Source License
private void buildView() { session = ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes(); 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>Privacy on FHIR</b> " + "Purpose of Use, and Security Level for local Access Control Decisions.</d></div>", Label.CONTENT_XHTML); vGroup.addComponent(profileAction);/* w ww . j a v a 2 s. 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(session.getProviderId()); userIdFLD.setValue(session.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(true); 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(session.getPurposeOfUse()); confCBX.setValue(session.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("Military Health Systems"); organizationUnitFLD.setValue("Navy Medical Center San Diego - NMCSD"); 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("San Diego"); stateFLD.setValue("CA"); zipFLD.setValue("92104"); 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(); session.setPurposeOfUse(val); } }); confCBX.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { String val = (String) confCBX.getValue(); session.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.ehtac.myappsonfhir.ui.ImmunizationRequest.java
private Popover getPopoverResults(String umaResults) { popover = new Popover(); popover.setModal(true);// www . ja v a2 s . c o m popover.setClosable(true); popover.setWidth("500px"); popover.setHeight("350px"); CssLayout popLayout = new CssLayout(); popLayout.setSizeFull(); NavigationView navView = new NavigationView(popLayout); navView.setCaption("Request Completed"); Label lbl = new Label(umaResults); CssLayout layout2 = new CssLayout(); layout2.addComponent(lbl); setTable(); layout2.addComponent(immunizationTable); popLayout.addComponent(layout2); Button close = new Button(null, new Button.ClickListener() { @Override 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; }
From source file:gov.va.ehtac.myappsonfhir.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 w w .ja va 2 s.co m public void buttonClick(ClickEvent event) { ((HealthElementsForPatientTouchKitUI) UI.getCurrent()).getSession().close(); } }); vGroup.addComponent(logoutAction); vGroup.addComponent(okBTN); content.addComponent(vGroup); setContent(content); }
From source file:info.magnolia.messages.app.MessagesViewImpl.java
License:Open Source License
@Inject public MessagesViewImpl(SimpleTranslator i18n) { this.i18n = i18n; // create form and data item final Message message = new Message(); // message POJO BeanItem<Message> messageItem = new BeanItem<Message>(message); final FieldGroup form = new FieldGroup(); form.setItemDataSource(messageItem); Field<String> subjectField = createSubjectTextField(); Field<String> messageBodyField = createMessageBodyTextField(); Field<?> typeField = createTypeSelectionField(); Field<?> scopeField = createScopeSelectionField(); userOrGroupIdField = createUserOrGroupIdTextField(); // disable user/group field if not necessary scopeField.addValueChangeListener(new ValueChangeListener() { @Override//from w ww .ja v a 2 s .c o m public void valueChange(ValueChangeEvent event) { updateUserOrGroupField((String) event.getProperty().getValue()); } }); form.bind(subjectField, "title"); form.bind(messageBodyField, "content"); form.bind(typeField, "type"); form.bind(scopeField, "scope"); form.bind(userOrGroupIdField, "user"); // FieldGroup overrides fields' own enabled property with its own. updateUserOrGroupField(message.getScope()); FormLayout layout = new FormLayout(); layout.addComponent(subjectField); layout.addComponent(messageBodyField); layout.addComponent(typeField); layout.addComponent(scopeField); layout.addComponent(userOrGroupIdField); layout.setSpacing(true); layout.setMargin(false); layout.setWidth("100%"); // send button NativeButton sendButton = new NativeButton(i18n.translate("messages-app.app.button.sendMessage"), new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { form.commit(); String subject = message.getTitle(); String content = message.getContent(); MessageType type = message.getType(); String scope = message.getScope(); if (MESSAGE_SCOPE_LOCAL.equals(scope)) { listener.handleLocalMessage(type, subject, content); } else if (MESSAGE_SCOPE_GLOBAL.equals(scope)) { listener.handleGlobalMessage(type, subject, content); } else if (MESSAGE_SCOPE_GROUP.equals(scope)) { // message is bound to FieldGroup - hence the group name is to be retrieved from the user field of the message final String groupName = message.getUser(); listener.handleGroupMessage(groupName, type, subject, content); } else { // User... final String userName = message.getUser(); listener.handleUserMessage(userName, type, subject, content); } } catch (CommitException e) { } } }); sendButton.addStyleName("btn-dialog"); sendButton.addStyleName("commit"); // reset button NativeButton resetButton = new NativeButton(i18n.translate("messages-app.app.button.reset"), new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { message.reset(); form.discard(); } }); resetButton.addStyleName("btn-dialog"); resetButton.addStyleName("cancel"); HorizontalLayout buttons = new HorizontalLayout(); buttons.addStyleName("buttons"); buttons.setSpacing(true); buttons.addComponent(sendButton); buttons.addComponent(resetButton); layout.addComponent(buttons); // intro text Label intro = new Label(i18n.translate("messages-app.app.label.intro"), ContentMode.HTML); intro.addStyleName("intro"); CssLayout container = new CssLayout(); container.setSizeFull(); container.addStyleName("small-app-panel"); container.addComponent(layout); CssLayout root = new CssLayout(); root.setSizeFull(); root.setWidth("900px"); root.setStyleName("small-app"); root.addComponent(intro); root.addComponent(container); component = root; }