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

x33g5p2x  于2022-01-18 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(208)

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

Canvas.getShell介绍

暂无

代码示例

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

  1. DeviceData info = display.getDeviceData();
  2. if ( !info.tracking ) {
  3. Shell shell = canvas.getShell();
  4. MessageBox dialog = new MessageBox( shell, SWT.ICON_WARNING | SWT.OK );
  5. dialog.setText( shell.getText() );

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

  1. /**
  2. * Returns the Shell in which the PaintSurface resides.
  3. * @return the Shell
  4. */
  5. public Shell getShell() {
  6. return paintCanvas.getShell();
  7. }

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

  1. void setOpenGLContext(Object value) {
  2. glcontext = (NSOpenGLContext)value;
  3. Shell shell = getShell ();
  4. if (glcontext != null) {
  5. shell.glContextCount++;
  6. } else {
  7. shell.glContextCount--;
  8. }
  9. shell.updateOpaque ();
  10. }

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

  1. void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {
  2. super.viewWillMoveToWindow(id, sel, arg0);
  3. if (glcontext != null && id == view.id && arg0 != 0) {
  4. Widget newShell = display.getWidget(new NSWindow(arg0).contentView());
  5. if (newShell instanceof Shell) {
  6. ((Shell) newShell).glContextCount++;
  7. ((Shell) newShell).updateOpaque();
  8. }
  9. Shell shell = getShell();
  10. shell.glContextCount--;
  11. shell.updateOpaque();
  12. }
  13. }

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

  1. fileInfoCanvas.addListener(SWT.KeyDown, doNothingListener);
  2. final Menu menu = new Menu(fileInfoCanvas.getShell(), SWT.POP_UP );

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  1. final boolean isRTL= (resizer.getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
  2. resizer.setCursor(resizer.getDisplay().getSystemCursor(isRTL ? SWT.CURSOR_SIZESW : SWT.CURSOR_SIZESE));
  3. MouseAdapter resizeSupport= new MouseAdapter() {

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

  1. @Override
  2. public void imageDownloaded(Image image, String key, boolean returnedImmediately) {
  3. if (!returnedImmediately) {
  4. if (lblImage.isDisposed()) {
  5. return;
  6. }
  7. lblImage.setData("Image", image);
  8. Rectangle bounds = image.getBounds();
  9. GridData gridData = (GridData) lblImage.getLayoutData();
  10. gridData.heightHint = bounds.height + 10;
  11. gridData.widthHint = bounds.width + 16;
  12. lblImage.setLayoutData(gridData);
  13. lblImage.getShell().layout(new Control[] {
  14. lblImage
  15. });
  16. Point computeSize = shell.computeSize(600, SWT.DEFAULT, true);
  17. shell.setSize(computeSize);
  18. }
  19. }
  20. });

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @return the shell for the given widget
  6. */
  7. public static Shell getShell(Widget widget) {
  8. if (widget instanceof Control)
  9. return ((Control)widget).getShell();
  10. if (widget instanceof Caret)
  11. return ((Caret)widget).getParent().getShell();
  12. if (widget instanceof DragSource)
  13. return ((DragSource)widget).getControl().getShell();
  14. if (widget instanceof DropTarget)
  15. return ((DropTarget)widget).getControl().getShell();
  16. if (widget instanceof Menu)
  17. return ((Menu)widget).getParent().getShell();
  18. if (widget instanceof ScrollBar)
  19. return ((ScrollBar)widget).getParent().getShell();
  20. return null;
  21. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @return the shell for the given widget
  6. */
  7. public static Shell getShell(Widget widget) {
  8. if (widget instanceof Control)
  9. return ((Control) widget).getShell();
  10. if (widget instanceof Caret)
  11. return ((Caret) widget).getParent().getShell();
  12. if (widget instanceof DragSource)
  13. return ((DragSource) widget).getControl().getShell();
  14. if (widget instanceof DropTarget)
  15. return ((DropTarget) widget).getControl().getShell();
  16. if (widget instanceof Menu)
  17. return ((Menu) widget).getParent().getShell();
  18. if (widget instanceof ScrollBar)
  19. return ((ScrollBar) widget).getParent().getShell();
  20. return null;
  21. }

代码示例来源:origin: oyse/yedit

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @return the shell for the given widget
  6. */
  7. public static Shell getShell(Widget widget) {
  8. if (widget instanceof Control)
  9. return ((Control)widget).getShell();
  10. if (widget instanceof Caret)
  11. return ((Caret)widget).getParent().getShell();
  12. if (widget instanceof DragSource)
  13. return ((DragSource)widget).getControl().getShell();
  14. if (widget instanceof DropTarget)
  15. return ((DropTarget)widget).getControl().getShell();
  16. if (widget instanceof Menu)
  17. return ((Menu)widget).getParent().getShell();
  18. if (widget instanceof ScrollBar)
  19. return ((ScrollBar)widget).getParent().getShell();
  20. return null;
  21. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. * @param widget the widget
  5. *
  6. * @return the shell for the given widget
  7. */
  8. public static Shell getShell(Widget widget) {
  9. if (widget instanceof Control)
  10. return ((Control)widget).getShell();
  11. if (widget instanceof Caret)
  12. return ((Caret)widget).getParent().getShell();
  13. if (widget instanceof DragSource)
  14. return ((DragSource)widget).getControl().getShell();
  15. if (widget instanceof DropTarget)
  16. return ((DropTarget)widget).getControl().getShell();
  17. if (widget instanceof Menu)
  18. return ((Menu)widget).getParent().getShell();
  19. if (widget instanceof ScrollBar)
  20. return ((ScrollBar)widget).getParent().getShell();
  21. return null;
  22. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent a
  3. * SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @param widget
  6. * the widget
  7. *
  8. * @return the shell for the given widget
  9. */
  10. public static Shell getShell(Widget widget) {
  11. if (widget instanceof Control)
  12. return ((Control) widget).getShell();
  13. if (widget instanceof Caret)
  14. return ((Caret) widget).getParent().getShell();
  15. if (widget instanceof DragSource)
  16. return ((DragSource) widget).getControl().getShell();
  17. if (widget instanceof DropTarget)
  18. return ((DropTarget) widget).getControl().getShell();
  19. if (widget instanceof Menu)
  20. return ((Menu) widget).getParent().getShell();
  21. if (widget instanceof ScrollBar)
  22. return ((ScrollBar) widget).getParent().getShell();
  23. return null;
  24. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. * @param widget the widget
  5. *
  6. * @return the shell for the given widget
  7. */
  8. public static Shell getShell(Widget widget) {
  9. if (widget instanceof Control)
  10. return ((Control)widget).getShell();
  11. if (widget instanceof Caret)
  12. return ((Caret)widget).getParent().getShell();
  13. if (widget instanceof DragSource)
  14. return ((DragSource)widget).getControl().getShell();
  15. if (widget instanceof DropTarget)
  16. return ((DropTarget)widget).getControl().getShell();
  17. if (widget instanceof Menu)
  18. return ((Menu)widget).getParent().getShell();
  19. if (widget instanceof ScrollBar)
  20. return ((ScrollBar)widget).getParent().getShell();
  21. return null;
  22. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @return the shell for the given widget
  6. */
  7. public static Shell getShell(Widget widget) {
  8. if (widget instanceof Control)
  9. return ((Control) widget).getShell();
  10. if (widget instanceof Caret)
  11. return ((Caret) widget).getParent().getShell();
  12. if (widget instanceof DragSource)
  13. return ((DragSource) widget).getControl().getShell();
  14. if (widget instanceof DropTarget)
  15. return ((DropTarget) widget).getControl().getShell();
  16. if (widget instanceof Menu)
  17. return ((Menu) widget).getParent().getShell();
  18. if (widget instanceof ScrollBar)
  19. return ((ScrollBar) widget).getParent().getShell();
  20. return null;
  21. }
  22. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @param widget The widget to get the shell for
  6. * @return the shell for the given widget
  7. */
  8. public static Shell getShell(Widget widget) {
  9. if (widget instanceof Control)
  10. return ((Control)widget).getShell();
  11. if (widget instanceof Caret)
  12. return ((Caret)widget).getParent().getShell();
  13. if (widget instanceof DragSource)
  14. return ((DragSource)widget).getControl().getShell();
  15. if (widget instanceof DropTarget)
  16. return ((DropTarget)widget).getControl().getShell();
  17. if (widget instanceof Menu)
  18. return ((Menu)widget).getParent().getShell();
  19. if (widget instanceof ScrollBar)
  20. return ((ScrollBar)widget).getParent().getShell();
  21. return null;
  22. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @param widget The widget to get the shell for
  6. * @return the shell for the given widget
  7. */
  8. public static Shell getShell(Widget widget) {
  9. if (widget instanceof Control)
  10. return ((Control)widget).getShell();
  11. if (widget instanceof Caret)
  12. return ((Caret)widget).getParent().getShell();
  13. if (widget instanceof DragSource)
  14. return ((DragSource)widget).getControl().getShell();
  15. if (widget instanceof DropTarget)
  16. return ((DropTarget)widget).getControl().getShell();
  17. if (widget instanceof Menu)
  18. return ((Menu)widget).getParent().getShell();
  19. if (widget instanceof ScrollBar)
  20. return ((ScrollBar)widget).getParent().getShell();
  21. return null;
  22. }

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

  1. /**
  2. * Returns the shell for the given widget. If the widget doesn't represent
  3. * a SWT object that manage a shell, <code>null</code> is returned.
  4. *
  5. * @return the shell for the given widget
  6. */
  7. public static Shell getShell(Widget widget) {
  8. if (widget instanceof Control)
  9. return ((Control) widget).getShell();
  10. if (widget instanceof Caret)
  11. return ((Caret) widget).getParent().getShell();
  12. if (widget instanceof DragSource)
  13. return ((DragSource) widget).getControl().getShell();
  14. if (widget instanceof DropTarget)
  15. return ((DropTarget) widget).getControl().getShell();
  16. if (widget instanceof Menu)
  17. return ((Menu) widget).getParent().getShell();
  18. if (widget instanceof ScrollBar)
  19. return ((ScrollBar) widget).getParent().getShell();
  20. return null;
  21. }
  22. }

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

  1. if (isDisposed ()) return false;
  2. if (text.length () == 0) {
  3. Shell s = parent.getShell ();
  4. s.keyInputHappened = true;
  5. startOffset = -1;

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

  1. final boolean isRTL= (resizer.getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
  2. resizer.setCursor(resizer.getDisplay().getSystemCursor(isRTL ? SWT.CURSOR_SIZESW : SWT.CURSOR_SIZESE));
  3. MouseAdapter resizeSupport= new MouseAdapter() {

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

  1. Rectangle sourceRect = new Rectangle (x, y, width, height);
  2. if (sourceRect.intersects (clientRect)) {
  3. getShell().setScrolling();
  4. update (all);

相关文章

Canvas类方法