Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TableLayout


  @Override
  public void createPartControl(Composite parent) {
    viewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.H_SCROLL
        | SWT.V_SCROLL | SWT.SINGLE);
    // test setup columns...
    TableLayout layout = new TableLayout();
    layout.addColumnData(new ColumnWeightData(20, true));

    layout.addColumnData(new ColumnWeightData(100, true));

    // layout.addColumnData(new ColumnWeightData(60, false));
    // layout.addColumnData(new ColumnWeightData(20, false));
    viewer.getTable().setLayout(layout);
    viewer.getTable().setLinesVisible(true);
View Full Code Here


          table.setLinesVisible(true);
          return table;
      }
     
      private void createColumns() {
          TableLayout layout = new TableLayout();
          getTable().setLayout(layout);
          getTable().setHeaderVisible(true);
          for (int i = 0; i < columnHeaders.length; i++) {
              layout.addColumnData(columnLayouts[i]);
              TableColumn tc = new TableColumn(getTable(), SWT.NONE,i);
              tc.setResizable(columnLayouts[i].resizable);
              tc.setText(columnHeaders[i]);
              final int j = i;
              tc.addSelectionListener(new SelectionAdapter() {            
View Full Code Here

//                }
//            });
        }

        private void createColumns() {
            TableLayout layout = new TableLayout();
            getTable().setLayout(layout);
            getTable().setHeaderVisible(true);
            for (int i = 0; i < columnHeaders.length; i++) {
                layout.addColumnData(columnLayouts[i]);
                TableColumn tc = new TableColumn(getTable(), SWT.BORDER, i);
                tc.setResizable(columnLayouts[i].resizable);
                tc.setText(columnHeaders[i]);
                tc.pack();
                final int j = i;
View Full Code Here

    Table table = getTable();
    table.setHeaderVisible(true);
    table.setLayoutData(new GridData(GridData.FILL_BOTH));

    TableLayout layout = new TableLayout();

    for (int i = 0; i < columnPropertiesArray.length; i++) {
      TableColumn column = new TableColumn(table, i);
      column.setText(columnPropertiesArray[i]);
      column.setAlignment(SWT.LEFT);
      layout.addColumnData(new ColumnWeightData(getColumnWidth(i), true));
    }

    table.setLayout(layout);

    this.visibleRows = visibleRows;
View Full Code Here

    tableViewer.setColumnProperties(titleArray);
    Table table = tableViewer.getTable();
    table.setHeaderVisible(true);
    table.setLayoutData(new GridData(GridData.FILL_BOTH));
    int[] widthArray = {50, 20, 30};
    TableLayout layout = new TableLayout();
    for (int i = 0; i < titleArray.length; i++) {
      TableColumn column = new TableColumn(table, i);
      column.setText(titleArray[i]);
      column.setAlignment(SWT.LEFT);
      layout.addColumnData(new ColumnWeightData(widthArray[i], true));
    }
    this.visibleRows = visibleRows;
    for (int i = 0; i < visibleRows; i++) {
      TableItem item = new TableItem(table, SWT.NONE);
      item.setText("#######"); //$NON-NLS-1$
View Full Code Here

    table = getTable();
    table.setHeaderVisible(true);
    table.setLayoutData(new GridData(GridData.FILL_BOTH));

    TableLayout layout = new TableLayout();

    for (int i = 0; i < columnPropertiesArray.length; i++) {
      TableColumn column = new TableColumn(table, i);
      if ((columnPropertiesArray[i]).equals(LABEL_LOCATION_HINT)) {
        if (showLocationText) {
          column.setText(columnPropertiesArray[i]);
        }
        else {
          // Comment this out until we solve the alignment/(space
          // for image being allocated
          // to prefix column) ......
          // column.setImage(XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT));
        }
      }
      else {
        column.setText(columnPropertiesArray[i]);
      }
      column.setAlignment(SWT.LEFT);
      layout.addColumnData(new ColumnWeightData(getColumnWidth(i), true));
    }
    table.setLayout(layout);

    this.visibleRows = visibleRows;
    // for (int i = 0; i < visibleRows; i++)
View Full Code Here

        data.right = new FormAttachment(100,0);
        table.setLayoutData(data);
    }

    private void createColumns(final Table table) {
        final TableLayout layout = new TableLayout();
       
        for (int i = 0; i < weekDays.length; i++) {
            if(i==0)
                layout.addColumnData(new ColumnWeightData(10, true));
            else
                layout.addColumnData(new ColumnWeightData(50, true));
           
            TableColumn col = new TableColumn(table, SWT.CENTER);
            col.setResizable(true);
            col.setText(weekDays[i]);
        }
        table.setLayout(layout);
       
        table.addListener(SWT.Resize, new Listener(){
            public void handleEvent(Event arg0) {
                final TableLayout layout = new TableLayout();
                for (int i = 0; i < weekDays.length; i++) {
                    if(i==0)
                        layout.addColumnData(new ColumnWeightData(10, true));
                    else
                        layout.addColumnData(new ColumnWeightData(50, true));
                }
                table.setLayout(layout);
            }
        });
    }
View Full Code Here

    private void createColumns() {
        final String[] columns = { "Data prevista", "Item", "Valor previsto"};

        table.addListener(SWT.Resize, new Listener() {
            public void handleEvent(Event arg0) {
                final TableLayout layout = new TableLayout();
                for (int i = 0; i < columns.length; i++)
                    layout.addColumnData(new ColumnWeightData(getColumnPercent(i), getColumnWidth(i)));
                table.setLayout(layout);
            }

            private int getColumnWidth(int i) {
                return (i == 2)
View Full Code Here

        createColumns();
        getCitiesTableOrder();

        citiesTable.addListener(SWT.Resize, new Listener() {
            public void handleEvent(Event arg0) {
                TableLayout layout = new TableLayout();
                layout.addColumnData(new ColumnWeightData(0, 0, true));
                layout.addColumnData(new ColumnWeightData(0, 0, true));
                layout.addColumnData(new ColumnWeightData(70, 200, true));
                layout.addColumnData(new ColumnWeightData(30, 80, true));
        
                citiesTable.setLayout(layout);
            }
        });
       
View Full Code Here

    createColumns();
//    getCitiesTableOrder();

    clausesTable.addListener(SWT.Resize, new Listener() {
      public void handleEvent(Event arg0) {
        TableLayout layout = new TableLayout();
        layout.addColumnData(new ColumnWeightData(100, 200, true));
        layout.addColumnData(new ColumnWeightData(0, 0, true));

        clausesTable.setLayout(layout);
      }
    });
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.TableLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.