org.eclipse.swt.widgets.TableColumn.getParent()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.eclipse.swt.widgets.TableColumn.getParent()方法的一些代码示例,展示了TableColumn.getParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.getParent()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.TableColumn
类名称:TableColumn
方法名:getParent

TableColumn.getParent介绍

[英]Returns the receiver's parent, which must be a Table.
[中]

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

Table table = column.getParent();
TableColumn[] columns = table.getColumns();
int firstWidth = 0, restWidth = 0;

代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui

/**
   * Returns the index of the given column in the backing table for this page, or 0
   * 
   * @return the index of the column in the backing table for this page or 0
   */
  private int getColumnIndex() {
    int idx = this.column.getParent().indexOf(this.column);
    return (idx < 0 ? 0 : idx);
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static ITableAdapter getTableAdapter( TableColumn column ) {
 return column.getParent().getAdapter( ITableAdapter.class );
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

Composite getComposite(Widget column) {
  return ((TableColumn) column).getParent().getParent();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

Composite getComposite(Widget column) {
  return ((TableColumn) column).getParent().getParent();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static ITableAdapter getTableAdapter( TableColumn column ) {
 return column.getParent().getAdapter( ITableAdapter.class );
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static int getIndex( TableColumn column ) {
 return column.getParent().indexOf( column );
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

static int getZIndex( final TableColumn column ) {
 return ControlLCAUtil.getZIndex( column.getParent() ) + 1;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

Composite getComposite(Widget column) {
  return ((TableColumn) column).getParent().getParent();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static Font getFont( TableColumn column ) {
 Table table = column.getParent();
 IControlAdapter adapter = table.getAdapter( IControlAdapter.class );
 return adapter.getUserFont();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

public void renderInitialization( final Widget widget ) throws IOException {
 TableColumn column = ( TableColumn )widget;
 JSWriter writer = JSWriter.getWriterFor( column );
 Object[] args = new Object[] { column.getParent() };
 writer.newWidget( "org.eclipse.swt.widgets.TableColumn", args );    
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

static int getLeft( final TableColumn column ) {
 Object adapter = column.getParent().getAdapter( ITableAdapter.class );
 ITableAdapter tableAdapter = ( ITableAdapter )adapter;
 return tableAdapter.getColumnLeft( column );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui

/**
 * Sets the sorting direction for this sorter to use
 * 
 * @param direction
 */
public void setDirection(int direction) {
  this.column.getParent().setSortColumn(this.column);
  this.direction = direction;
  this.column.getParent().setSortDirection(this.direction);
  if (this.cviewer.getComparator() == this) {
    this.cviewer.refresh();
  } else {
    this.cviewer.setComparator(this);
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

static String getSortDirection( final TableColumn column ) {
 String result = null;
 Table table = column.getParent();
 if( table.getSortColumn() == column ) {
  if( table.getSortDirection() == SWT.UP ) {
   result = "up";
  } else if( table.getSortDirection() == SWT.DOWN ) {
   result = "down";
  }
 }
 return result;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
public void renderInitialization( TableColumn column ) throws IOException {
 RemoteObject remoteObject = createRemoteObject( column, TYPE );
 remoteObject.setHandler( new TableColumnOperationHandler( column ) );
 remoteObject.set( "parent", getId( column.getParent() ) );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui

@Override
  public void widgetSelected(SelectionEvent e) {
    if (ColumnSorter.this.cviewer.getComparator() != ColumnSorter.this) {
      setDirection(SWT.DOWN);
    } else {
      int tdirection = ColumnSorter.this.column.getParent().getSortDirection();
      if (tdirection == SWT.NONE) {
        setDirection(SWT.DOWN);
      } else {
        setDirection(tdirection == SWT.UP ? SWT.DOWN : SWT.UP);
      }
    }
  }
});

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
   * @since 1.3
   */
  protected void updateColumnData(Widget column) {
    TableColumn tColumn = (TableColumn) column;
    Table t = tColumn.getParent();
    
    if( ! IS_GTK || t.getColumn(t.getColumnCount()-1) != tColumn ){
      tColumn.setData(LAYOUT_DATA,
          new ColumnPixelData(tColumn.getWidth()));
      layout(t.getParent(), true);
    }    
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
   * @since 3.5
   */
  @Override
  protected void updateColumnData(Widget column) {
    TableColumn tColumn = (TableColumn) column;
    Table t = tColumn.getParent();

    if (!IS_GTK || t.getColumn(t.getColumnCount() - 1) != tColumn) {
      tColumn.setData(LAYOUT_DATA,
          new ColumnPixelData(tColumn.getWidth()));
      layout(t.getParent(), true);
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
   * @since 3.5
   */
  @Override
  protected void updateColumnData(Widget column) {
    TableColumn tColumn = (TableColumn) column;
    Table t = tColumn.getParent();

    if (!IS_GTK || t.getColumn(t.getColumnCount() - 1) != tColumn) {
      tColumn.setData(LAYOUT_DATA,
          new ColumnPixelData(tColumn.getWidth()));
      layout(t.getParent(), true);
    }
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

static void moveColumn( TableColumn column, int newLeft ) {
 Table table = column.getParent();
 int targetColumn = findMoveTarget( table, newLeft );
 int[] columnOrder = table.getColumnOrder();
 int index = table.indexOf( column );
 int orderIndex = arrayIndexOf( columnOrder, index );
 columnOrder = arrayRemove( columnOrder, orderIndex );
 if( orderIndex < targetColumn ) {
  targetColumn--;
 }
 if( isFixed( column ) || isFixed( table.getColumn( targetColumn ) ) ) {
  targetColumn = table.indexOf( column );
 }
 columnOrder = arrayInsert( columnOrder, targetColumn, index );
 if( Arrays.equals( columnOrder, table.getColumnOrder() ) ) {
  // TODO [rh] HACK mark left as changed
  TableColumn[] columns = table.getColumns();
  for( int i = 0; i < columns.length; i++ ) {
   getAdapter( columns[ i ] ).preserve( PROP_LEFT, null );
  }
 } else {
  table.setColumnOrder( columnOrder );
  // [if] HACK mark left as changed - see bug 336340
  getAdapter( column ).preserve( PROP_LEFT, null );
 }
}

相关文章