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

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

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

Table.getHeaderHeight介绍

[英]Returns the height of the receiver's header
[中]返回接收器标题的高度

代码示例

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

@Override
protected boolean allowMouseEvent( Table table, int x, int y ) {
 return super.allowMouseEvent( table, x, y ) && y >= table.getHeaderHeight();
}

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

private static void writeHeaderHeight( final Table table ) throws IOException
{
 JSWriter writer = JSWriter.getWriterFor( table );
 Integer newValue = new Integer( table.getHeaderHeight() );
 writer.set( PROP_HEADER_HEIGHT, "headerHeight", newValue, null );
}

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

private int getTop( int itemIndex ) {
 int relativeItemIndex = itemIndex - parent.getTopIndex();
 int headerHeight = parent.getHeaderHeight();
 int itemHeight = parent.getItemHeight();
 return headerHeight + relativeItemIndex * itemHeight;
}

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

final int getVisibleItemCount( boolean includePartlyVisible ) {
 int clientHeight = getClientArea().height - getHeaderHeight();
 int result = 0;
 if( clientHeight >= 0 ) {
  int itemHeight = getItemHeight();
  result = clientHeight / itemHeight;
  if( includePartlyVisible && clientHeight % itemHeight != 0 ) {
   result++;
  }
 }
 return result;
}

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

/**
 * Returns the number of items the table can fit in its current layout
 */
private int computeNumberOfItems() {
  Rectangle rect = table.getClientArea ();
  int itemHeight = table.getItemHeight ();
  int headerHeight = table.getHeaderHeight ();
  return (rect.height - headerHeight + itemHeight - 1) / (itemHeight + table.getGridLineWidth());
}

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

boolean needsVScrollBar() {
 int availableHeight = getClientArea().height;
 int height = getHeaderHeight();
 height += getItemCount() * getItemHeight();
 return height > availableHeight;
}

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

public int getVisibleItemCount() {
  Table table = viewer.getTable();
  Rectangle rect = table.getClientArea ();
  int itemHeight = table.getItemHeight ();
  int headerHeight = table.getHeaderHeight ();
  return (rect.height - headerHeight + itemHeight - 1) / (itemHeight + table.getGridLineWidth());
}

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

@Override
public int getVisibleItemCount() {
  Table table = viewer.getTable();
  Rectangle rect = table.getClientArea ();
  int itemHeight = table.getItemHeight ();
  int headerHeight = table.getHeaderHeight ();
  return (rect.height - headerHeight + itemHeight - 1) / (itemHeight + table.getGridLineWidth());
}

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

@Override
public int getVisibleItemCount() {
  Table table = viewer.getTable();
  Rectangle rect = table.getClientArea ();
  int itemHeight = table.getItemHeight ();
  int headerHeight = table.getHeaderHeight ();
  return (rect.height - headerHeight + itemHeight - 1) / (itemHeight + table.getGridLineWidth());
}

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

/**
 * @param table the table
 * @param height the current height of the table
 * @return the number of visible lines in the table
 */
private int doGetNumberOfVisibleLines(Table table, int height) {
  // height of border
  int border = fTableViewer.getTable().getHeaderHeight();
  // height of scroll bar
  int scroll = fTableViewer.getTable().getHorizontalBar().getSize().y;
  // height of table is table's area minus border and scroll bar height
  height = height-border-scroll;
  // calculate number of visible lines
  int lineHeight = getMinTableItemHeight(table);
  int numberOfLines = height/lineHeight;
  return numberOfLines;
}

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

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result= table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result+= table.getGridLineWidth() * (rows - 1);
  return result;
}

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

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result = table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result += table.getGridLineWidth() * (rows - 1);
  return result;
}

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

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result= table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result+= table.getGridLineWidth() * (rows - 1);
  return result;
}

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

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result= table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result+= table.getGridLineWidth() * (rows - 1);
  return result;		
}

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

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result= table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result+= table.getGridLineWidth() * (rows - 1);
  return result;		
}

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

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result= table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result+= table.getGridLineWidth() * (rows - 1);
  return result;
}

代码示例来源:origin: oyse/yedit

public static int getTableHeightHint(Table table, int rows) {
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
    table.setFont(JFaceResources.getDialogFont());
  int result= table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
    result+= table.getGridLineWidth() * (rows - 1);
  return result;      
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui

public static int getTableHeightHint(Table table, int rows)
{
  if (table.getFont().equals(JFaceResources.getDefaultFont()))
  {
    table.setFont(JFaceResources.getDialogFont());
  }
  int result = table.getItemHeight() * rows + table.getHeaderHeight();
  if (table.getLinesVisible())
  {
    result += table.getGridLineWidth() * (rows - 1);
  }
  return result;
}

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

private int getNumberOfVisibleLines() {
  Table table = getTable();
  int height = table.getSize().y;
  // when table is not yet created, height is zero
  if (height == 0) {
    // make use of the table viewer to estimate table size
    height = table.getParent().getSize().y;
  }
  // height of border
  int border = table.getHeaderHeight();
  // height of scroll bar
  int scroll = table.getHorizontalBar().getSize().y;
  // height of table is table's area minus border and scroll bar height
  height = height - border - scroll;
  // calculate number of visible lines
  int lineHeight = getMinTableItemHeight(table);
  int numberOfLines = height / lineHeight;
  if (numberOfLines <= 0) {
    return 20;
  }
  return numberOfLines;
}

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

@Override
public void preserveValues( Table table ) {
 preserveProperty( table, PROP_ITEM_COUNT, table.getItemCount() );
 preserveProperty( table, PROP_ITEM_HEIGHT, table.getItemHeight() );
 preserveProperty( table, PROP_ITEM_METRICS, getItemMetrics( table ) );
 preserveProperty( table, PROP_COLUMN_COUNT, table.getColumnCount() );
 preserveProperty( table, PROP_COLUMN_ORDER, getColumnOrder( table ) );
 preserveProperty( table, PROP_FIXED_COLUMNS, getFixedColumns( table ) );
 preserveProperty( table, PROP_HEADER_HEIGHT, table.getHeaderHeight() );
 preserveProperty( table, PROP_HEADER_VISIBLE, table.getHeaderVisible() );
 preserveProperty( table, PROP_HEADER_FOREGROUND, table.getHeaderForeground() );
 preserveProperty( table, PROP_HEADER_BACKGROUND, table.getHeaderBackground() );
 preserveProperty( table, PROP_LINES_VISIBLE, table.getLinesVisible() );
 preserveProperty( table, PROP_TOP_ITEM_INDEX, table.getTopIndex() );
 preserveProperty( table, PROP_FOCUS_ITEM, getFocusItem( table ) );
 preserveProperty( table, PROP_SCROLL_LEFT, getScrollLeft( table ) );
 preserveProperty( table, PROP_SELECTION, getSelection( table ) );
 preserveProperty( table, PROP_SORT_DIRECTION, getSortDirection( table ) );
 preserveProperty( table, PROP_SORT_COLUMN, table.getSortColumn() );
 preserveProperty( table, PROP_ALWAYS_HIDE_SELECTION, hasAlwaysHideSelection( table ) );
 preserveProperty( table, PROP_ENABLE_CELL_TOOLTIP, CellToolTipUtil.isEnabledFor( table ) );
 preserveProperty( table, PROP_CELL_TOOLTIP_TEXT, null );
}

相关文章

Table类方法