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)); } } }); }
private void createLoadingBar() { new ProgressMonitorDialog(parent); Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); shell.setText("Report Loading"); shell.addDisposeListener( new org.eclipse.swt.events.DisposeListener() { @Override public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) { if (thread.isAlive()) { thread.interrupt(); reportFinished = true; } } }); Label label = new Label(shell, SWT.NONE); label.setSize(new Point(260, 20)); label.setLocation(20, 30); label.setText("Please wait while the report loads."); label.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); label.setAlignment(SWT.CENTER); Label timelabel = new Label(shell, SWT.NONE); timelabel.setSize(new Point(260, 20)); timelabel.setLocation(20, 50); // timelabel.setText("(approx " + timeEst + ")"); timelabel.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); timelabel.setAlignment(SWT.CENTER); ProgressBar progressBar = new ProgressBar(shell, SWT.HORIZONTAL | SWT.INDETERMINATE); progressBar.setSize(new Point(200, 20)); progressBar.setLocation(50, 80); Button button = new Button(shell, SWT.NONE); button.setSize(new Point(100, 30)); button.setLocation(100, 120); button.setText("Cancel"); button.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8)); button.setAlignment(SWT.CENTER); button.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() { @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { if ((thread != null) && thread.isAlive()) { thread.interrupt(); reportFinished = true; } } }); shell.setSize(new Point(300, 200)); LayoutUtils.centerGUI(shell); shell.open(); while (!reportFinished) { if (!parent.getDisplay().readAndDispatch()) { parent.getDisplay().sleep(); } } if (!shell.isDisposed()) { shell.close(); } }
/** 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(); }
/** 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)); }