SHARE
TWEET

Untitled

a guest Feb 24th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Button plotButton = new Button(composite, SWT.PUSH);
  2.    plotButton.setText("Select Plotter");
  3.    plotButton.addSelectionListener(new SelectionAdapter() {
  4.        public void widgetSelected(SelectionEvent e) {
  5.           startPrinterListOperation();              
  6.           showFooBarDialog();
  7.        }
  8.   });
  9.    
  10. private void showFooBarDialog() {
  11.   apd = new FooDialog(null);
  12.   apd.create();
  13.   apd.getShell().setSize(700, 400);
  14.   apd.open();      
  15. }
  16.    
  17. private void startPrinterListOperation() {
  18.   listOp = new AplotPrinterListOperation(appReg.getString("aplot.message.GETPRINTERLIST"), session);
  19.   listOp.addOperationListener(new MyOperationListener(this) {
  20.      public void endOperationImpl() {
  21.         try {
  22.             printers = (ArrayList<PrinterProfile>) listOp.getPrinters();
  23.         }
  24.         finally {
  25.            listOp.removeOperationListener(this);
  26.            listOp = null;
  27.         }
  28.      }
  29.   });
  30.   session.queueOperation(listOp);
  31. }
  32.    
  33. viewer.setInput(parentDialog.getPrintersArray());
  34.    
  35. private TableViewer createPlotterTable(Composite parent) {
  36.   Composite composite = new Composite(parent, SWT.NONE);
  37.  
  38.   viewer = new TableViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
  39.   createColumns(parent, viewer);
  40.   Table table = viewer.getTable();
  41.   table.setHeaderVisible(true);
  42.   table.setLinesVisible(true);
  43.   viewer.setContentProvider(new ArrayContentProvider());
  44.   viewer.setInput(parentDialog.getPrintersArray());
  45.  
  46.   // Layout the viewer
  47.   GridData gridData = new GridData();
  48.   gridData.verticalAlignment = GridData.FILL;
  49.   gridData.horizontalSpan = 2;
  50.   gridData.grabExcessHorizontalSpace = true;
  51.   gridData.grabExcessVerticalSpace = true;
  52.   gridData.horizontalAlignment = GridData.FILL;
  53.   viewer.getControl().setLayoutData(gridData);
  54.  
  55.   return viewer;
  56. }
  57.    
  58. public class AplotPlotterDialog extends TitleAreaDialog {
  59.    private AplotBaseDialog parentDialog = null;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top