Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.TableColumn


    return null;
  }

  public String getColumnText(Object element, int columnIndex) {
    String result = null;
    TableColumn column = viewer.getTable().getColumn(columnIndex);
    if (column != null && element instanceof CloudService) {
      CloudService cloudService = (CloudService) element;
      ServiceViewColumn serviceColumn = (ServiceViewColumn) column.getData();

      if (serviceColumn != null) {
        switch (serviceColumn) {
        case Name:
          result = getText(element);
View Full Code Here


    Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
    table.setHeaderVisible(true);

    for (int i = 0; i < columnNames.length; i++) {
      TableColumn column = new TableColumn(table, SWT.NONE);
      column.setText(columnNames[i]);
      layout.setColumnData(column, new ColumnWeightData(columnWeights[i]));
    }

    TableViewer tableViewer = new TableViewer(table);
    tableViewer.setColumnProperties(columnNames);
View Full Code Here

    ViewColumn[] columns = ViewColumn.values();
    String[] columnProperties = new String[columns.length];

    for (ViewColumn column : columns) {
      columnProperties[columnIndex] = column.name();
      TableColumn tableColumn = new TableColumn(table, SWT.NONE, columnIndex++);
      tableColumn.setData(column);
      tableColumn.setText(column.name());
      tableColumn.setWidth(column.getWidth());
    }

    envVariablesViewer.setColumnProperties(columnProperties);

    addEditButtons(commonArea);
View Full Code Here

      return null;
    }

    public String getColumnText(Object element, int columnIndex) {
      String result = null;
      TableColumn column = viewer.getTable().getColumn(columnIndex);
      if (column != null) {
        ViewColumn serviceColumn = (ViewColumn) column.getData();
        if (serviceColumn != null) {
          EnvironmentVariable var = (EnvironmentVariable) element;
          switch (serviceColumn) {
          case Variable:
            result = var.getVariable();
View Full Code Here

      total += column.getWidth();
    }

    if (total < tableWidth) {
      // resize the last one
      TableColumn lastColumn = tableColumns[tableColumns.length - 1];
      int newWidth = (tableWidth - total) + lastColumn.getWidth();
      lastColumn.setWidth(newWidth);
    }

  }
View Full Code Here

    if (columns == null) {
      return;
    }

    String[] columnProperties = new String[columns.length];
    TableColumn sortColumn = null;
    for (ServiceViewColumn column : columns) {
      columnProperties[columnIndex] = column.name();
      TableColumn tableColumn = new TableColumn(table, SWT.NONE, columnIndex++);
      tableColumn.setData(column);
      tableColumn.setText(column.name());
      tableColumn.setWidth(column.getWidth());
      tableColumn.addSelectionListener(new ColumnSortListener(tableViewer));

      if (column == ServiceViewColumn.Name) {
        sortColumn = tableColumn;
      }
View Full Code Here

      total += column.getWidth();
    }

    if (total < tableWidth) {
      // resize the last one
      TableColumn lastColumn = tableColumns[tableColumns.length - 1];
      int newWidth = (tableWidth - total) + lastColumn.getWidth();
      lastColumn.setWidth(newWidth);
    }

  }
View Full Code Here

    ViewColumn[] columns = ViewColumn.values();
    String[] columnProperties = new String[columns.length];

    for (ViewColumn column : columns) {
      columnProperties[columnIndex] = column.name();
      TableColumn tableColumn = new TableColumn(table, SWT.NONE, columnIndex++);
      tableColumn.setData(column);
      tableColumn.setText(column.name());
      tableColumn.setWidth(column.getWidth());

    }

    tableViewer.setColumnProperties(columnProperties);
View Full Code Here

      return super.getText(element);
    }

    public Image getColumnImage(Object element, int columnIndex) {

      TableColumn column = viewer.getTable().getColumn(columnIndex);
      if (column != null && column.getData() == ViewColumn.ServiceName) {
        return getImage(element);
      }

      return null;
    }
View Full Code Here

      return null;
    }

    public String getColumnText(Object element, int columnIndex) {
      String result = null;
      TableColumn column = viewer.getTable().getColumn(columnIndex);
      if (column != null) {
        ViewColumn serviceColumn = (ViewColumn) column.getData();
        if (serviceColumn != null) {
          CaldecottTunnelDescriptor descriptor = (CaldecottTunnelDescriptor) element;
          switch (serviceColumn) {
          case ServiceName:
            result = getText(element);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.TableColumn

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.