本文整理了Java中org.eclipse.swt.widgets.Table.toControl()
方法的一些代码示例,展示了Table.toControl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.toControl()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:toControl
暂无
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
private File getTargetFile(DropTargetEvent event) {
// Determine the target File for the drop
TableItem item = table.getItem(table.toControl(new Point(event.x, event.y)));
File targetFile = null;
if (item == null) {
// We are over an unoccupied area of the table.
// If it is a COPY, we can use the table's root file.
if (event.detail == DND.DROP_COPY) {
targetFile = (File) table.getData(TABLEDATA_DIR);
}
} else {
// We are over a particular item in the table, use the item's file
targetFile = (File) item.getData(TABLEITEMDATA_FILE);
}
return targetFile;
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
protected void specialPopupMenuItems(Menu menu, Event event) {
MenuItem item = new MenuItem(menu, SWT.PUSH);
item.setText("getItem(Point) on mouse coordinates");
menuMouseCoords = table1.toControl(new Point(event.x, event.y));
item.addSelectionListener(widgetSelectedAdapter(e -> {
eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + table1.getItem(menuMouseCoords));
eventConsole.append ("\n");
}));
}
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = table.toControl(coordinates);
TableItem item = table.getItem(coordinates);
if (item != null) return item;
Rectangle area = table.getClientArea();
int tableBottom = area.y + area.height;
int itemCount = table.getItemCount();
for (int i=table.getTopIndex(); i<itemCount; i++) {
item = table.getItem(i);
Rectangle rect = item.getBounds();
rect.x = area.x;
rect.width = area.width;
if (rect.contains(coordinates)) return item;
if (rect.y > tableBottom) break;
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = table.toControl(coordinates);
TableItem item = table.getItem(coordinates);
if (item != null) return item;
Rectangle area = table.getClientArea();
int tableBottom = area.y + area.height;
int itemCount = table.getItemCount();
for (int i=table.getTopIndex(); i<itemCount; i++) {
item = table.getItem(i);
Rectangle rect = item.getBounds();
rect.x = area.x;
rect.width = area.width;
if (rect.contains(coordinates)) return item;
if (rect.y > tableBottom) break;
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = table.toControl(coordinates);
TableItem item = table.getItem(coordinates);
if (item != null) return item;
Rectangle area = table.getClientArea();
int tableBottom = area.y + area.height;
int itemCount = table.getItemCount();
for (int i=table.getTopIndex(); i<itemCount; i++) {
item = table.getItem(i);
Rectangle rect = item.getBounds();
rect.x = area.x;
rect.width = area.width;
if (rect.contains(coordinates)) return item;
if (rect.y > tableBottom) break;
}
return null;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = table.toControl(coordinates);
TableItem item = table.getItem(coordinates);
if (item != null) return item;
Rectangle area = table.getClientArea();
int tableBottom = area.y + area.height;
int itemCount = table.getItemCount();
for (int i=table.getTopIndex(); i<itemCount; i++) {
item = table.getItem(i);
Rectangle rect = item.getBounds();
rect.x = area.x;
rect.width = area.width;
if (rect.contains(coordinates)) return item;
if (rect.y > tableBottom) break;
}
return null;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = table.toControl(coordinates);
TableItem item = table.getItem(coordinates);
if (item != null) return item;
Rectangle area = table.getClientArea();
int tableBottom = area.y + area.height;
int itemCount = table.getItemCount();
for (int i=table.getTopIndex(); i<itemCount; i++) {
item = table.getItem(i);
Rectangle rect = item.getBounds();
rect.x = area.x;
rect.width = area.width;
if (rect.contains(coordinates)) return item;
if (rect.y > tableBottom) break;
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = table.toControl(coordinates);
TableItem item = table.getItem(coordinates);
if (item != null) return item;
Rectangle area = table.getClientArea();
int tableBottom = area.y + area.height;
int itemCount = table.getItemCount();
for (int i=table.getTopIndex(); i<itemCount; i++) {
item = table.getItem(i);
Rectangle rect = item.getBounds();
rect.x = area.x;
rect.width = area.width;
if (rect.contains(coordinates)) return item;
if (rect.y > tableBottom) break;
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
Point cursorLocation = table.getDisplay().getCursorLocation();
Point result = findBestLocation(getIncludedPositions(rectangles,
clientArea), table.toControl(cursorLocation));
if (result != null) {
result.x = result.x + iBounds.width + getAvarageCharWith(table)
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
Point cursorLocation= table.getDisplay().getCursorLocation();
Point result= findBestLocation(getIncludedPositions(rectangles, clientArea),
table.toControl(cursorLocation));
if (result != null)
result.x= result.x + iBounds.width + getAvarageCharWith(table) * CHAR_INDENT;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
int effect = checkEffect(event.feedback);
Point coordinates = new Point(event.x, event.y);
coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates));
int /*long*/ [] path = new int /*long*/ [1];
OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, path, null, null, null);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
int effect = checkEffect(event.feedback);
Point coordinates = new Point(event.x, event.y);
coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates));
long /*int*/ [] path = new long /*int*/ [1];
OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, path, null, null, null);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
int effect = checkEffect(event.feedback);
Point coordinates = new Point(event.x, event.y);
coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates));
int /*long*/ [] path = new int /*long*/ [1];
OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, path, null, null, null);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
int /*long*/ handle = table.handle;
Point coordinates = new Point(event.x, event.y);
coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates)); // To Pixels
LVHITTESTINFO pinfo = new LVHITTESTINFO();
pinfo.x = coordinates.x;
代码示例来源:origin: org.eclipse/org.eclipse.wst.common.ui
Point point = table.toControl(new Point(event.x, event.y));
Rectangle bounds = table.getClientArea();
if (table.getHeaderVisible())
内容来源于网络,如有侵权,请联系作者删除!