List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setSpacing
public void setSpacing(int spacing)
From source file:org.freemedsoftware.gwt.client.widget.MessageBox.java
License:Open Source License
public MessageBox() { VerticalPanel superVPanel = new VerticalPanel(); initWidget(superVPanel);//ww w.ja va 2s . c om superVPanel.setStyleName(AppConstants.STYLE_BUTTON_WIDGETS_CONTAINER); superVPanel.setWidth("100%"); HorizontalPanel headerHPanel = new HorizontalPanel(); headerHPanel.setSpacing(5); superVPanel.add(headerHPanel); final Image colExpBtn = new Image(Util.getResourcesURL() + "collapse.15x15.png"); colExpBtn.getElement().getStyle().setCursor(Cursor.POINTER); headerHPanel.add(colExpBtn); colExpBtn.addClickHandler(new ClickHandler() { boolean expaned = false; @Override public void onClick(ClickEvent arg0) { if (expaned) { colExpBtn.setUrl(Util.getResourcesURL() + "collapse.15x15.png"); contentVPanel.setVisible(true); } else { colExpBtn.setUrl(Util.getResourcesURL() + "expand.15x15.png"); contentVPanel.setVisible(false); } expaned = !expaned; } }); Label headerLabel = new Label(_("MESSAGES")); headerHPanel.add(headerLabel); headerLabel.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); contentVPanel = new VerticalPanel(); contentVPanel.setWidth("100%"); superVPanel.add(contentVPanel); // sPanel.addStyleName("freemed-MessageBoxContainer"); contentVPanel.add(wMessages); wMessages.setSize("100%", "100%"); wMessages.addColumn(_("Received"), "stamp"); // col 0 wMessages.addColumn(_("From"), "from_user"); // col 1 wMessages.addColumn(_("Subject"), "subject"); // col 2 wMessages.setIndexName("id"); wMessages.setMaximumRows(7); if (true) { wMessages.setTableRowClickHandler(new TableRowClickHandler() { @Override public void handleRowClick(HashMap<String, String> data, int col) { // Get information on row... try { final Integer messageId = Integer.parseInt(data.get("id")); if ((col == 0) || (col == 2)) { MessageView messageView = new MessageView(); showMessage(messageId, messageView); messageView.setMsgFrom(data.get("from_user")); messageView.setMsgDate(data.get("stamp")); popupMessageView = new Popup(); popupMessageView.setNewWidget(messageView); messageView.setOnClose(new Command() { public void execute() { popupMessageView.hide(); } }); popupMessageView.initialize(); } } catch (Exception e) { GWT.log("Caught exception: ", e); } } }); } // Standard is collapsed view of the Messagebox // wMessages.setVisible(false); // Click listener for both: the button and the label // showMessagesButton.addClickHandler(new ClickHandler() { // @Override // public void onClick(ClickEvent evt) { // if (wMessages.isVisible() == false) // wMessages.setVisible(true); // else // wMessages.setVisible(false); // } // }); // messageCountLabel.addClickHandler(new ClickHandler() { // @Override // public void onClick(ClickEvent evt) { // if (wMessages.isVisible() == false) // wMessages.setVisible(true); // else // wMessages.setVisible(false); // } // }); // horizontalPanel.add(messageCountLabel); // Load the Data; we have no searchtag - we search for everything // retrieveData(""); }
From source file:org.freemedsoftware.gwt.client.widget.PatientInfoBar.java
License:Open Source License
public PatientInfoBar() { final RoundedPanel container = new RoundedPanel(); initWidget(container);// w w w .j a v a2 s.c o m container.setCornerColor("#ccccff"); container.setStylePrimaryName("freemed-PatientInfoBar"); container.setWidth("100%"); final HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setWidth("100%"); container.add(horizontalPanel); wPatientName = new Label(""); wPatientVisibleInfo = new HTML(); HorizontalPanel horizontalsubPanel = new HorizontalPanel(); horizontalsubPanel.setSpacing(2); horizontalPanel.add(horizontalsubPanel); horizontalPanel.setCellWidth(horizontalsubPanel, "70%"); // horizontalsubPanel .add(wPatientName); horizontalsubPanel.add(wPatientVisibleInfo); allergyImg = new Image("resources/images/allergy.16x16.png"); allergyImg.setVisible(false); horizontalsubPanel.add(allergyImg); if (CurrentState.isActionAllowed(PatientScreen.moduleName, AppConstants.MODIFY)) { editLink = new HTML("(<a href=\"javascript:undefined;\" style='color:blue'>" + _("Edit") + "</a>)"); editLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Util.closeTab(parentScreen); PatientForm patientForm = new PatientForm(); Util.spawnTab(wPatientName.getText(), patientForm); patientForm.setPatientId(getPatientId()); } }); horizontalsubPanel.add(editLink); } if (CurrentState.isActionAllowed(PatientScreen.moduleName, AppConstants.READ)) { viewLink = new HTML("(<a href=\"javascript:undefined;\" style='color:blue'>" + _("View") + "</a>)"); viewLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { showPatientDetails(); } }); horizontalsubPanel.add(viewLink); } wDropdown = new DisclosurePanel(""); final HorizontalPanel wDropdownContainer = new HorizontalPanel(); final VerticalPanel patientInfoContainer = new VerticalPanel(); // wDropdown.add(wDropdownContainer); wPatientHiddenInfo = new HTML(); patientInfoContainer.add(wPatientHiddenInfo); wDropdownContainer.add(patientInfoContainer); final VerticalPanel clinicalPhotoIdPanel = new VerticalPanel(); photoId = new Image(); photoId.setWidth("70px"); photoId.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final Popup p = new Popup(); MugshotWebcamWidget m = new MugshotWebcamWidget(getPatientId()); p.setWidget(m); p.center(); m.setOnFinishedCommand(new Command() { @Override public void execute() { p.hide(); } }); } }); clinicalPhotoIdPanel.add(photoId); wDropdownContainer.add(clinicalPhotoIdPanel); wDropdown.add(wDropdownContainer); // adding DisclosurePanel panel into a horizontal panel horizontalPanel.add(wDropdown); horizontalPanel.setCellHorizontalAlignment(wDropdown, HasHorizontalAlignment.ALIGN_CENTER); final HorizontalPanel iconBar = new HorizontalPanel(); final Image wBookAppointment = new Image("resources/images/book_appt.32x32.png"); wBookAppointment.addClickHandler(new ClickHandler() { public void onClick(ClickEvent w) { } }); iconBar.add(wBookAppointment); horizontalPanel.add(iconBar); horizontalPanel.setCellHorizontalAlignment(iconBar, HasHorizontalAlignment.ALIGN_RIGHT); if (patientId > 0) { loadData(); } }
From source file:org.freemedsoftware.gwt.client.widget.PatientInfoBar.java
License:Open Source License
public void showPatientDetails() { Util.callApiMethod("PatientInterface", "PatientEMRViewWithIntake", patientId, new CustomRequestCallback() { @Override// w w w . jav a2s . c o m public void onError() { // TODO Auto-generated method stub } @SuppressWarnings("unchecked") @Override public void jsonifiedData(Object svrData) { if (svrData != null) { HashMap<String, HashMap<String, String>[]> data = (HashMap<String, HashMap<String, String>[]>) svrData; //Extracting Coverage Data HashMap<String, String>[] CoverageInfo = null; if (data.get("ptcoverages") != null) { CoverageInfo = data.get("ptcoverages"); data.remove("ptcoverages"); } //Extracting Authorization Data HashMap<String, String>[] authInfo = null; if (data.get("ptauth") != null) { authInfo = data.get("ptauth"); data.remove("ptauth"); } HorizontalPanel infoPane = new HorizontalPanel(); //Loading personal Info infoPane.add(loadPersonalInfo(data.get("ptinfo")[0])); VerticalPanel insuranceDetailsVPanel = new VerticalPanel(); infoPane.add(insuranceDetailsVPanel); //Loading Coverages Info if (CoverageInfo != null) insuranceDetailsVPanel.add(loadCoverageInfo(CoverageInfo)); //Loading Authorizations Info if (authInfo != null) insuranceDetailsVPanel.add(loadAuthInfo(authInfo)); infoPane.setSpacing(3); Popup popup = new Popup(); PopupView popupView = new PopupView(infoPane); popup.setNewWidget(popupView); popup.initialize(); popup.show(); } } }, "HashMap<String,HashMap<String,String>[]>"); }
From source file:org.freemedsoftware.gwt.client.widget.PostCheckWidget.java
License:Open Source License
public PostCheckWidget(HashSet<String> p, CustomRequestCallback cb) { callback = cb;/*from w ww . j av a 2s. c o m*/ procs = p; vPanel = new VerticalPanel(); vPanel.setSpacing(10); initWidget(vPanel); postCheckInfoFlexTable = new FlexTable(); // postCheckInfoFlexTable.setWidth("100%"); // Label payerLb = new Label("Payer"); // payerWidget = new CustomModuleWidget( // "api.ClaimLog.RebillDistinctPayers"); Label checkNumberLb = new Label(_("Check Number")); tbCheckNo = new TextBox(); Label totalAmountLb = new Label(_("Total Amount")); tbTotalAmount = new TextBox(); // postCheckInfoFlexTable.setWidget(0, 0, payerLb); // postCheckInfoFlexTable.setWidget(0, 1, payerWidget); postCheckInfoFlexTable.setWidget(1, 0, checkNumberLb); postCheckInfoFlexTable.setWidget(1, 1, tbCheckNo); postCheckInfoFlexTable.setWidget(2, 0, totalAmountLb); postCheckInfoFlexTable.setWidget(2, 1, tbTotalAmount); proceduresInfoTable = new CustomTable(); proceduresInfoTable.setAllowSelection(false); proceduresInfoTable.setSize("100%", "100%"); proceduresInfoTable.setIndexName("id"); proceduresInfoTable.addColumn(_("Patient"), "pt_name"); proceduresInfoTable.addColumn(_("Claim"), "clm"); proceduresInfoTable.addColumn(_("CPT"), "cpt"); proceduresInfoTable.addColumn(_("Service Date"), "ser_date"); proceduresInfoTable.addColumn(_("Paid"), "paid"); proceduresInfoTable.addColumn(_("Amount Billed"), "amnt_bill"); proceduresInfoTable.addColumn(_("Amount Allowed"), "balance"); proceduresInfoTable.addColumn(_("Adustment Balance"), "adj_bal"); proceduresInfoTable.addColumn(_("Payment"), "pay"); proceduresInfoTable.addColumn(_("Copay"), "copay"); proceduresInfoTable.addColumn(_("Left Over"), "left"); proceduresInfoTable.setTableWidgetColumnSetInterface(new TableWidgetColumnSetInterface() { @SuppressWarnings("unchecked") @Override public Widget setColumn(String columnName, final HashMap<String, String> data) { final int actionRow = proceduresInfoTable.getActionRow(); if (columnName.compareTo("balance") == 0) { int row = proceduresInfoTable.getActionRow(); proceduresInfoTable.getFlexTable().getFlexCellFormatter().setWidth(row, 6, "10%"); pids.add(data.get("id")); final TextBox tbAllowedAmount = new TextBox(); tbAllowedAmount.setWidth("100%"); tbAllowedAmount.setText(data.get("balance")); tbAllowedAmount.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { float all_amnt = 0; float pay = 0; float copay = 0; if (!(tbAllowedAmount.getText().equals("0") || tbAllowedAmount.getText().equals(""))) { all_amnt = Float.parseFloat(tbAllowedAmount.getText().trim()); } TextBox tb1 = (TextBox) proceduresInfoTable.getWidget(8); TextBox tb2 = (TextBox) proceduresInfoTable.getWidget(9); if (!(tb1.getText().equals("0") || tb1.getText().equals(""))) { pay = Float.parseFloat(tb1.getText().trim()); } if (!(tb2.getText().equals("0") || tb2.getText().equals(""))) { copay = Float.parseFloat(tb2.getText().trim()); } Label left = (Label) proceduresInfoTable.getWidget(10); left.setText("" + (all_amnt - pay - copay)); } }); return tbAllowedAmount; } else if (columnName.compareTo("pay") == 0) { int row = proceduresInfoTable.getActionRow(); proceduresInfoTable.getFlexTable().getFlexCellFormatter().setWidth(row, 8, "10%"); final TextBox tbPayment = new TextBox(); tbPayment.setWidth("100%"); tbPayment.setText("0"); tbPayment.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { float all_amnt = 0; float pay = 0; float copay = 0; if (!(tbPayment.getText().equals("0") || tbPayment.getText().equals(""))) { pay = Float.parseFloat(tbPayment.getText().trim()); } TextBox tb1 = (TextBox) proceduresInfoTable.getWidget(6); TextBox tb2 = (TextBox) proceduresInfoTable.getWidget(9); if (!(tb1.getText().equals("0") || tb1.getText().equals(""))) { all_amnt = Float.parseFloat(tb1.getText().trim()); } if (!(tb2.getText().equals("0") || tb2.getText().equals(""))) { copay = Float.parseFloat(tb2.getText().trim()); } Label left = (Label) proceduresInfoTable.getWidget(10); left.setText("" + (all_amnt - pay - copay)); } }); return tbPayment; } else if (columnName.compareTo("copay") == 0) { int row = proceduresInfoTable.getActionRow(); proceduresInfoTable.getFlexTable().getFlexCellFormatter().setWidth(row, 9, "10%"); final TextBox tbCopay = new TextBox(); tbCopay.setWidth("100%"); tbCopay.setText("0"); @SuppressWarnings("rawtypes") ArrayList params = new ArrayList(); tbCopay.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { float all_amnt = 0; float pay = 0; float copay = 0; if (!(tbCopay.getText().equals("0") || tbCopay.getText().equals(""))) { copay = Float.parseFloat(tbCopay.getText().trim()); } TextBox tb1 = (TextBox) proceduresInfoTable.getWidget(6); TextBox tb2 = (TextBox) proceduresInfoTable.getWidget(8); if (!(tb1.getText().equals("0") || tb1.getText().equals(""))) { all_amnt = Float.parseFloat(tb1.getText().trim()); } if (!(tb2.getText().equals("0") || tb2.getText().equals(""))) { pay = Float.parseFloat(tb2.getText().trim()); } Label left = (Label) proceduresInfoTable.getWidget(10); left.setText("" + (all_amnt - pay - copay)); } }); params.add(data.get("pt_id")); params.add(data.get("id")); Util.callApiMethod("Ledger", "getCoveragesCopayInfo", params, new CustomRequestCallback() { @Override public void onError() { } @Override public void jsonifiedData(Object d) { if (data != null) { HashMap<String, String> result = (HashMap<String, String>) d; // tbAmount.setEnabled(false); if (result != null) { tbCopay.setText(result.get("copay")); try { Label lbLeft = new Label(); float left = 0; float copay = Float.parseFloat(result.get("copay")); left = Float.parseFloat(data.get("left")); lbLeft.setText("" + (left - copay)); proceduresInfoTable.getFlexTable().setWidget(actionRow, 10, lbLeft); } catch (Exception e) { Window.alert("aaaa"); } // tbAmount.setEnabled(false); } } } }, "HashMap<String,String>"); return tbCopay; } else if (columnName.compareTo("left") == 0) { int row = proceduresInfoTable.getActionRow(); proceduresInfoTable.getFlexTable().getFlexCellFormatter().setWidth(row, 10, "10%"); try { Label lb = (Label) proceduresInfoTable.getWidget(10); return lb; } catch (Exception e) { return new Label(); } } else if (columnName.compareTo("adj_bal") == 0) { int row = proceduresInfoTable.getActionRow(); proceduresInfoTable.getFlexTable().getFlexCellFormatter().setWidth(row, 7, "10%"); Label adjbal = new Label(); adjbal.setText(data.get("adj_bal")); return adjbal; } else if (columnName.compareTo("amnt_bill") == 0) { int row = proceduresInfoTable.getActionRow(); proceduresInfoTable.getFlexTable().getFlexCellFormatter().setWidth(row, 5, "10%"); Label amntbill = new Label(); amntbill.setText(data.get("amnt_bill")); return amntbill; } else { return (Widget) null; } } }); HorizontalPanel actionPanel = new HorizontalPanel(); actionPanel.setSpacing(5); // actionPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); CustomButton postBtn = new CustomButton(_("Post"), AppConstants.ICON_ADD); postBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { prepareDataForPostCheck(); } }); CustomButton cancelBtn = new CustomButton(_("Cancel"), AppConstants.ICON_CANCEL); final PostCheckWidget pcw = this; cancelBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { pcw.removeFromParent(); callback.jsonifiedData("cancel"); } }); actionPanel.add(postBtn); actionPanel.add(cancelBtn); vPanel.add(postCheckInfoFlexTable); vPanel.add(proceduresInfoTable); vPanel.add(actionPanel); vPanel.setCellHorizontalAlignment(actionPanel, HasHorizontalAlignment.ALIGN_RIGHT); pids = new ArrayList<String>(); loadSelectedProcedureInfo(); }
From source file:org.freemedsoftware.gwt.client.widget.PrescriptionRefillBox.java
License:Open Source License
public PrescriptionRefillBox() { super(moduleName); VerticalPanel superVPanel = new VerticalPanel(); initWidget(superVPanel);//from w w w.ja v a 2s.com superVPanel.setStyleName(AppConstants.STYLE_BUTTON_WIDGETS_CONTAINER); superVPanel.setWidth("100%"); HorizontalPanel headerHPanel = new HorizontalPanel(); headerHPanel.setSpacing(5); superVPanel.add(headerHPanel); final Image colExpBtn = new Image(Util.getResourcesURL() + "collapse.15x15.png"); colExpBtn.getElement().getStyle().setCursor(Cursor.POINTER); headerHPanel.add(colExpBtn); colExpBtn.addClickHandler(new ClickHandler() { boolean expaned = false; @Override public void onClick(ClickEvent arg0) { if (expaned) { colExpBtn.setUrl(Util.getResourcesURL() + "collapse.15x15.png"); contentVPanel.setVisible(true); } else { colExpBtn.setUrl(Util.getResourcesURL() + "expand.15x15.png"); contentVPanel.setVisible(false); } expaned = !expaned; } }); Label headerLabel = new Label("RX REFILLS"); headerHPanel.add(headerLabel); headerLabel.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); contentVPanel = new VerticalPanel(); contentVPanel.setWidth("100%"); superVPanel.add(contentVPanel); contentVPanel.add(flexTable); flexTable.setSize("100%", "100%"); cleanView(); }
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();/*from www . j a v a2 s . 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.freemedsoftware.gwt.client.widget.SchedulerWidget.java
License:Open Source License
public SchedulerWidget() { super(moduleName); ////////////Applying stored configurations//////////////// int startHour = 10; int endHour = 18; int intervalsPerHour = 4; show24HourClock = false;//from ww w .j av a 2 s. c o m int intervalHeight = 50; if (Util.getProgramMode() == ProgramMode.JSONRPC) { startHour = CurrentState.getSystemConfig("calshr") != null ? Integer.parseInt(CurrentState.getSystemConfig("calshr")) : startHour; endHour = CurrentState.getSystemConfig("calehr") != null ? Integer.parseInt(CurrentState.getSystemConfig("calehr")) : endHour; intervalsPerHour = CurrentState.getSystemConfig("calinterval") != null ? (60 / Integer.parseInt(CurrentState.getSystemConfig("calinterval"))) : intervalsPerHour; intervalHeight = CurrentState.getSystemConfig("calintervalheight") != null ? Integer.parseInt(CurrentState.getSystemConfig("calintervalheight")) : intervalHeight; show24HourClock = CurrentState.getSystemConfig("calshow24hourclock") != null ? (Integer.parseInt(CurrentState.getSystemConfig("calshow24hourclock")) == 1) : show24HourClock; } StringPanelRenderer panelRenderer = new StringPanelRenderer(); panelRenderer.setStartHour(startHour); panelRenderer.setEndHour(endHour); panelRenderer.setIntervalsPerHour(intervalsPerHour); panelRenderer.setShow24HourClock(show24HourClock); panelRenderer.setIntervalHeight(intervalHeight); ////////////End configurations//////////////// filterModulesAndMethods.put("ProviderModule", "GetDailyAppointmentsRange"); filterModulesAndMethods.put("ProviderGroups", "GetDailyAppointmentsRangeByProviderGroup"); SELECTED_MODULE = "ProviderModule"; eventCacheController = new EventCacheController(); multiPanel = new MultiView(eventCacheController, panelRenderer); panel.setWidth("100%"); final HorizontalPanel loadingContainer = new HorizontalPanel(); loadingContainer.add(new Image("resources/images/loading.gif")); loadingContainer.add(new HTML("<h3>" + "Loading" + "</h3>")); loadingDialog.setStylePrimaryName(SchedulerCss.EVENT_DIALOG); loadingDialog.setWidget(loadingContainer); loadingDialog.hide(); final VerticalPanel headerArea = new VerticalPanel(); headerArea.setWidth("100%"); final HorizontalPanel fields = new HorizontalPanel(); fields.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); fields.setWidth("100%"); headerArea.add(fields); panel.add(headerArea, DockPanel.NORTH); /* * fields.add(label); fields.setCellHeight(label, "50%"); */ final HorizontalPanel filterPanel = new HorizontalPanel(); fields.add(filterPanel); // fields.setCellWidth(filterPanel, "50%"); Label selectFilterLabel = new Label(_("Filter by") + " :"); selectFilterLabel.setStyleName(AppConstants.STYLE_LABEL_LARGE_BOLD); filterPanel.add(selectFilterLabel); final CustomListBox selectFilter = new CustomListBox(); selectFilter.addItem(_("Provider"), "ProviderModule"); selectFilter.addItem(_("Provider Groups"), "ProviderGroups"); selectFilter.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { SELECTED_MODULE = selectFilter.getStoredValue(); filterModule.setModuleName(SELECTED_MODULE); filterModule.setValue(0); } }); filterPanel.add(selectFilter); filterModule.setModuleName("ProviderModule"); filterModule.setWidth("300px"); filterModule.addValueChangeHandler(new ValueChangeHandler<Integer>() { @Override public void onValueChange(ValueChangeEvent<Integer> event) { Integer val = ((SupportModuleWidget) event.getSource()).getValue(); // Log.debug("Patient value = " + val.toString()); try { if (val.compareTo(new Integer(0)) != 0) { multiPanel.clearData(); eventCacheController.getEventsForRange(multiPanel.getCurrent().getFirstDateLogical(), multiPanel.getCurrent().getLastDateLogical(), val, filterModulesAndMethods.get(SELECTED_MODULE), multiPanel, true); } } catch (Exception e) { // Don't do anything if no patient is declared GWT.log("Caught exception", e); } } }); filterPanel.add(filterModule); CustomButton clearButton = new CustomButton(_("Clear"), AppConstants.ICON_CLEAR); clearButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { filterModule.setValue(0); eventCacheController.getEventsForRange(multiPanel.getCurrent().getFirstDateLogical(), multiPanel.getCurrent().getLastDateLogical(), multiPanel, true); } }); filterPanel.add(clearButton); final HorizontalPanel fields2Panel = new HorizontalPanel(); fields2Panel.setSpacing(5); CustomButton showPicker = new CustomButton(_("Jump")); fields2Panel.add(showPicker); if (CurrentState.isActionAllowed(blockSlotsModuleName, AppConstants.SHOW)) { CustomButton showBlockSlots = new CustomButton(_("Block Slots")); showBlockSlots.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { BlockTimeSlotPopup blockTimeSlotPopup = new BlockTimeSlotPopup(); blockTimeSlotPopup.show(); blockTimeSlotPopup.center(); } }); fields2Panel.add(showBlockSlots); } headerArea.add(fields2Panel); final VerticalPanel posPanel = new VerticalPanel(); posPanel.setVisible(false); posPanel.setWidth("100%"); HorizontalPanel pickerHolder = new HorizontalPanel(); pickerHolder.add(posPanel); pickerHolder.add(multiPanel); showPicker.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { posPanel.setVisible(!posPanel.isVisible()); if (posPanel.isVisible()) multiPanel.setPixelSize((Window.getClientWidth() * 78) / 100, (Window.getClientHeight() * 70) / 100); else multiPanel.setPixelSize((Window.getClientWidth() * 87) / 100, (Window.getClientHeight() * 70) / 100); } }); HTML space = new HTML(""); posPanel.add(space); space.setHeight("40px"); posPanel.add(navigator); // navigator.setVisible(false); // pickerHolder.setCellWidth(posPanel, "200px"); pickerHolder.setVerticalAlignment(VerticalPanel.ALIGN_TOP); pickerHolder.setCellWidth(multiPanel, "100%"); multiPanel.setWidth("100%"); multiPanel.setPixelSize((Window.getClientWidth() * 87) / 100, (Window.getClientHeight() * 300) / 100); // posPanel.setWidth("200px"); panel.add(pickerHolder, DockPanel.CENTER); pickerHolder.setWidth("100%"); onWindowResized(-1, Window.getClientHeight()); panel.setStyleName("whiteForDemo"); multiPanel.addDateListener(this); navigator.addDateListener(this); Window.addResizeHandler(this); multiPanel.scrollToHour(7); initWidget(panel); }
From source file:org.freemedsoftware.gwt.client.widget.WorkList.java
License:Open Source License
public WorkList() { super(moduleName); VerticalPanel superVPanel = new VerticalPanel(); superVPanel.setStyleName(AppConstants.STYLE_BUTTON_WIDGETS_CONTAINER); superVPanel.setWidth("100%"); initWidget(superVPanel);/*from www . j a v a2 s . co m*/ HorizontalPanel headerHPanel = new HorizontalPanel(); headerHPanel.setSpacing(5); superVPanel.add(headerHPanel); final Image colExpBtn = new Image(Util.getResourcesURL() + "collapse.15x15.png"); colExpBtn.getElement().getStyle().setCursor(Cursor.POINTER); headerHPanel.add(colExpBtn); colExpBtn.addClickHandler(new ClickHandler() { boolean expaned = false; @Override public void onClick(ClickEvent arg0) { if (expaned) { colExpBtn.setUrl(Util.getResourcesURL() + "collapse.15x15.png"); vPanel.setVisible(true); } else { colExpBtn.setUrl(Util.getResourcesURL() + "expand.15x15.png"); vPanel.setVisible(false); } expaned = !expaned; } }); Label headerLabel = new Label(_("WORK LIST")); headerHPanel.add(headerLabel); headerLabel.setStyleName(AppConstants.STYLE_LABEL_NORMAL_BOLD); vPanel = new VerticalPanel(); superVPanel.add(vPanel); vPanel.setWidth("100%"); paneltop = new HorizontalPanel(); // providerLabel = new Label("Refresh to get latest schedules!"); providerLabel = new Label(); // hPaneltop.add(refreshButton); paneltop.add(providerLabel); vPanel.add(paneltop); message = new Label(); message.setStylePrimaryName("freemed-MessageText"); message.setText(_("There are no items scheduled for this day.")); vPanel.add(message); tablesVPanel = new VerticalPanel(); vPanel.add(tablesVPanel); // message.setVisible(false); // retrieveData(); // Register on the event bus CurrentState.getEventBus().addHandler(SystemEvent.TYPE, this); }
From source file:org.gatein.management.gadget.client.Application.java
License:Open Source License
/** * @param text/*from w w w . j a va 2 s .com*/ * @param image * @return */ private String getItemString(String text, ImageResource image) { // Add the image and text to a horizontal panel HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setSpacing(0); hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hPanel.add(new Image(image)); HTML headerText = new HTML(text); hPanel.add(headerText); // Return the HTML string for the panel return hPanel.getElement().getString(); }
From source file:org.geomajas.gwt2.plugin.corewidget.example.client.sample.dialog.CloseableDialogExample.java
License:Open Source License
public CloseableDialogExample() { rootElement = UIBINDER.createAndBindUi(this); button.addMouseDownHandler(new MouseDownHandler() { @Override/*from w ww. j a v a 2s.c o m*/ public void onMouseDown(MouseDownEvent mouseDownEvent) { final CloseableDialogBoxWidget widget = new CloseableDialogBoxWidget(); VerticalPanel panel = new VerticalPanel(); panel.setWidth("100%"); panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); HorizontalPanel top = new HorizontalPanel(); top.setSpacing(10); InlineLabel labelTop = new InlineLabel(msg.closeableDialogBoxExampleLabel()); top.add(labelTop); HorizontalPanel middle = new HorizontalPanel(); middle.setSpacing(10); final Button middleButton = new Button(msg.closeableDialogBoxExampleButton()); middle.add(middleButton); HorizontalPanel bottom = new HorizontalPanel(); bottom.setSpacing(10); final InlineLabel bottomlabel = new InlineLabel(msg.loremIpsum()); bottom.add(bottomlabel); middleButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (clicked < 3) { bottomlabel.setText(bottomlabel.getText() + bottomlabel.getText()); layerEventLayout.add(new Label(msg.closeableDialogBoxExampleButtonMessage())); scrollPanel.scrollToBottom(); clicked++; if (clicked == 3) { middleButton.setText(msg.closeableDialogBoxExampleButtonClear()); } } else { layerEventLayout.add(new Label(msg.closeableDialogBoxExampleButtonClearMessage())); scrollPanel.scrollToBottom(); middleButton.setText(msg.closeableDialogBoxExampleButton()); bottomlabel.setText(msg.loremIpsum()); clicked = 0; } } }); panel.add(top); panel.add(middle); panel.add(bottom); widget.addContent(panel); widget.setGlassEnabled(true); widget.setModal(true); widget.setTitle(msg.closeableDialogTitle()); widget.setSize(380, 150); widget.center(); widget.show(); widget.setOnCloseHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { layerEventLayout.add(new Label(msg.closeableDialogBoxHandlerMessage())); scrollPanel.scrollToBottom(); } }); } }); }