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

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

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

Table.getClientArea介绍

暂无

代码示例

代码示例来源:origin: caoxinyu/RedisClient

@Override
public void handleEvent(Event event) {
    Rectangle clientArea = table.getClientArea();
    Point pt = new Point(event.x, event.y);
    int index = table.getTopIndex();
    int count = table.getItemCount();
    while (index < count) {
      boolean visible = false;
      TableItem item = table.getItem(index);
      
      for (int i = 0; i < table.getColumnCount(); i++) {
        Rectangle rect = item.getBounds(i);
        if (rect.contains(pt)) {
          beforeEdit();
          clickRow(item, i);
          return;
        }
        if (!visible && rect.intersects(clientArea)) {
          visible = true;
        }
      }
      if (!visible)
        return;
      index++;
    }
}
protected void beforeEdit() {

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

boolean control = ( event.stateMask & SWT.MOD1 ) != 0;
if ( !shift && !control ) {
 Rectangle clientArea = table.getClientArea();
 Point pt = new Point( event.x, event.y );
 int index = table.getTopIndex();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
public Rectangle getClientArea () {
  return table.getClientArea();
}
@Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
public Rectangle getClientArea () {
  return table.getClientArea();
}
@Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
public Rectangle getClientArea () {
  return table.getClientArea();
}
@Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
public Rectangle getClientArea () {
  return table.getClientArea();
}
@Override

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

@Override
  public void controlResized(ControlEvent event) {
    int itemHeight= fTable.getItemHeight();
    Rectangle clientArea= fTable.getClientArea();
    fNumberOfVisibleItems= (clientArea.height / itemHeight) + 1;
  }
});

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

@Override
  public void controlResized(ControlEvent event) {
    int itemHeight= fTable.getItemHeight();
    Rectangle clientArea= fTable.getClientArea();
    fNumberOfVisibleItems= (clientArea.height / itemHeight) + 1;
  }
});

代码示例来源: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/org.eclipse.wst.server.ui

protected void layout(Composite composite, boolean flushCache) {
    Table table = (Table) composite;
    TableColumn[] tableColumns = table.getColumns();
    int width = table.getClientArea().width - 10;
    
    tableColumns[0].setWidth(width);
  }
}

代码示例来源: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.codehaus.openxma/xmartclient

private int getColumnAt(Table table, MouseEvent e) {
  int deltaX = e.x - table.getClientArea().x;
  int columnIndex = 0;
  int addedWidths = 0;
  for (int i=0; i<table.getColumnCount(); i++) {
    TableColumn column = table.getColumn(i);
    addedWidths += column.getWidth();
    if (addedWidths > deltaX)
      return columnIndex;
    columnIndex++;
  }
  return columnIndex - 1;
}

代码示例来源: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.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.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: net.sf.okapi.lib/okapi-lib-segmentation-ui

public void controlResized(ControlEvent e) {
    Rectangle rect = tblRules.getClientArea();
    //TODO: Check behavior when manual resize a column width out of client area
    int typeColWidth = 90;
    int nHalf = (int)((rect.width-typeColWidth) / 2);
    tblRules.getColumn(0).setWidth(typeColWidth);
    tblRules.getColumn(1).setWidth(nHalf);
    tblRules.getColumn(2).setWidth(nHalf);
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

private void resizeTable() {
  int iNewWidth = table.getClientArea().width -
         table.getColumn(1).getWidth() -
         table.getColumn(2).getWidth() - 20;
 if (iNewWidth > 50)
  table.getColumn(0).setWidth(iNewWidth);
}

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

public void controlResized(ControlEvent e) {
    int tableWidth = table.getClientArea().width;
    table.getColumn(0).setWidth(INFOCOLWIDTH);
    int remaining = tableWidth - INFOCOLWIDTH;
    table.getColumn(1).setWidth(remaining / 3);
    table.getColumn(2).setWidth(remaining / 3);
    table.getColumn(3).setWidth(remaining / 3);
  }
});

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

public void controlResized(ControlEvent e) {
    Rectangle rect = tblIssues.getClientArea();
    int checkColWidth = 32;
    int severityColWidth = 28;
    int part = (int)((rect.width-(checkColWidth+severityColWidth)) / 100);
    int remainder = (int)((rect.width-(checkColWidth+severityColWidth)) % 100);
    tblIssues.getColumn(0).setWidth(checkColWidth);
    tblIssues.getColumn(1).setWidth(severityColWidth);
    tblIssues.getColumn(2).setWidth(part*10);
    tblIssues.getColumn(3).setWidth(part*5);
    tblIssues.getColumn(4).setWidth(remainder+(part*85));
  }
});

相关文章

Table类方法