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

x33g5p2x  于2022-01-30 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(145)

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

ScrollBar.getParent介绍

[英]Returns the receiver's parent, which must be a Scrollable.
[中]返回接收者的父项,该父项必须是可滚动的。

代码示例

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

void handleScroll(Event event) {
  ScrollBar scrollBar = (ScrollBar)event.widget;
  Control scrollableParent = scrollBar.getParent();
  if (scrollableParent.equals(list)) return;
  if (isParentScrolling(scrollableParent)) dropDown(false);
}
/**

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

void handleScroll(Event event) {
  ScrollBar scrollBar = (ScrollBar)event.widget;
  Control scrollableParent = scrollBar.getParent();
  if (scrollableParent.equals(list)) return;
  if (isParentScrolling(scrollableParent)) dropDown(false);
}
/**

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

void handleScroll(Event event) {
  ScrollBar scrollBar = (ScrollBar)event.widget;
  Control scrollableParent = scrollBar.getParent();
  if (scrollableParent.equals(list)) return;
  if (isParentScrolling(scrollableParent)) dropDown(false);
}
/**

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

void handleScroll(Event event) {
  ScrollBar scrollBar = (ScrollBar)event.widget;
  Control scrollableParent = scrollBar.getParent();
  if (scrollableParent.equals(list)) return;
  if (isParentScrolling(scrollableParent)) dropDown(false);
}
/**

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

void handleScroll(Event event) {
  ScrollBar scrollBar = (ScrollBar)event.widget;
  Control scrollableParent = scrollBar.getParent();
  if (scrollableParent.equals(list)) return;
  if (isParentScrolling(scrollableParent)) dropDown(false);
}
/**

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

private static void handleScrollBars( Widget root, WidgetTreeVisitor visitor ) {
 if( root instanceof Scrollable ) {
  Scrollable scrollable = ( Scrollable )root;
  ScrollBar horizontalBar = scrollable.getHorizontalBar();
  if( horizontalBar != null && horizontalBar.getParent() == scrollable ) {
   accept( horizontalBar, visitor );
  }
  ScrollBar verticalBar = scrollable.getVerticalBar();
  if( verticalBar != null && verticalBar.getParent() == scrollable ) {
   accept( verticalBar, visitor );
  }
 }
}

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

/**
 * Returns <code>true</code> if the receiver is visible and all
 * of the receiver's ancestors are visible and <code>false</code>
 * otherwise.
 *
 * @return the receiver's visibility state
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see #getVisible
 */
public boolean isVisible () {
  checkWidget ();
  return getVisible () && getParent ().isVisible ();
}

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

/**
 * Returns <code>true</code> if the receiver is visible and all
 * of the receiver's ancestors are visible and <code>false</code>
 * otherwise.
 *
 * @return the receiver's visibility state
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see #getVisible
 */
public boolean isVisible () {
  checkWidget ();
  return getVisible () && getParent ().isVisible ();
}

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

/**
 * Returns <code>true</code> if the receiver is enabled and all
 * of the receiver's ancestors are enabled, and <code>false</code>
 * otherwise. A disabled control is typically not selectable from the
 * user interface and draws with an inactive or "grayed" look.
 *
 * @return the receiver's enabled state
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see #getEnabled
 */
public boolean isEnabled () {
  checkWidget ();
  return getEnabled () && getParent ().getEnabled ();
}

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

/**
 * Returns <code>true</code> if the receiver is enabled and all
 * of the receiver's ancestors are enabled, and <code>false</code>
 * otherwise. A disabled control is typically not selectable from the
 * user interface and draws with an inactive or "grayed" look.
 *
 * @return the receiver's enabled state
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see #getEnabled
 */
public boolean isEnabled () {
  checkWidget ();
  return getEnabled () && getParent ().getEnabled ();
}

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

/**
 * Returns <code>true</code> if the receiver is enabled and all
 * of the receiver's ancestors are enabled, and <code>false</code>
 * otherwise. A disabled control is typically not selectable from the
 * user interface and draws with an inactive or "grayed" look.
 *
 * @return the receiver's enabled state
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see #getEnabled
 */
public boolean isEnabled () {
  checkWidget ();
  return getEnabled () && getParent ().getEnabled ();
}

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

/**
 * Returns <code>true</code> if the receiver is visible and all
 * of the receiver's ancestors are visible and <code>false</code>
 * otherwise.
 *
 * @return the receiver's visibility state
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see #getVisible
 */
public boolean isVisible () {
  checkWidget ();
  return getVisible () && getParent ().isVisible ();
}

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

@Override
public void renderInitialization( ScrollBar scrollBar ) throws IOException {
 RemoteObject remoteObject = createRemoteObject( scrollBar, TYPE );
 remoteObject.setHandler( new ScrollBarOperationHandler( scrollBar ) );
 remoteObject.set( "parent", getId( scrollBar.getParent() ) );
 remoteObject.set( "style", createJsonArray( getStyles( scrollBar, ALLOWED_STYLES ) ) );
}

代码示例来源: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: 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: 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.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;
  }
}

相关文章