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

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

本文整理了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

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

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

/**
 * Returns the Shell in which the PaintSurface resides.
 * @return the Shell
 */
public Shell getShell() {
  return paintCanvas.getShell();
}

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

void setOpenGLContext(Object value) {
  glcontext = (NSOpenGLContext)value;
  Shell shell = getShell ();
  if (glcontext != null) {
    shell.glContextCount++;
  } else {
    shell.glContextCount--;
  }
  shell.updateOpaque ();
}

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

void viewWillMoveToWindow(long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) {	
  super.viewWillMoveToWindow(id, sel, arg0);
  if (glcontext != null && id == view.id && arg0 != 0) {
    Widget newShell = display.getWidget(new NSWindow(arg0).contentView());
    if (newShell instanceof Shell) {
      ((Shell) newShell).glContextCount++;
      ((Shell) newShell).updateOpaque();
    }
    Shell shell = getShell();
    shell.glContextCount--;
    shell.updateOpaque();
  }
}

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

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

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

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

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

@Override
  public void imageDownloaded(Image image, String key, boolean returnedImmediately) {
    if (!returnedImmediately) {
      if (lblImage.isDisposed()) {
        return;
      }
      lblImage.setData("Image", image);
      Rectangle bounds = image.getBounds();
      GridData gridData = (GridData) lblImage.getLayoutData();
      gridData.heightHint = bounds.height + 10;
      gridData.widthHint = bounds.width + 16;
      lblImage.setLayoutData(gridData);
      lblImage.getShell().layout(new Control[] {
        lblImage
      });
      Point computeSize = shell.computeSize(600, SWT.DEFAULT, true);
      shell.setSize(computeSize);
    }
  }
});

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 * 
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control)widget).getShell();
  if (widget instanceof Caret)
    return ((Caret)widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource)widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget)widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu)widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar)widget).getParent().getShell();
            
  return null;	
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 *
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control) widget).getShell();
  if (widget instanceof Caret)
    return ((Caret) widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource) widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget) widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu) widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar) widget).getParent().getShell();
  return null;
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 * 
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control)widget).getShell();
  if (widget instanceof Caret)
    return ((Caret)widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource)widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget)widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu)widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar)widget).getParent().getShell();
            
  return null;    
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 * @param widget the widget
 *
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control)widget).getShell();
  if (widget instanceof Caret)
    return ((Caret)widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource)widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget)widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu)widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar)widget).getParent().getShell();
  return null;
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent a
 * SWT object that manage a shell, <code>null</code> is returned.
 * 
 * @param widget
 *            the widget
 * 
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control) widget).getShell();
  if (widget instanceof Caret)
    return ((Caret) widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource) widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget) widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu) widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar) widget).getParent().getShell();
  return null;
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 * @param widget the widget
 *
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control)widget).getShell();
  if (widget instanceof Caret)
    return ((Caret)widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource)widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget)widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu)widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar)widget).getParent().getShell();
  return null;
}

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

/**
   * Returns the shell for the given widget. If the widget doesn't represent
   * a SWT object that manage a shell, <code>null</code> is returned.
   *
   * @return the shell for the given widget
   */
  public static Shell getShell(Widget widget) {
    if (widget instanceof Control)
      return ((Control) widget).getShell();
    if (widget instanceof Caret)
      return ((Caret) widget).getParent().getShell();
    if (widget instanceof DragSource)
      return ((DragSource) widget).getControl().getShell();
    if (widget instanceof DropTarget)
      return ((DropTarget) widget).getControl().getShell();
    if (widget instanceof Menu)
      return ((Menu) widget).getParent().getShell();
    if (widget instanceof ScrollBar)
      return ((ScrollBar) widget).getParent().getShell();

    return null;
  }
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 *
 * @param widget The widget to get the shell for
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control)widget).getShell();
  if (widget instanceof Caret)
    return ((Caret)widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource)widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget)widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu)widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar)widget).getParent().getShell();
            
  return null;	
}

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

/**
 * Returns the shell for the given widget. If the widget doesn't represent
 * a SWT object that manage a shell, <code>null</code> is returned.
 *
 * @param widget The widget to get the shell for
 * @return the shell for the given widget
 */
public static Shell getShell(Widget widget) {
  if (widget instanceof Control)
    return ((Control)widget).getShell();
  if (widget instanceof Caret)
    return ((Caret)widget).getParent().getShell();
  if (widget instanceof DragSource)
    return ((DragSource)widget).getControl().getShell();
  if (widget instanceof DropTarget)
    return ((DropTarget)widget).getControl().getShell();
  if (widget instanceof Menu)
    return ((Menu)widget).getParent().getShell();
  if (widget instanceof ScrollBar)
    return ((ScrollBar)widget).getParent().getShell();
  return null;
}

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

/**
   * Returns the shell for the given widget. If the widget doesn't represent
   * a SWT object that manage a shell, <code>null</code> is returned.
   *
   * @return the shell for the given widget
   */
  public static Shell getShell(Widget widget) {
    if (widget instanceof Control)
      return ((Control) widget).getShell();
    if (widget instanceof Caret)
      return ((Caret) widget).getParent().getShell();
    if (widget instanceof DragSource)
      return ((DragSource) widget).getControl().getShell();
    if (widget instanceof DropTarget)
      return ((DropTarget) widget).getControl().getShell();
    if (widget instanceof Menu)
      return ((Menu) widget).getParent().getShell();
    if (widget instanceof ScrollBar)
      return ((ScrollBar) widget).getParent().getShell();

    return null;
  }
}

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

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

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

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

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

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

相关文章

Canvas类方法