public void buildWUIDTab(String wuid) {
    CTabItem tab2 = new CTabItem(folder, SWT.NONE);
    tab2.setText(wuid);

    Table table = new Table(folder, SWT.VIRTUAL | SWT.BORDER);
    table.setLinesVisible(true);
    table.setHeaderVisible(true);
    table.clearAll();
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.heightHint = 200;
    table.setLayoutData(data);

    // openFile(fileName,table);

    tab2.setControl(table);
  }
  public void buildTab(String filename, String resType, CTabFolder subfolder) {
    System.out.println("buildTab");
    CTabItem tab2 = new CTabItem(subfolder, SWT.NONE);
    tab2.setText(resType);

    Table table = new Table(subfolder, SWT.VIRTUAL | SWT.BORDER);
    table.setLinesVisible(true);
    table.setHeaderVisible(true);
    table.clearAll();
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.heightHint = 200;
    table.setLayoutData(data);

    openFile(filename, table);

    tab2.setControl(table);
    System.out.println("BUILDSUBTAB--------" + subfolder.indexOf(tab2));
    subfolder.setSelection(subfolder.indexOf(tab2));
  }
Ejemplo n.º 3
0
  /** build the view */
  private void buildView() {
    GridLayout gridLayout = new GridLayout(2, false);
    final Composite comp = new Composite(shell, SWT.NONE);

    shell.setLayout(new FillLayout());

    comp.setLayout(gridLayout);

    GridData gridData = new GridData();

    dataList = new List(comp, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
    gridData = new GridData();
    gridData.widthHint = 200;
    gridData.verticalAlignment = SWT.FILL;
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalSpan = 2;
    dataList.setLayoutData(gridData);
    dataList.addListener(SWT.Selection, new ListListener());

    dataTable = new Table(comp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
    dataTable.setLinesVisible(true);
    dataTable.setHeaderVisible(true);

    gridData = new GridData();
    gridData.verticalAlignment = SWT.FILL;
    gridData.horizontalAlignment = SWT.FILL;
    gridData.grabExcessVerticalSpace = true;
    gridData.grabExcessHorizontalSpace = true;
    dataTable.setLayoutData(gridData);

    final TableColumn column1 = new TableColumn(dataTable, SWT.NONE);
    final TableColumn column2 = new TableColumn(dataTable, SWT.NONE);

    column1.setText("Time");
    column2.setText("Value");
    column1.setWidth(180);
    column2.setWidth(270);

    Composite buttonsComp = new Composite(comp, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.heightHint = 40;
    buttonsComp.setLayoutData(gridData);
    RowLayout rowLayout = new RowLayout();
    rowLayout.type = SWT.HORIZONTAL;

    rowLayout.justify = true;
    rowLayout.pack = true;
    buttonsComp.setLayout(rowLayout);

    ButtonListener bl = new ButtonListener();

    Button refreshButton = new Button(buttonsComp, SWT.NONE);
    refreshButton.setText("Refresh");
    refreshButton.addSelectionListener(bl);

    Button exportButton = new Button(buttonsComp, SWT.NONE);
    exportButton.setText("Export");
    exportButton.addSelectionListener(bl);

    Button deleteButton = new Button(buttonsComp, SWT.NONE);
    deleteButton.setText("Delete Selection");
    deleteButton.addSelectionListener(bl);

    Button deleteallButton = new Button(buttonsComp, SWT.NONE);
    deleteallButton.setText("Delete all");
    deleteallButton.addSelectionListener(bl);
  }