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

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

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

Table.toControl介绍

暂无

代码示例

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

  1. private File getTargetFile(DropTargetEvent event) {
  2. // Determine the target File for the drop
  3. TableItem item = table.getItem(table.toControl(new Point(event.x, event.y)));
  4. File targetFile = null;
  5. if (item == null) {
  6. // We are over an unoccupied area of the table.
  7. // If it is a COPY, we can use the table's root file.
  8. if (event.detail == DND.DROP_COPY) {
  9. targetFile = (File) table.getData(TABLEDATA_DIR);
  10. }
  11. } else {
  12. // We are over a particular item in the table, use the item's file
  13. targetFile = (File) item.getData(TABLEITEMDATA_FILE);
  14. }
  15. return targetFile;
  16. }
  17. });

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

  1. @Override
  2. protected void specialPopupMenuItems(Menu menu, Event event) {
  3. MenuItem item = new MenuItem(menu, SWT.PUSH);
  4. item.setText("getItem(Point) on mouse coordinates");
  5. menuMouseCoords = table1.toControl(new Point(event.x, event.y));
  6. item.addSelectionListener(widgetSelectedAdapter(e -> {
  7. eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + table1.getItem(menuMouseCoords));
  8. eventConsole.append ("\n");
  9. }));
  10. }
  11. }

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. Widget getItem(Table table, int x, int y) {
  2. Point coordinates = new Point(x, y);
  3. coordinates = table.toControl(coordinates);
  4. TableItem item = table.getItem(coordinates);
  5. if (item != null) return item;
  6. Rectangle area = table.getClientArea();
  7. int tableBottom = area.y + area.height;
  8. int itemCount = table.getItemCount();
  9. for (int i=table.getTopIndex(); i<itemCount; i++) {
  10. item = table.getItem(i);
  11. Rectangle rect = item.getBounds();
  12. rect.x = area.x;
  13. rect.width = area.width;
  14. if (rect.contains(coordinates)) return item;
  15. if (rect.y > tableBottom) break;
  16. }
  17. return null;
  18. }

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

  1. Widget getItem(Table table, int x, int y) {
  2. Point coordinates = new Point(x, y);
  3. coordinates = table.toControl(coordinates);
  4. TableItem item = table.getItem(coordinates);
  5. if (item != null) return item;
  6. Rectangle area = table.getClientArea();
  7. int tableBottom = area.y + area.height;
  8. int itemCount = table.getItemCount();
  9. for (int i=table.getTopIndex(); i<itemCount; i++) {
  10. item = table.getItem(i);
  11. Rectangle rect = item.getBounds();
  12. rect.x = area.x;
  13. rect.width = area.width;
  14. if (rect.contains(coordinates)) return item;
  15. if (rect.y > tableBottom) break;
  16. }
  17. return null;
  18. }

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

  1. Widget getItem(Table table, int x, int y) {
  2. Point coordinates = new Point(x, y);
  3. coordinates = table.toControl(coordinates);
  4. TableItem item = table.getItem(coordinates);
  5. if (item != null) return item;
  6. Rectangle area = table.getClientArea();
  7. int tableBottom = area.y + area.height;
  8. int itemCount = table.getItemCount();
  9. for (int i=table.getTopIndex(); i<itemCount; i++) {
  10. item = table.getItem(i);
  11. Rectangle rect = item.getBounds();
  12. rect.x = area.x;
  13. rect.width = area.width;
  14. if (rect.contains(coordinates)) return item;
  15. if (rect.y > tableBottom) break;
  16. }
  17. return null;
  18. }

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

  1. Widget getItem(Table table, int x, int y) {
  2. Point coordinates = new Point(x, y);
  3. coordinates = table.toControl(coordinates);
  4. TableItem item = table.getItem(coordinates);
  5. if (item != null) return item;
  6. Rectangle area = table.getClientArea();
  7. int tableBottom = area.y + area.height;
  8. int itemCount = table.getItemCount();
  9. for (int i=table.getTopIndex(); i<itemCount; i++) {
  10. item = table.getItem(i);
  11. Rectangle rect = item.getBounds();
  12. rect.x = area.x;
  13. rect.width = area.width;
  14. if (rect.contains(coordinates)) return item;
  15. if (rect.y > tableBottom) break;
  16. }
  17. return null;
  18. }

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

  1. Widget getItem(Table table, int x, int y) {
  2. Point coordinates = new Point(x, y);
  3. coordinates = table.toControl(coordinates);
  4. TableItem item = table.getItem(coordinates);
  5. if (item != null) return item;
  6. Rectangle area = table.getClientArea();
  7. int tableBottom = area.y + area.height;
  8. int itemCount = table.getItemCount();
  9. for (int i=table.getTopIndex(); i<itemCount; i++) {
  10. item = table.getItem(i);
  11. Rectangle rect = item.getBounds();
  12. rect.x = area.x;
  13. rect.width = area.width;
  14. if (rect.contains(coordinates)) return item;
  15. if (rect.y > tableBottom) break;
  16. }
  17. return null;
  18. }

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

  1. Widget getItem(Table table, int x, int y) {
  2. Point coordinates = new Point(x, y);
  3. coordinates = table.toControl(coordinates);
  4. TableItem item = table.getItem(coordinates);
  5. if (item != null) return item;
  6. Rectangle area = table.getClientArea();
  7. int tableBottom = area.y + area.height;
  8. int itemCount = table.getItemCount();
  9. for (int i=table.getTopIndex(); i<itemCount; i++) {
  10. item = table.getItem(i);
  11. Rectangle rect = item.getBounds();
  12. rect.x = area.x;
  13. rect.width = area.width;
  14. if (rect.contains(coordinates)) return item;
  15. if (rect.y > tableBottom) break;
  16. }
  17. return null;
  18. }

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

  1. Point cursorLocation = table.getDisplay().getCursorLocation();
  2. Point result = findBestLocation(getIncludedPositions(rectangles,
  3. clientArea), table.toControl(cursorLocation));
  4. if (result != null) {
  5. result.x = result.x + iBounds.width + getAvarageCharWith(table)

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

  1. Point cursorLocation= table.getDisplay().getCursorLocation();
  2. Point result= findBestLocation(getIncludedPositions(rectangles, clientArea),
  3. table.toControl(cursorLocation));
  4. if (result != null)
  5. result.x= result.x + iBounds.width + getAvarageCharWith(table) * CHAR_INDENT;

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

  1. int effect = checkEffect(event.feedback);
  2. Point coordinates = new Point(event.x, event.y);
  3. coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates));
  4. int /*long*/ [] path = new int /*long*/ [1];
  5. 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

  1. int effect = checkEffect(event.feedback);
  2. Point coordinates = new Point(event.x, event.y);
  3. coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates));
  4. long /*int*/ [] path = new long /*int*/ [1];
  5. 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

  1. int effect = checkEffect(event.feedback);
  2. Point coordinates = new Point(event.x, event.y);
  3. coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates));
  4. int /*long*/ [] path = new int /*long*/ [1];
  5. 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

  1. int /*long*/ handle = table.handle;
  2. Point coordinates = new Point(event.x, event.y);
  3. coordinates = DPIUtil.autoScaleUp(table.toControl(coordinates)); // To Pixels
  4. LVHITTESTINFO pinfo = new LVHITTESTINFO();
  5. pinfo.x = coordinates.x;

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

  1. Point point = table.toControl(new Point(event.x, event.y));
  2. Rectangle bounds = table.getClientArea();
  3. if (table.getHeaderVisible())

相关文章

Table类方法