/** * Creates the table layout * * @param viewer */ public void createColumns(final TableViewer viewer) { TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE); column.getColumn().setWidth(300); column .getColumn() .setText(Messages.getString("PatientIdDialog.column_header.type")); // $NON-NLS-1$ column.getColumn().setMoveable(true); column.setLabelProvider( new ColumnLabelProvider() { @Override public String getText(Object element) { PatientIdentifier content = (PatientIdentifier) element; return content.getType().getName(); } }); TableViewerColumn column1 = new TableViewerColumn(viewer, SWT.NONE); column1.getColumn().setWidth(200); column1 .getColumn() .setText(Messages.getString("PatientIdDialog.column_header.number")); // $NON-NLS-1$ column1.getColumn().setMoveable(true); column1.setEditingSupport(new PatientIdentifierEditingSupport(viewer)); column1.setLabelProvider( new ColumnLabelProvider() { @Override public String getText(Object element) { PatientIdentifier content = (PatientIdentifier) element; return content.getValueEdit(); } }); }
private void createGrpMandEReports() { grpMandEReports = new Group(getShell(), SWT.NONE); grpMandEReports.setBounds(new Rectangle(475, 305, 325, 200)); grpMandEReports.setText(Messages.getString("NewReports.section.m_and_e")); // $NON-NLS-1$ grpMandEReports.setFont(ResourceUtils.getFont(iDartFont.VERASANS_12)); lblPicMandEReports = new Label(grpMandEReports, SWT.NONE); lblPicMandEReports.setBounds(new org.eclipse.swt.graphics.Rectangle(10, 0, 50, 43)); lblPicMandEReports.setImage(ResourceUtils.getImage(iDartImage.REPORT_STOCKCONTROLPERCLINIC)); tblMandEReports = new Table(grpMandEReports, SWT.BORDER); tblMandEReports.setBounds(new Rectangle(20, 50, 285, 130)); tblMandEReports.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); TableColumn tblColReportsAvailable = new TableColumn(tblMandEReports, SWT.NONE); tblColReportsAvailable.setWidth(270); tblColReportsAvailable.setText(Messages.getString("NewReports.table.title")); // $NON-NLS-1$ tblMandEReports.addMouseListener( new MouseAdapter() { @Override public void mouseDown(MouseEvent event) { clearSelections(); // Determine where the mouse was clicked Point pt = new Point(event.x, event.y); // Determine which row was selected final TableItem item = tblMandEReports.getItem(pt); if (item != null) { launchReport(item); tblMandEReports.select(tblMandEReports.indexOf(item)); } } }); }
/** This method initializes compOptions */ @Override protected void createCompOptions() { Label lblInfoText = new Label(getShell(), SWT.WRAP); lblInfoText.setBounds(new Rectangle(50, 80, 500, 40)); lblInfoText.setText(Messages.getString("PatientIdDialog.info_text")); // $NON-NLS-1$ tblViewer = new TableViewer(getShell(), SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION); tblViewer.getTable().setBounds(new org.eclipse.swt.graphics.Rectangle(50, 130, 500, 330)); tblViewer.getTable().setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); tblViewer.setContentProvider(new ArrayContentProvider()); tblViewer.getTable().setHeaderVisible(true); tblViewer.getTable().setLinesVisible(true); createColumns(tblViewer); }
/** This method initializes compButtons */ @Override protected void createCompButtons() { Button btnClose = new Button(getCompButtons(), SWT.PUSH); btnClose.setText(Messages.getString("PatientIdDialog.button.done")); // $NON-NLS-1$ btnClose.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { cmdSaveSelected(); } }); btnClose.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); Button btnCancel = new Button(getCompButtons(), SWT.PUSH); btnCancel.setText(Messages.getString("genericformgui.button.cancel.text")); // $NON-NLS-1$ btnCancel.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { cmdCloseSelected(); } }); btnCancel.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); }
/** This method initializes compButtons */ protected void createCompButtons() { compButton = new Composite(getShell(), SWT.NONE); compButton.setBounds(new Rectangle(100, 520, 700, 40)); RowLayout rowLayout = new RowLayout(); rowLayout.wrap = false; rowLayout.pack = false; rowLayout.justify = true; rowLayout.type = SWT.HORIZONTAL; rowLayout.spacing = 0; compButton.setLayout(rowLayout); btnIedeaExport = new Button(compButton, SWT.NONE); btnIedeaExport.setText(Messages.getString("NewReports.button.export.iedea")); // $NON-NLS-1$ btnIedeaExport.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); btnIedeaExport.setLayoutData(new RowData(200, 30)); btnIedeaExport.setToolTipText( Messages.getString("NewReports.button.export.tooltip.iedea")); // $NON-NLS-1$ btnIedeaExport.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { cmdIedeaExportsSelected(); } }); btnDataExport = new Button(compButton, SWT.NONE); btnDataExport.setText(Messages.getString("NewReports.button.export")); // $NON-NLS-1$ btnDataExport.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); btnDataExport.setLayoutData(new RowData(200, 30)); btnDataExport.setToolTipText( Messages.getString("NewReports.button.export.tooltip")); // $NON-NLS-1$ btnDataExport.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { cmdDataExportsSelected(); } }); btnDataQuality = new Button(compButton, SWT.NONE); btnDataQuality.setText(Messages.getString("NewReports.button.dataQuality")); // $NON-NLS-1$ btnDataQuality.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); btnDataQuality.setLayoutData(new RowData(200, 30)); btnDataQuality.setToolTipText( Messages.getString("NewReports.button.dataQuality.tooltip")); // $NON-NLS-1$ btnDataQuality.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { cmdDataQualitySelected(); } }); compButton.layout(); }
private boolean fieldsOk() { boolean allEmpty = true; for (PatientIdentifier newId : identiers) { if (newId.getValueEdit() == null || newId.getValueEdit().isEmpty()) continue; allEmpty = false; String illegalText = iDARTUtil.checkPatientId(newId.getValueEdit()); if (illegalText != null) { showMessage( MessageDialog.ERROR, MessageFormat.format( Messages.getString("patient.error.badCharacterInPatientId.title"), // $NON-NLS-1$ illegalText), MessageFormat.format( Messages.getString("patient.error.badCharacterInPatientId"), // $NON-NLS-1$ iDartProperties.illegalPatientIdChars)); return false; } if (PatientManager.checkPatientIdentifier( getHSession(), newId.getPatient(), newId.getType(), newId.getValueEdit())) { showMessage( MessageDialog.ERROR, Messages.getString("PatientIdDialog.error.exists.title"), // $NON-NLS-1$ MessageFormat.format( Messages.getString("PatientIdDialog.error.exists.message"), // $NON-NLS-1$ newId.getType().getName(), newId.getValueEdit())); return false; } List<Patient> altPatients = PatientManager.getPatientsByAltId(getHSession(), newId.getType(), newId.getValueEdit()); if (!altPatients.isEmpty()) { String patientsWithThisOldId = EMPTY; for (Patient p : altPatients) { patientsWithThisOldId += (p.getPatientId() + ", "); // $NON-NLS-1$ } patientsWithThisOldId = patientsWithThisOldId.substring(0, patientsWithThisOldId.length() - 2); MessageBox mSave = new MessageBox(getShell(), SWT.ICON_WARNING | SWT.YES | SWT.NO); mSave.setText(Messages.getString("patient.warning.saveDuplicateId.title")); // $NON-NLS-1$ mSave.setMessage( MessageFormat.format( Messages.getString("patient.warning.saveDuplicateId"), // $NON-NLS-1$ patientsWithThisOldId)); if (mSave.open() != SWT.YES) { return false; } } } if (allEmpty) { showMessage( MessageDialog.ERROR, Messages.getString("PatientIdDialog.error.empty.title"), // $NON-NLS-1$ Messages.getString("PatientIdDialog.error.empyt.message")); // $NON-NLS-1$ return false; } return true; }
/** This method initializes compHeader */ @Override protected void createCompHeader() { buildCompHeader( Messages.getString("PatientIdDialog.title"), iDartImage.PATIENTINFOLABEL); // $NON-NLS-1$ }
/** This method initializes newPrintBlankLabel */ @Override protected void createShell() { buildShell( Messages.getString("PatientIdDialog.title"), new Rectangle(0, 0, 600, 570)); // $NON-NLS-1$ }
/** This method initializes compHeader */ @Override protected void createCompHeader() { String titleText = Messages.getString("NewReports.shell.title"); // $NON-NLS-1$ iDartImage icoImage = iDartImage.REPORTS; buildCompHeader(titleText, icoImage); }
/** This method initializes newReports */ @Override protected void createShell() { buildShell(Messages.getString("NewReports.shell.title")); // $NON-NLS-1$ }