本文整理了Java中org.eclipse.swt.widgets.List.getClientArea()
方法的一些代码示例,展示了List.getClientArea()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.getClientArea()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.List
类名称:List
方法名:getClientArea
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
boolean needsHScrollBar() {
boolean result = false;
if( ( style & SWT.H_SCROLL ) != 0 ) {
int availableWidth = getClientArea().width;
int width = getMaxItemWidth();
result = width > availableWidth;
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
boolean needsVScrollBar() {
int availableHeight = getClientArea().height;
int height = getItemCount() * getItemHeight();
return height > availableHeight;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
Point getItemDimensions() {
int width = 0;
int height = 0;
if( getItemCount() > 0 ) {
int availableWidth = getClientArea().width;
if( ( style & SWT.H_SCROLL ) == 0 && isMarkupEnabledFor( this ) ) {
width = availableWidth;
} else {
width = Math.max( getMaxItemWidth(), availableWidth );
}
height = getItemHeight();
}
return new Point( width, height );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
public void reveal(Object element) {
Assert.isNotNull(element);
int index = getElementIndex(element);
if (index == -1) {
return;
}
// algorithm patterned after List.showSelection()
int count = list.getItemCount();
if (count == 0) {
return;
}
int height = list.getItemHeight();
Rectangle rect = list.getClientArea();
int topIndex = list.getTopIndex();
int visibleCount = Math.max(rect.height / height, 1);
int bottomIndex = Math.min(topIndex + visibleCount, count) - 1;
if ((topIndex <= index) && (index <= bottomIndex)) {
return;
}
int newTop = Math.min(Math.max(index - (visibleCount / 2), 0),
count - 1);
list.setTopIndex(newTop);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
public void reveal(Object element) {
Assert.isNotNull(element);
int index = getElementIndex(element);
if (index == -1) {
return;
}
// algorithm patterned after List.showSelection()
int count = list.getItemCount();
if (count == 0) {
return;
}
int height = list.getItemHeight();
Rectangle rect = list.getClientArea();
int topIndex = list.getTopIndex();
int visibleCount = Math.max(rect.height / height, 1);
int bottomIndex = Math.min(topIndex + visibleCount, count) - 1;
if ((topIndex <= index) && (index <= bottomIndex)) {
return;
}
int newTop = Math.min(Math.max(index - (visibleCount / 2), 0),
count - 1);
list.setTopIndex(newTop);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
public void reveal(Object element) {
Assert.isNotNull(element);
int index = getElementIndex(element);
if (index == -1) {
return;
}
// algorithm patterned after List.showSelection()
int count = list.getItemCount();
if (count == 0) {
return;
}
int height = list.getItemHeight();
Rectangle rect = list.getClientArea();
int topIndex = list.getTopIndex();
int visibleCount = Math.max(rect.height / height, 1);
int bottomIndex = Math.min(topIndex + visibleCount, count) - 1;
if ((topIndex <= index) && (index <= bottomIndex)) {
return;
}
int newTop = Math.min(Math.max(index - (visibleCount / 2), 0),
count - 1);
list.setTopIndex(newTop);
}
内容来源于网络,如有侵权,请联系作者删除!