List of usage examples for com.google.gwt.user.client.ui Label getText
public String getText()
From source file:org.ednovo.gooru.client.mvp.home.library.LibraryMenuNav.java
License:Open Source License
public void setPartners(ArrayList<LibraryUserDo> partnersList) { for (int i = 0; i < partnersList.size(); i++) { final LibraryUserDo libraryUserDo = partnersList.get(i); final Label partnerTitle = new Label(StringUtil.getPartnerName(libraryUserDo.getUsername())); partnerTitle.setStyleName(libraryStyleUc.courseOption()); partnerTitle.addClickHandler(new ClickHandler() { @Override//from w w w. ja v a2 s .co m public void onClick(ClickEvent event) { setHeaderBrowserTitle(partnerTitle.getText()); AppClientFactory.getPlaceManager().revealPlace(libraryUserDo.getUsername()); } }); partnerLibraries.add(partnerTitle); } }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.assign.CollectionAssignTabView.java
License:Open Source License
/** * //from w ww . jav a 2s . c om * @function setClasspageData * * @created_date : Jul 31, 2013 * * @description * Create Classpage (title) label and set to Classpage list box * * @parm(s) : @param classpageListDo * * @return : void * * @throws : <Mentioned if any exceptions> * * * * */ @Override public void setClasspageData(ClasspageListDo classpageListDo) { panelLoading.setVisible(false); int resultSize = classpageListDo.getSearchResults().size(); if (resultSize > 0) { htmlEvenPanelContainer.setVisible(true); if (toClear) { htmlClasspagesListContainer.clear(); toClear = false; } for (int i = 0; i < resultSize; i++) { String classpageTitle = classpageListDo.getSearchResults().get(i).getTitle(); classpageId = classpageListDo.getSearchResults().get(i).getGooruOid(); final Label titleLabel = new Label(classpageTitle); titleLabel.setStyleName(CollectionAssignCBundle.INSTANCE.css().classpageTitleText()); titleLabel.getElement().setAttribute("id", classpageId); //Set Click event for title titleLabel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { lblClasspagePlaceHolder.setText(titleLabel.getText()); lblClasspagePlaceHolder.getElement().setId(titleLabel.getElement().getId()); lblClasspagePlaceHolder .setStyleName(CollectionAssignCBundle.INSTANCE.css().selectedClasspageText()); classpageId = titleLabel.getElement().getId(); btnAssign.setEnabled(true); btnAssign.setStyleName(CollectionAssignCBundle.INSTANCE.css().activeAssignButton()); //btnAssign.setStyleName(AssignPopUpCBundle.INSTANCE.css().activeAssignButton()); //Hide the scroll container spanelClasspagesPanel.setVisible(false); } }); htmlClasspagesListContainer.add(titleLabel); } } else { //Set if there are not classpages. if (toClear) { panelNoClasspages.setVisible(true); } } }
From source file:org.errai.samples.rpcdemo.client.local.RPCDemo.java
License:Apache License
@PostConstruct public void init() { final Button checkMemoryButton = new Button("Check Memory Free"); final Label memoryFreeLabel = new Label(); final TextBox inputOne = new TextBox(); final TextBox inputTwo = new TextBox(); final Button appendTwoStrings = new Button("Append"); final Label appendResult = new Label(); checkMemoryButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { testService.call(new RemoteCallback<Long>() { @Override// w ww . ja va2 s . c o m public void callback(Long response) { memoryFreeLabel.setText("Free Memory: " + response); } }).getMemoryFree(); } }); appendTwoStrings.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { testService.call(new RemoteCallback<String>() { public void callback(String response) { appendResult.setText(response); } }).append(inputOne.getText(), inputTwo.getText()); } }); final Button voidReturn = new Button("Test Add", new ClickHandler() { public void onClick(ClickEvent clickEvent) { testService.call(new RemoteCallback<Long>() { public void callback(Long response) { appendResult.setText(String.valueOf(response)); } }).add(parseLong(inputOne.getText()), parseLong(inputTwo.getText())); } }); final Button dates = new Button("Dates", new ClickHandler() { public void onClick(ClickEvent clickEvent) { MessageBuilder.createCall(new RemoteCallback<List<Date>>() { public void callback(List<Date> response) { appendResult.setText(""); for (Date d : response) appendResult.setText(appendResult.getText() + " " + d.toString()); } }, TestService.class).getDates(); } }); final Button date = new Button("Date", new ClickHandler() { public void onClick(ClickEvent clickEvent) { MessageBuilder.createCall(new RemoteCallback<Date>() { public void callback(Date response) { appendResult.setText(response.toString()); } }, TestService.class).getDate(); } }); final Button exception = new Button("Exception", new ClickHandler() { public void onClick(ClickEvent clickEvent) { MessageBuilder.createCall(new RemoteCallback<Void>() { public void callback(Void response) { } }, new BusErrorCallback() { public boolean error(Message message, Throwable throwable) { try { throw throwable; } catch (TestException e) { Window.alert("Success! TestException received from remote call."); } catch (Throwable t) { GWT.log("An unexpected error has occured", t); } return false; } }, TestService.class).exception(); } }); VerticalPanel vPanel = new VerticalPanel(); HorizontalPanel memoryFreeTest = new HorizontalPanel(); memoryFreeTest.add(checkMemoryButton); memoryFreeTest.add(memoryFreeLabel); vPanel.add(memoryFreeTest); HorizontalPanel appendTest = new HorizontalPanel(); appendTest.add(inputOne); appendTest.add(inputTwo); appendTest.add(appendTwoStrings); appendTest.add(appendResult); vPanel.add(appendTest); vPanel.add(voidReturn); vPanel.add(dates); vPanel.add(date); vPanel.add(exception); RootPanel.get().add(vPanel); }
From source file:org.eurekastreams.web.client.ui.pages.search.SearchResultItemRenderer.java
License:Apache License
/** * @param result/*w w w . ja v a 2s .co m*/ * the result to render. * * @return the result as a widget. */ public Panel render(final ModelView result) { Panel resultWidget; if (result instanceof PersonModelView) { resultWidget = (Panel) personRenderer.render((PersonModelView) result); } else if (result instanceof DomainGroupModelView) { resultWidget = (Panel) groupRenderer.render((DomainGroupModelView) result); } else { resultWidget = new FlowPanel(); resultWidget.add(new Label("Unknown Result Type")); } Object[] resultArr = result.getFieldMatch().getMatchedFieldKeys().toArray(); FlowPanel matchedWidget = new FlowPanel(); if (resultArr.length > 0) { Label resultsLbl = new Label("Matches found in: "); matchedWidget.add(resultsLbl); matchedWidget.addStyleName(StaticResourceBundle.INSTANCE.coreCss().searchMetadata()); resultWidget.add(matchedWidget); } for (int i = 0; i < resultArr.length; i++) { Label keyLabel = new Label(humanReadableMetadataKeys.get(resultArr[i])); if (i + 1 < resultArr.length) { keyLabel.setText(keyLabel.getText() + ", "); } keyLabel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().searchMetadataKey()); matchedWidget.add(keyLabel); } return resultWidget; }
From source file:org.freemedsoftware.gwt.client.widget.ClaimDetailsWidget.java
License:Open Source License
public void createClaimDetailsPanel() { newClaimEventPanel.clear();/* ww w . j a va 2s .co m*/ claimDetailsPanel.clear(); newClaimEventPanel.setVisible(false); claimDetailsPanel.setVisible(true); FlexTable claimsInfoParentTable = new FlexTable(); claimsInfoParentTable.setBorderWidth(1); claimsInfoParentTable.getElement().getStyle().setProperty("borderCollapse", "collapse"); claimDetailsPanel.setWidth("100%"); claimDetailsPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); claimDetailsPanel.setSpacing(5); claimsInfoParentTable.setWidth("100%"); claimDetailsPanel.add(claimsInfoParentTable); Label lbCovInfo = new Label(_("Coverage Information")); lbCovInfo.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); lbCovInfo.getElement().getStyle().setProperty("fontSize", "15px"); lbCovInfo.getElement().getStyle().setProperty("textDecoration", "underline"); lbCovInfo.getElement().getStyle().setProperty("fontWeight", "bold"); FlexTable covInfoTable = new FlexTable(); covInfoTable.setWidth("100%"); final FlexTable covTypesTable = new FlexTable(); covTypesTable.setWidth("100%"); VerticalPanel covInfoVPanel = new VerticalPanel(); covInfoVPanel.setSpacing(10); covInfoVPanel.setWidth("95%"); covInfoVPanel.add(lbCovInfo); covInfoVPanel.add(covInfoTable); covInfoVPanel.add(covTypesTable); claimsInfoParentTable.setWidget(0, 0, covInfoVPanel); claimsInfoParentTable.getFlexCellFormatter().getElement(0, 0).setAttribute("width", "50%"); claimsInfoParentTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP); Label lbPatient = new Label(_("Patient") + ":"); lbPatient.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); lbPatientVal = new Label(); Label lbdob = new Label(_("Date of Birth") + ":"); lbdob.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbdobVal = new Label(); Label lbSSN = new Label(_("SSN") + ":"); lbSSN.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbSSNVal = new Label(); covInfoTable.setWidget(0, 0, lbPatient); covInfoTable.setWidget(0, 1, lbPatientVal); covInfoTable.setWidget(0, 2, lbdob); covInfoTable.setWidget(0, 3, lbdobVal); covInfoTable.setWidget(0, 4, lbSSN); covInfoTable.setWidget(0, 5, lbSSNVal); final Label lbRespParty = new Label(_("Resp. Party") + ":"); lbRespParty.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbRespPartyVal = new Label(); final Label lbRpDob = new Label(_("Date of Birth") + ":"); lbRpDob.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbRpDobVal = new Label(); final Label lbRpSSN = new Label(_("SSN") + ":"); lbRpSSN.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbRpSSNVal = new Label(); covInfoTable.setWidget(1, 0, lbRespParty); covInfoTable.setWidget(1, 1, lbRespPartyVal); covInfoTable.setWidget(1, 2, lbRpDob); covInfoTable.setWidget(1, 3, lbRpDobVal); covInfoTable.setWidget(1, 4, lbRpSSN); covInfoTable.setWidget(1, 5, lbRpSSNVal); final Label lbPrimary = new Label(_("Primary Coverage") + "/" + _("Location") + "/" + _("Ins. No.") + "/" + _("Copay") + "/" + _("Deductible")); lbPrimary.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbPrimaryVal = new Label(); covTypesTable.setWidget(0, 0, lbPrimary); covTypesTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP); covTypesTable.setWidget(0, 1, lbPrimaryVal); covTypesTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP); final Label lbSecondary = new Label(_("Secondary Coverage") + "/" + _("Location") + "/" + _("Ins. No.") + "/" + _("Copay") + "/" + _("Deductible")); lbSecondary.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbSecondaryVal = new Label(); covTypesTable.setWidget(1, 0, lbSecondary); covTypesTable.getFlexCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP); covTypesTable.setWidget(1, 1, lbSecondaryVal); covTypesTable.getFlexCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP); final Label lbTertiary = new Label(_("Tertiary Coverage") + "/" + _("Location") + "/" + _("Ins. No.") + "/" + _("Copay") + "/" + _("Deductible")); lbTertiary.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbTertiaryVal = new Label(); covTypesTable.setWidget(2, 0, lbTertiary); covTypesTable.getFlexCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP); covTypesTable.setWidget(2, 1, lbTertiaryVal); covTypesTable.getFlexCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP); Label lbClaimInfo = new Label(_("Claim Information")); lbClaimInfo.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); lbClaimInfo.getElement().getStyle().setProperty("fontSize", "15px"); lbClaimInfo.getElement().getStyle().setProperty("textDecoration", "underline"); lbClaimInfo.getElement().getStyle().setProperty("fontWeight", "bold"); final FlexTable clInfoTable = new FlexTable(); clInfoTable.setWidth("100%"); VerticalPanel clInfoVPanel = new VerticalPanel(); clInfoVPanel.setSpacing(10); clInfoVPanel.setWidth("95%"); clInfoVPanel.add(lbClaimInfo); clInfoVPanel.add(clInfoTable); claimsInfoParentTable.setWidget(0, 1, clInfoVPanel); claimsInfoParentTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP); Label lbDos = new Label(_("Date of Service") + ":"); lbDos.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbDosVal = new Label(); clInfoTable.setWidget(0, 0, lbDos); clInfoTable.setWidget(0, 1, lbDosVal); Label lbProvider = new Label(_("Provider") + ":"); lbProvider.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbProviderVal = new Label(); Label lbRefProv = new Label(_("Referring Provider") + ":"); lbRefProv.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbRefProvVal = new Label(); clInfoTable.setWidget(1, 0, lbProvider); clInfoTable.setWidget(1, 1, lbProviderVal); clInfoTable.setWidget(1, 2, lbRefProv); clInfoTable.setWidget(1, 3, lbRefProvVal); Label lbPOS = new Label(_("POS") + ":"); lbPOS.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbPOSVal = new Label(); Label lbCharges = new Label(_("Charges") + ":"); lbCharges.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbChargesVal = new Label(); clInfoTable.setWidget(2, 0, lbPOS); clInfoTable.setWidget(2, 1, lbPOSVal); clInfoTable.setWidget(2, 2, lbCharges); clInfoTable.setWidget(2, 3, lbChargesVal); Label lbCPT = new Label(_("CPT") + ":"); lbCPT.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbCPTVal = new Label(); Label lbPaid = new Label(_("Paid") + ":"); lbPaid.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbPaidVal = new Label(); clInfoTable.setWidget(3, 0, lbCPT); clInfoTable.setWidget(3, 1, lbCPTVal); clInfoTable.setWidget(3, 2, lbPaid); clInfoTable.setWidget(3, 3, lbPaidVal); Label lbICD = new Label(_("ICD") + ":"); lbICD.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbICDVal = new Label(); Label lbBalance = new Label(_("Balance") + ":"); lbBalance.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); final Label lbBalanceVal = new Label(); clInfoTable.setWidget(4, 0, lbICD); clInfoTable.setWidget(4, 1, lbICDVal); clInfoTable.setWidget(4, 2, lbBalance); clInfoTable.setWidget(4, 3, lbBalanceVal); ArrayList<String> params = new ArrayList<String>(); params.add("" + claimid); Util.callApiMethod("ClaimLog", "claim_information", params, new CustomRequestCallback() { @Override public void onError() { } @SuppressWarnings("unchecked") @Override public void jsonifiedData(Object data) { if (data != null) { HashMap<String, String> result = (HashMap<String, String>) data; if (result.get("patient") != null) lbPatientVal.setText(result.get("patient")); if (result.get("rp_name") != null) { lbRespPartyVal.setText(result.get("rp_name")); if (result.get("rp_name").toString().equalsIgnoreCase("self")) { lbRpDob.setVisible(false); lbRpDobVal.setVisible(false); lbRpSSN.setVisible(false); lbRpSSNVal.setVisible(false); } } else { lbRespParty.setVisible(false); lbRespPartyVal.setVisible(false); lbRpDob.setVisible(false); lbRpDobVal.setVisible(false); lbRpSSN.setVisible(false); lbRpSSNVal.setVisible(false); } if (result.get("patient_dob") != null) lbdobVal.setText(result.get("patient_dob")); if (result.get("provider_name") != null) lbProviderVal.setText(result.get("provider_name")); if (result.get("ssn") != null) lbSSNVal.setText(result.get("ssn")); if (result.get("rp_ssn") != null) lbRpSSNVal.setText(result.get("rp_ssn")); if (result.get("rp_dob") != null) lbRpDobVal.setText(result.get("rp_dob")); if (result.get("ref_provider_name") != null) lbRefProvVal.setText(result.get("ref_provider_name")); if (result.get("prim_cov") != null && !result.get("prim_cov").equals("")) { lbPrimaryVal.setText(result.get("prim_cov")); if (result.get("prim_copay") != null) lbPrimaryVal.setText(lbPrimaryVal.getText() + "/" + result.get("prim_copay")); if (result.get("prim_deduct") != null) lbPrimaryVal.setText(lbPrimaryVal.getText() + "/" + result.get("prim_deduct")); } else { lbPrimary.setVisible(false); lbPrimaryVal.setVisible(false); } if (result.get("sec_cov") != null && !result.get("sec_cov").equals("")) { lbSecondaryVal.setText(result.get("sec_cov")); if (result.get("sec_copay") != null) lbSecondaryVal.setText(lbSecondaryVal.getText() + "/" + result.get("sec_copay")); if (result.get("sec_deduct") != null) lbSecondaryVal.setText(lbSecondaryVal.getText() + "/" + result.get("sec_deduct")); } else { lbSecondary.setVisible(false); lbSecondaryVal.setVisible(false); } if (result.get("ter_cov") != null && !result.get("ter_cov").equals("")) { lbTertiaryVal.setText(result.get("ter_cov")); if (result.get("ter_copay") != null) lbTertiaryVal.setText(lbTertiaryVal.getText() + "/" + result.get("ter_copay")); if (result.get("ter_deduct") != null) lbTertiaryVal.setText(lbTertiaryVal.getText() + "/" + result.get("ter_deduct")); } else { lbTertiary.setVisible(false); lbTertiaryVal.setVisible(false); } if (result.get("facility") != null) lbPOSVal.setText(result.get("facility")); if (result.get("service_date") != null) lbDosVal.setText(result.get("service_date")); if (result.get("diagnosis") != null) lbICDVal.setText(result.get("diagnosis")); if (result.get("cpt_code") != null) lbCPTVal.setText(result.get("cpt_code")); if (result.get("fee") != null) lbChargesVal.setText(result.get("fee")); if (result.get("paid") != null) lbPaidVal.setText(result.get("paid")); if (result.get("balance") != null) lbBalanceVal.setText(result.get("balance")); } } }, "HashMap<String,String>"); HorizontalPanel actionPanel = new HorizontalPanel(); actionPanel.setSpacing(5); final Button addEventBtn = new Button(_("Add Event")); addEventBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { createClaimLogEventEntryPanel(); } }); final Button editClaimBtn = new Button(_("Modify Claim")); editClaimBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { PatientScreen p = new PatientScreen(); p.setPatient(patientId); Util.spawnTab(patientName, p); ProcedureScreen ps = new ProcedureScreen(); ps.setModificationRecordId(claimid); ps.setPatientId(patientId); ps.loadData(); Util.spawnTabPatient(_("Manage Procedures"), ps, p); ps.loadData(); } }); final Button cancelBtn = new Button(_("Return to Search")); final ClaimDetailsWidget cdw = this; cancelBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cdw.removeFromParent(); callback.jsonifiedData("cancel"); } }); final Button newSearchBtn = new Button(_("New Search")); newSearchBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cdw.removeFromParent(); callback.jsonifiedData("new"); } }); actionPanel.add(addEventBtn); actionPanel.add(cancelBtn); actionPanel.add(newSearchBtn); actionPanel.add(editClaimBtn); claimDetailsPanel.add(actionPanel); final CustomTable claimsLogTable = new CustomTable(); claimsLogTable.setAllowSelection(false); claimsLogTable.setSize("100%", "100%"); claimsLogTable.addColumn(_("Date"), "date"); claimsLogTable.addColumn(_("User"), "user"); claimsLogTable.addColumn(_("Action"), "action"); claimsLogTable.addColumn(_("Comment"), "comment"); Util.callApiMethod("ClaimLog", "events_for_procedure", params, new CustomRequestCallback() { @Override public void onError() { } @SuppressWarnings("unchecked") @Override public void jsonifiedData(Object data) { if (data != null) { HashMap<String, String>[] result = (HashMap<String, String>[]) data; claimsLogTable.loadData(result); } } }, "HashMap<String,String>[]"); claimDetailsPanel.add(claimsLogTable); }
From source file:org.freemedsoftware.gwt.client.widget.RemittReportsWidget.java
License:Open Source License
public void loadMonthsInfo() { allReportTable = new FlexTable(); allReportTable.setWidth("80%"); reportsPanel.clear();/* w ww.j a v a2s. co m*/ reportsPanel.add(allReportTable); Util.callModuleMethod("RemittBillingTransport", "getMonthsInfo", (Integer) null, new CustomRequestCallback() { @Override public void onError() { } @SuppressWarnings("unchecked") @Override public void jsonifiedData(Object data) { if (data != null) { final HashMap<String, String>[] result = (HashMap[]) data; for (int i = 0; i < result.length; i++) { int row = i / 2; int col = i % 2; VerticalPanel reportPanel = new VerticalPanel(); reportPanel.setSpacing(10); reportPanel.setWidth("70%"); HorizontalPanel hpanel = new HorizontalPanel(); hpanel.setSpacing(5); final Label expandLb = new Label("+"); final CustomTable reportsInfoTable = new CustomTable(); reportsInfoTable.setAllowSelection(false); reportsInfoTable.setWidth("100%"); reportsInfoTable.addColumn(_("Report"), "filename"); reportsInfoTable.addColumn(_("Size"), "filesize"); reportsInfoTable.addColumn(_("Date Sent"), "inserted"); reportsInfoTable.addColumn(_("Action"), "action"); reportsInfoTable .setTableWidgetColumnSetInterface(new TableWidgetColumnSetInterface() { @Override public Widget setColumn(String columnName, final HashMap<String, String> data) { if (columnName.compareTo("action") == 0) { HorizontalPanel actionPanel = new HorizontalPanel(); actionPanel.setSpacing(5); HTML htmlLedger = new HTML("<a href=\"javascript:undefined;\">" + _("View") + "</a>"); htmlLedger.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { String[] params = { "output", data.get("filename"), "html" }; Window.open(URL.encode(Util.getJsonRequest( "org.freemedsoftware.api.Remitt.GetFile", params)), data.get("filename"), ""); } }); HTML htmlReSend = null; if (data.get("originalId") != null) { htmlReSend = new HTML("<a href=\"javascript:undefined;\">" + _("Re-Send") + "</a>"); htmlReSend.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { CustomRequestCallback cb = new CustomRequestCallback() { @Override public void onError() { } @Override public void jsonifiedData(Object data) { rebillPanel.setVisible(false); reportsPanel.setVisible(true); loadMonthsInfo(); } }; reportsPanel.setVisible(false); rebillPanel.clear(); HashSet<String> hs = new HashSet<String>(); hs.add(data.get("originalId")); RemittBillingWidget billClaimsWidget = new RemittBillingWidget( hs, cb, BillingType.REBILL); rebillPanel.add(billClaimsWidget); rebillPanel.setVisible(true); } }); } else { htmlReSend = new HTML( "<a href=\"javascript:undefined;\" style=\"cursor:default;color: blue;\">" + _("Re-Send") + "</a>"); } actionPanel.add(htmlLedger); actionPanel.add(htmlReSend); return actionPanel; } else if (columnName.compareTo("inserted") == 0) { Label lb = new Label(data.get("inserted").substring(0, 10)); return lb; } else { return (Widget) null; } } }); reportsInfoTable.setVisible(false); expandLb.getElement().getStyle().setCursor(Cursor.POINTER); final int index = i; expandLb.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { if (expandLb.getText().trim().equals("+")) { expandLb.setText("-"); reportsInfoTable.setVisible(true); loadReportsDetails(result[index].get("month"), reportsInfoTable); } else { expandLb.setText("+"); reportsInfoTable.setVisible(false); } } }); hpanel.setWidth("100%"); hpanel.setStyleName(AppConstants.STYLE_TABLE_HEADER); Label infoLb = new Label(result[i].get("month")); hpanel.add(expandLb); hpanel.add(infoLb); hpanel.setCellWidth(expandLb, "5px"); reportPanel.add(hpanel); reportPanel.add(reportsInfoTable); allReportTable.setWidget(row, col, reportPanel); allReportTable.getFlexCellFormatter().setVerticalAlignment(row, col, HasVerticalAlignment.ALIGN_TOP); // panel.add(); // panel.add(reportsInfoTable); } } } }, "HashMap<String,String>[]"); }
From source file:org.kino.client.theater.EditTheaterDialog.java
public EditTheaterDialog(final TheaterItem itemforUpdate) { setModal(true);//from w w w . j av a 2s. c o m setSize("500px", "500px"); setBodyStyle("backgroundColor:white"); BorderLayoutContainer borderLayoutContainer = new BorderLayoutContainer(); add(borderLayoutContainer, new MarginData(0, 0, 0, 0)); setHeadingText(" "); setPredefinedButtons(Dialog.PredefinedButton.CANCEL, Dialog.PredefinedButton.YES); final Label lab_uniq_ident = new Label(itemforUpdate.main.uniqIdent); final TextField field_name = new TextField(); final TextField field_n_server = new TextField(); final TextField field_hdd1 = new TextField(); final TextField field_hdd2 = new TextField(); final TextField field_bios_pass = new TextField(); field_name.setValue(itemforUpdate.main.name); field_n_server.setValue(itemforUpdate.main.n_server); field_hdd1.setValue(itemforUpdate.main.hdd1); field_hdd2.setValue(itemforUpdate.main.hdd2); field_bios_pass.setValue(itemforUpdate.main.biospass); VerticalLayoutContainer.VerticalLayoutData vertData = new VerticalLayoutContainer.VerticalLayoutData(1, -1); VerticalLayoutContainer ver_main = new VerticalLayoutContainer(); ver_main.setAdjustForScroll(true); ver_main.setScrollMode(ScrollSupport.ScrollMode.AUTO); ver_main.add(createLabel(lab_uniq_ident, " ", false), vertData); ver_main.add(createLabel(field_name, "?", true), vertData); ver_main.add(createLabel(field_n_server, " ?", true), vertData); ver_main.add(createLabel(field_hdd1, "HDD1", true), vertData); ver_main.add(createLabel(field_hdd2, "HDD2", true), vertData); ver_main.add(createLabel(field_bios_pass, "Bios pass", true), vertData); card.add(ver_main); final TextField field_county = new TextField(); final TextField field_city = new TextField(); final TextField field_street = new TextField(); final TextField field_house = new TextField(); final TextField field_index = new TextField(); field_county.setValue(itemforUpdate.address.county); field_city.setValue(itemforUpdate.address.city); field_street.setValue(itemforUpdate.address.street); field_house.setValue(itemforUpdate.address.house); field_index.setValue(itemforUpdate.address.index); VerticalLayoutContainer ver_address = new VerticalLayoutContainer(); ver_address.setScrollMode(ScrollSupport.ScrollMode.AUTO); ver_address.setAdjustForScroll(true); ver_address.add(createLabel(field_county, "", true), vertData); ver_address.add(createLabel(field_city, "", true), vertData); ver_address.add(createLabel(field_street, "", true), vertData); ver_address.add(createLabel(field_index, "?", true), vertData); ver_address.add(createLabel(field_house, "", true), vertData); card.add(ver_address); final TextField field_urid_county = new TextField(); final TextField field_urid_city = new TextField(); final TextField field_urid_street = new TextField(); final TextField field_urid_house = new TextField(); final TextField field_urid_index = new TextField(); final TextField field_urid_phone = new TextField(); final TextField field_urid_fax = new TextField(); final TextField field_urid_mail = new TextField(); field_urid_fax.setData("nullable", true); field_urid_mail.setData("nullable", true); field_urid_county.setValue(itemforUpdate.uridAdress.county); field_urid_city.setValue(itemforUpdate.uridAdress.city); field_urid_street.setValue(itemforUpdate.uridAdress.street); field_urid_house.setValue(itemforUpdate.uridAdress.house); field_urid_index.setValue(itemforUpdate.uridAdress.index); field_urid_phone.setValue(itemforUpdate.uridAdress.phone); field_urid_fax.setValue(itemforUpdate.uridAdress.fax); field_urid_mail.setValue(itemforUpdate.uridAdress.mail); VerticalLayoutContainer ver_urid_address = new VerticalLayoutContainer(); ver_urid_address.setScrollMode(ScrollSupport.ScrollMode.AUTO); ver_urid_address.setAdjustForScroll(true); ver_urid_address.add(createLabel(field_urid_county, "", true), vertData); ver_urid_address.add(createLabel(field_urid_city, "", true), vertData); ver_urid_address.add(createLabel(field_urid_street, "", true), vertData); ver_urid_address.add(createLabel(field_urid_index, "?", true), vertData); ver_urid_address.add(createLabel(field_urid_house, "", true), vertData); ver_urid_address.add(createLabel(field_urid_phone, "", true), vertData); ver_urid_address.add(createLabel(field_urid_fax, "?", false), vertData); ver_urid_address.add(createLabel(field_urid_mail, "mail", false), vertData); card.add(ver_urid_address); final TextField field_urid_comp_name = new TextField(); final TextField field_urid_director = new TextField(); final TextField field_urid_director_rd = new TextField(); final TextField field_urid_inn = new TextField(); final TextField field_urid_kpp = new TextField(); final TextField field_urid_ogrn = new TextField(); final TextField field_urid_rs = new TextField(); final TextField field_urid_bank = new TextField(); final TextField field_urid_bik = new TextField(); field_urid_comp_name.setValue(itemforUpdate.uridInfo.name); field_urid_director.setValue(itemforUpdate.uridInfo.dir_fio); field_urid_director_rd.setValue(itemforUpdate.uridInfo.dir_fio_rd); field_urid_inn.setValue(itemforUpdate.uridInfo.inn); field_urid_kpp.setValue(itemforUpdate.uridInfo.kpp); field_urid_ogrn.setValue(itemforUpdate.uridInfo.ogrn); field_urid_rs.setValue(itemforUpdate.uridInfo.rs); field_urid_bank.setValue(itemforUpdate.uridInfo.bank); field_urid_bik.setValue(itemforUpdate.uridInfo.bik); VerticalLayoutContainer ver_urid = new VerticalLayoutContainer(); ver_urid.setScrollMode(ScrollSupport.ScrollMode.AUTO); ver_urid.setAdjustForScroll(true); ver_urid.add(createLabel(field_urid_comp_name, "?", true), vertData); ver_urid.add(createLabel(field_urid_director, " (? ..)", true), vertData); ver_urid.add(createLabel(field_urid_director_rd, " ( ? .)", true), vertData); ver_urid.add(createLabel(field_urid_inn, "??", true), vertData); ver_urid.add(createLabel(field_urid_kpp, "", true), vertData); ver_urid.add(createLabel(field_urid_ogrn, "?", true), vertData); ver_urid.add(createLabel(field_urid_rs, "/?", true), vertData); ver_urid.add(createLabel(field_urid_bank, "", true), vertData); ver_urid.add(createLabel(field_urid_bik, " ", true), vertData); card.add(ver_urid); VerticalLayoutContainer ver_dogovor = new VerticalLayoutContainer(); ver_dogovor.setScrollMode(ScrollSupport.ScrollMode.AUTO); ver_dogovor.setAdjustForScroll(true); final TextField field_contract_number = new TextField(); final DateField field_contract_date = new DateField(); field_contract_number.setValue(itemforUpdate.main.contractNumber); field_contract_date.setValue(itemforUpdate.main.contractDate); ver_dogovor.add(createLabel(field_contract_number, " ", true), vertData); ver_dogovor.add(createLabel(field_contract_date, " ", true), vertData); card.add(ver_dogovor); List<FieldLabel> labels = FormPanelHelper.getFieldLabels(card); for (FieldLabel lbl : labels) { lbl.setLabelAlign(FormPanel.LabelAlign.TOP); } lcwest = new VBoxLayoutContainer(); lcwest.setPadding(new Padding(5)); lcwest.setVBoxLayoutAlign(VBoxLayoutContainer.VBoxLayoutAlign.STRETCH); BoxLayoutContainer.BoxLayoutData vBoxData = new BoxLayoutContainer.BoxLayoutData(new Margins(5, 5, 5, 5)); ValueChangeHandler handler = new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { if (event.getValue() == true) { int widgetIndex = lcwest.getWidgetIndex((ToggleButton) event.getSource()); card.setActiveWidget(card.getWidget(widgetIndex)); } } }; lcwest.add(createToggleButton("?", handler), vBoxData); lcwest.add(createToggleButton("?? ??", handler), vBoxData); lcwest.add(createToggleButton("? ?", handler), vBoxData); lcwest.add(createToggleButton("? ", handler), vBoxData); lcwest.add(createToggleButton("", handler), vBoxData); BorderLayoutContainer.BorderLayoutData west = new BorderLayoutContainer.BorderLayoutData(150); borderLayoutContainer.setWestWidget(lcwest, west); ContentPanel con = new ContentPanel(); con.setHeaderVisible(false); con.add(card, new MarginData(10, 0, 0, 10)); borderLayoutContainer.setCenterWidget(con); getButton(Dialog.PredefinedButton.CANCEL).addSelectHandler(new SelectEvent.SelectHandler() { @Override public void onSelect(SelectEvent event) { edited = false; hide(); } }); getButton(Dialog.PredefinedButton.YES).addSelectHandler(new SelectEvent.SelectHandler() { @Override public void onSelect(SelectEvent event) { if (!validateNotEmty(card)) { Info.display(SafeHtmlUtils.fromTrustedString(""), SafeHtmlUtils .fromTrustedString("<font color='red'>? ? ? </font>")); return; } final TheaterItem theater = new TheaterItem(itemforUpdate.id, false, new TheaterItem.Main(field_name.getValue(), lab_uniq_ident.getText(), field_n_server.getValue(), field_hdd1.getValue(), field_hdd2.getValue(), field_bios_pass.getValue(), field_contract_number.getValue(), field_contract_date.getValue()), new TheaterItem.Address(field_county.getValue(), field_city.getValue(), field_index.getValue(), field_street.getValue(), field_house.getValue()), new TheaterItem.UridAdress(field_urid_county.getValue(), field_urid_city.getValue(), field_urid_index.getValue(), field_urid_street.getValue(), field_urid_house.getValue(), field_urid_phone.getValue(), field_urid_fax.getValue(), field_urid_mail.getValue()), new TheaterItem.UridInfo(field_urid_comp_name.getValue(), field_urid_director.getValue(), field_urid_director_rd.getValue(), field_urid_inn.getValue(), field_urid_kpp.getValue(), field_urid_ogrn.getValue(), field_urid_rs.getValue(), field_urid_bank.getValue(), field_urid_bik.getValue()), null); CallbackWithFailureDialog<Void> callback = new CallbackWithFailureDialog<Void>( "? ? ") { @Override public void onFailure(Throwable caught) { super.onFailure(caught); //To change body of generated methods, choose Tools | Templates. } @Override public void onSuccess(Void result) { itemforUpdate.main = theater.main; itemforUpdate.address = theater.address; itemforUpdate.uridAdress = theater.uridAdress; itemforUpdate.uridInfo = theater.uridInfo; edited = true; hide(); } }; GWTServiceAsync.instance.updateTheaterInfo(theater, callback); } }); ((ToggleButton) lcwest.getWidget(0)).setValue(true); }
From source file:org.komodo.web.client.widgets.CustomPropertiesTable.java
License:Open Source License
private boolean contains(String propertyName) { for (int i = 1; i < propsTable.getRowCount(); ++i) { Label propLabel = (Label) propsTable.getWidget(i, 0); if (propLabel.getText().equalsIgnoreCase(propertyName)) return true; }/*from ww w.ja v a 2 s.co m*/ return false; }
From source file:org.komodo.web.client.widgets.CustomPropertiesTable.java
License:Open Source License
private void removeTableRow(final int row) { Label nameLabel = (Label) propsTable.getWidget(row, 0); final String propertyName = nameLabel.getText(); /*/*from w w w .jav a 2s. c om*/ * Delete the property */ final HasValueChangeHandlers<KomodoObjectPropertyBean> source = this; KObjectOperation operation = new KObjectOperation() { @Override public void execute(KomodoObjectBean kObject) { final KomodoObjectPropertyBean property = kObject.getProperty(propertyName); if (property == null) return; KomodoRpcService.get().removeProperty(property, new IRpcServiceInvocationHandler<KomodoObjectBean>() { @Override public void onReturn(final KomodoObjectBean result) { // Update the source komodo object to that from the server if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine("Removed property from komodo object: " + result.getPath()); //$NON-NLS-1$s if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine("Firing value change event for removed property"); //$NON-NLS-1$ ValueChangeEvent.fireIfNotEqual(source, property, null); // Remove the row in the misc table if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine("Removing row " + row + " from table"); //$NON-NLS-1$ //$NON-NLS-2$ propsTable.removeRow(row); } @Override public void onError(Throwable error) { String msg = "Failed to remove the property" + property.getName() + ": " //$NON-NLS-1$//$NON-NLS-2$ + error.getMessage(); Window.alert(msg); LOGGER.log(Level.SEVERE, msg, error); } }); } }; KObjectExecutor executor = new KObjectExecutor(); executor.executeOperation(kObjectPath, operation); }
From source file:org.kuali.continuity.admin.main.client.Setting.java
License:Educational Community License
public void onModuleLoad() { RootPanel rootPanel = RootPanel.get("gwtRoot"); rootPanel.setWidth("760px"); VerticalPanel vp = new VerticalPanel(); vp.add(new HTML("<h1>Setup System Parameters</h1>")); switchAccessOnoffHTML.setWidth("282px"); vp.add(switchAccessOnoffHTML);//from w w w. j av a2 s. c o m HorizontalPanel switchAccessPanel = new HorizontalPanel(); switchAccessPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); switchAccessPanel.setWidth("700px"); switchAccessPanel.add(locationLabel); locationTextLabel.setWidth("151px"); locationTextLabel.setText(""); locationTextLabel.addStyleName("settings-read-only"); locationTextBox.setText(""); locationTextBox.setReadOnly(true); locationTextBox.setStyleName("SettingsLocationTextBox"); locationTextBox.setWidth("300px"); // locationTextBox.addStyleName("SettingsLocationTextBox"); // locationTextBox.setStylePrimaryName("SettingsLocationTextBox"); // switchAccessPanel.add(locationTextLabel); switchAccessPanel.add(locationTextBox); switchAccessPanel.add(accessLabel); switchAccessPanel.add(accessListBox); switchAccessPanel.setCellVerticalAlignment(locationLabel, HasVerticalAlignment.ALIGN_MIDDLE); switchAccessPanel.setCellVerticalAlignment(accessLabel, HasVerticalAlignment.ALIGN_MIDDLE); switchAccessPanel.setCellVerticalAlignment(locationTextBox, HasVerticalAlignment.ALIGN_MIDDLE); switchAccessPanel.setCellVerticalAlignment(accessListBox, HasVerticalAlignment.ALIGN_MIDDLE); vp.add(switchAccessPanel); final Label usingThisControlLabel = new HTML( "<p class='StandardWidth'>Using this control, an Institution Administrator or Local Administrator can specify who may access this planning tool, at any location under his/her control. One use of this is to \"turn off\" access to end-users (\"Local Users\") while customization is being done to the application</p>"); vp.add(usingThisControlLabel); // --- test mode vp.add(testModePanel); testModePanel.add(new HTML("<hr style='margin-top:10px;'/>")); testModePanel.add(new HTML("<h3>Testing mode:</h3>")); testModePanel.add(testModeCheckBox); testModeCheckBox.setHTML( "<span class=\"gwt-HTML-location\"> Check here to place the system in Testing Mode. Testing Mode temporarily disables the automated email messages that are generated when you add a person's name onto the Add/Remove User screen, or when you approve/deny a password request on the Moderator's Approval screen. Do this when testing, troubleshooting, setting up plans, etc. to avoid sending unwanted emails. Uncheck to turn back on.</span>"); FlexTable testModeTable = new FlexTable(); testModeTable.setWidth("700px"); testModeTable.getFlexCellFormatter().setColSpan(0, 0, 2); testModeTable.setHTML(0, 0, "<span class=\"gwt-HTML-location\"> </span>"); testModeTable.getFlexCellFormatter().setColSpan(1, 0, 2); testModeTable.setHTML(1, 0, "<span class=\"gwt-HTML-location\">Please note:</span>"); testModeTable.setHTML(2, 0, "<span class=\"gwt-HTML-location\">(1) </span>"); testModeTable.setHTML(2, 1, "<span class=\"gwt-HTML-location\">Testing Mode disables only the emails that would be generated by YOU. Testing Mode has no impact on other users: they will continue to experience normal system behavior.</span>"); testModeTable.setHTML(3, 0, "<span class=\"gwt-HTML-location\">(2) </span>"); testModeTable.setHTML(3, 1, "<span class=\"gwt-HTML-location\">Testing Mode disables only those emails generated by the Add/Remove User screen and by the Moderator's Approval screen. Emails generated by the login screens (to create a new account, or replace a forgotten password) will continue to be generated as normal.</span>"); testModeTable.setHTML(4, 0, "<span class=\"gwt-HTML-location\">(3) </span>"); testModeTable.setHTML(4, 1, "<span class=\"gwt-HTML-location\">Emails are never generated by the Manage User Accounts screen, so that screen is not of concern.</span>"); testModePanel.add(testModeTable); // -- email VerticalPanel emailVPanel = new VerticalPanel(); vp.add(emailVPanel); emailVPanel.add(new HTML("<hr style='margin-top:10px;'/>")); emailVPanel.add(new HTML("<h3>Return Address for System-Generated Emails:</h3>")); emailVPanel.add(new HTML( "<p class=\"StandardWidth\">Under certain circumstances, this tool will generate & send emails to users (details are given in the Administrator's Manual).</p>" + "<p class=\"StandardWidth\">Please choose here the <span style='font-weight:bold;'>return address</span> that will be displayed on these emails.</p>" + "<ul class=\"bulletlist\">" + "<li>You might use the email address of one of your Local Administrators</li>" + "<li>You might use the address of a departmental email account, if you have one; or</li>" + "<li>You might create a special email account for this purpose.</li>" + "</ul><p>" + "<p class=\"StandardWidth\">Keep in mind that recipients are often reluctant to open emails that have odd-looking return addresses.</p>" + "<p class=\"StandardWidth\">You may change this return address at any time in future by simply entering a new address here.</p>")); emailVPanel.add(emailPanel); emailPanel.setWidth("700px"); HTML emailLabel = new HTML( "<span style='font-weight:bold;'>Return address for system-generated emails:</span>"); emailTextBox.setStyleName("SettingDomainTextBox"); emailTextBox.setWidth("300px"); emailPanel.add(emailLabel); emailPanel.add(emailTextBox); // -- screen options vp.add(new HTML("<hr style='margin-top:10px;'/>")); vp.add(screenOptionsHTML); vp.add(showTeamsCheckBox); showTeamsCheckBox.setText("Show Teams"); showTeamsCheckBox.addStyleName("optional-screen-list"); vp.add(showSkillsCheckBox); showSkillsCheckBox.setText("Show Skills"); showSkillsCheckBox.addStyleName("optional-screen-list"); vp.add(showStaffingBox); showStaffingBox.setText("Show Staffing Requirements"); showStaffingBox.addStyleName("optional-screen-list"); vp.add(showExamplesOfCheckBox); showExamplesOfCheckBox.setWidth("240px"); showExamplesOfCheckBox.setText("Show Examples of Critical Functions"); showExamplesOfCheckBox.addStyleName("optional-screen-list"); vp.add(replaceStep4); replaceStep4.setSize("455px", "22px"); replaceStep4.setText("Replace Step 4: Instruction with Step 4: Faculty Preparedness"); replaceStep4.addStyleName("optional-screen-list"); final HTML theseSettingsControlLabel = new HTML( "<p class=\"StandardWidth\">These settings control the display or non-display of certain screens. When checked, the screen in question will appear for ALL users at a location. When un-checked, the screen will be hidden from ALL users at that location.</p>" + "<p class=\"StandardWidth\">These settings apply to one location (campus) only. In a multi-campus institution, the settings would have to be done separately for each campus - they cannot be done for the whole institution.</p>" + "<p class=\"StandardWidth\">These settings do not affect the data in the database. Hence when you switch a screen off, any data displayed on that screen remains in the database and will re-appear if you switch the screen on again at some future time.</p>"); vp.add(theseSettingsControlLabel); theseSettingsControlLabel.setSize("709px", "107px"); // --- select other optional features vp.add(otherPanel); otherPanel.add(new HTML("<hr style='margin-top:10px;'/>")); otherPanel.add(new HTML("<h3>Select Other Optional Features:</h3>")); otherPanel.add(showCriticalLevelCheckBox); showCriticalLevelCheckBox.setHTML( " <span style='font-weight:bold;'>Detail Screens:</span> In Step 2 Critical Functions, display the detail screens for ALL functions, " + "regardless of criticality level. If unchecked, the detail screens will be displayed for functions whose criticality level is one of " + "the top three levels, but will NOT be displayed for functions assigned the fourth (lowest) level of criticality."); // --- select the rule for issuing passwords vp.add(modPanel); modPanel.setVisible(false); modPanel.add(new HTML("<hr style='margin-top:10px;'/>")); modPanel.add(new HTML("<h3>Select the Rule for Issuing Passwords:</h3>")); modPanel.add(new HTML( "<p class='StandardWidth'>This selection applies only when the location (campus) is configured for Direct Login (i.e., when Ariah Continuity issues passwords to users via email). </p>")); modPanel.add(radioFull); radioFull.setText( "Full Moderation (every password request is submitted to the Moderator for approval before a password is issued)"); radioFull.addStyleName("password-rules-list"); radioFull.setChecked(true); modPanel.add(radioPartial); radioPartial.setText( "Partial Moderation (issue passwords to users from the following email domains, submit other requests to Moderator):"); radioPartial.addStyleName("password-rules-list"); // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); vp.add(csrfToken); rootPanel.add(vp); // rootPanel.setStyleName("delText"); // Buttons backButton.setStyleName("BackButtonClass"); saveSettingsButton.setStyleName("SaveButtonClass"); // SimplePanel rootPanel = new SimplePanel(); itemService = (SimpleServiceAsync) GWT.create(SimpleService.class); backButton.setStyleName("BackButtonClass"); backButton.setText("Back"); backButton.addClickListener(new ClickListener() { public void onClick(final Widget sender) { showErr(false); redirect("/continuity/admin/adminHome"); } }); saveSettingsButton.setStyleName("SaveButtonClass"); saveSettingsButton.setText("Save Settings"); saveSettingsButton.addClickListener(new ClickListener() { public void onClick(final Widget sender) { showErr(false); invalidEmailHTML.setVisible(false); String retEmailAddr = emailTextBox.getText(); if (retEmailAddr != null && retEmailAddr.trim().length() != 0 && !retEmailAddr.matches("^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$")) { invalidEmailHTML.setVisible(true); return; } domainList = new ArrayList(); for (Iterator i = tableRoot.iterator(); i.hasNext();) { HorizontalPanel hp = (HorizontalPanel) i.next(); Label dl = (Label) hp.getWidget(0); // Window.alert("Adding "+(String) dl.getText() ); domainList.add((String) dl.getText()); } boolean ok = true; // if (domainList.size() > 0 && radioFull.isChecked()) { // // radioPartial.setChecked(false); // radioFull.setChecked(true); // ok = true; // } if (domainList.size() == 0 && radioPartial.isChecked()) { ok = false; boolean uncheck = Window.confirm( "You have selected partial moderation with no email domains. Do you wish to use full moderation instead?"); if (!uncheck) { Window.alert( "Please enter email domains for partial moderation, or select full moderation."); } else { radioPartial.setChecked(false); radioFull.setChecked(true); ok = true; } } if (ok) ok = Window.confirm("Update System Parameters: " + "are you sure?"); if (ok) { SettingItem item = new SettingItem(); item.setAccess(new Integer(accessListBox.getValue(accessListBox.getSelectedIndex()))); Boolean[] opts = { false, false, false, false, false, false }; opts[SettingItem.optionType.Teams.ordinal()] = showTeamsCheckBox.isChecked(); opts[SettingItem.optionType.Skills.ordinal()] = showSkillsCheckBox.isChecked(); opts[SettingItem.optionType.Staffing.ordinal()] = showStaffingBox.isChecked(); opts[SettingItem.optionType.Functions.ordinal()] = showExamplesOfCheckBox.isChecked(); opts[SettingItem.optionType.Replace.ordinal()] = !replaceStep4.isChecked(); opts[SettingItem.optionType.CriticalityLevel.ordinal()] = showCriticalLevelCheckBox.isChecked(); item.setOptions(opts); // ArrayList<String> domainList = new ArrayList(); // admin email disabled item.setInTestMode(testModeCheckBox.isChecked()); if (radioFull.isChecked()) { item.setFullModeration("1"); } else if (radioPartial.isChecked()) { item.setFullModeration("2"); } item.setSystemName(systemNameTextBox.getText()); item.setEmail(emailTextBox.getText()); item.setCsrfToken(csrfToken.getValue()); String str[] = new String[domainList.size()]; domainList.toArray(str); item.setDomainList(str); String[] str2 = item.getDomainList(); // String slist=""; // for (String s: str) { // slist+=s+" "; // } // Window.alert("Saving: "+slist); itemService.updateItem("setting", item, updateItemCallback); } } }); final HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.add(backButton); buttonPanel.add(saveSettingsButton); final HorizontalPanel domainPanel = new HorizontalPanel(); modPanel.add(domainPanel); // vp.add(domainPanel); final Label allowThisDomainLabel = new Label("Allow this domain (e.g. tufts.edu, tuftsfund.org):"); domainPanel.add(allowThisDomainLabel); allowThisDomainLabel.setWidth("284px"); allowThisDomainLabel.addStyleName("SettingAllowThisDomainLabel"); domainPanel.add(domainTextBox); domainTextBox.setSize("255px", "20px"); domainTextBox.setStyleName("SettingDomainTextBox"); final Button addButton = new Button(); domainPanel.add(addButton); addButton.setSize("103px", "22px"); addButton.addClickListener(new ClickListener() { public void onClick(final Widget sender) { // Label listItem = new Label(); // listItem.setText(domainTextBox.getText()); // domainList.add(listItem); addDomain(); } }); addButton.setStyleName("ButtonClass"); addButton.setText("Add to List"); // Setup test code: delete final Label domain1 = new Label("l1"); // rootPanel.add(domain1, 345, 460); domain1.setSize("255px", "15px"); final Label del1 = new Label("delete"); // rootPanel.add(del1, 620, 460); //del1.setStylePrimaryName("gwt-Labeld"); del1.setStyleName("SettingDomainDeleteLink"); del1.setSize("47px", "15px"); formLoad(); tableRoot = new VerticalPanel(); tableRoot.addStyleName("domain_list"); //tableRoot.addStyleName("partial-moderation-margin"); HTML allowedDomainLab = new HTML("<p><strong>Allowed Domains:</strong></p>"); allowedDomainLab.addStyleName("SettingAllowDomainLabel"); modPanel.add(allowedDomainLab); modPanel.add(tableRoot); tableRoot.setWidth("300px"); vp.add(new HTML("<hr style='margin-top:10px;'/>")); vp.add(new HTML("<h3>Create a Name for this Planning Tool:</h3>")); vp.add(new HTML( "<p class='StandardWidth'>Please enter here a name for your local version of the Ariah Continuity tool. This name will appear in the system-generated emails that notify users about new accounts, passwords, etc. Some possible examples: Indiana Ready, UBC Ready, Penn State Continuity Planner. For consistency, please use the same name as will appear in your custom graphics at the top of every page.</p>")); systemNameTextBox.setSize("644px", "20px"); systemNameTextBox.setMaxLength(1000); systemNameTextBox.setStyleName("SettingDomainTextBox"); vp.add(systemNameTextBox); vp.add(new HTML("<hr style='margin-top:10px;'/>")); invalidEmailHTML.setVisible(false); vp.add(invalidEmailHTML); vp.add(buttonPanel); }