本文整理了Java中org.eclipse.swt.widgets.Table.getItemHeight()
方法的一些代码示例,展示了Table.getItemHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getItemHeight()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getItemHeight
[英]Returns the height of the area which would be used to display one of the items in the receiver.
[中]返回用于显示接收器中一个项目的区域的高度。
代码示例来源: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
private int getHeight( int index ) {
int result = 0;
int columnCount = parent.getColumnCount();
boolean singleColumn = index == 0 && columnCount == 0;
boolean columnInRange = index >= 0 && index < columnCount;
if( singleColumn || columnInRange ) {
result = parent.getItemHeight();
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static void writeItemHeight( final Table table ) throws IOException {
JSWriter writer = JSWriter.getWriterFor( table );
Integer newValue = new Integer( table.getItemHeight( ) );
writer.set( PROP_ITEM_HEIGHT, "itemHeight", newValue, DEFAUT_ITEM_HEIGHT );
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
protected int getVisibleItemCount(int top) {
int itemCount = fTable.getItemCount();
return Math.min((fTable.getBounds().height / fTable.getItemHeight()) + 2, itemCount - top);
}
代码示例来源: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.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.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.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: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static void readTopIndex( final Table table ) {
String value = WidgetLCAUtil.readPropertyValue( table, "topIndex" );
if( value != null ) {
int topIndex = NumberFormatUtil.parseInt( value );
int topOffset = topIndex * table.getItemHeight();
table.setTopIndex( topIndex );
processScrollBarSelection( table.getVerticalBar(), topOffset );
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
public void handleSetTopItemIndex( Table table, JsonObject properties ) {
JsonValue value = properties.get( PROP_TOP_ITEM_INDEX );
if( value != null ) {
int topItemIndex = value.asInt();
table.setTopIndex( topItemIndex );
int scrollTop = topItemIndex * table.getItemHeight();
setScrollBarSelection( table.getVerticalBar(), scrollTop );
}
}
代码示例来源: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.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/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;
}
内容来源于网络,如有侵权,请联系作者删除!