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

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

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

Shell.getChildren介绍

暂无

代码示例

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

/**
 * Gets the table views.
 *
 * @param parentControl the parent control
 * @param tableViews    the table views
 * @return the table views
 */
private static final void getTableViews( Control parentControl, List<TableView> tableViews ) {
 if ( parentControl instanceof TableView ) {
  tableViews.add( (TableView) parentControl );
 } else {
  if ( parentControl instanceof Composite ) {
   Control[] children = ( (Composite) parentControl ).getChildren();
   for ( Control child : children ) {
    getTableViews( child, tableViews );
   }
  } else {
   if ( parentControl instanceof Shell ) {
    Control[] children = ( (Shell) parentControl ).getChildren();
    for ( Control child : children ) {
     getTableViews( child, tableViews );
    }
   }
  }
 }
}

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

@SuppressWarnings( "unused" )
private boolean traverseGroup( boolean next ) {
 // TODO [rh] fake implementation
 boolean result = false;
 if( getChildren().length > 0 ) {
  result = getChildren()[ 0 ].forceFocus();
 }
 return result;
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void setDragHostVisibility(boolean visible) {
  if (dragHost == null || dragHost.isDisposed())
    return;
  if (visible) {
    if (dragHost.getChildren().length > 0
        && dragHost.getChildren()[0] instanceof CTabFolder) {
      CTabFolder ctf = (CTabFolder) dragHost.getChildren()[0];
      dragCtrl.setParent(ctf);
      dragHost.setVisible(true);
    } else {
      dragCtrl.setParent(dragHost);
    }
  } else {
    dragHost.setVisible(false);
  }
}

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

public void setDragHostVisibility(boolean visible) {
  if (dragHost == null || dragHost.isDisposed()) {
    return;
  }
  if (visible) {
    if (dragHost.getChildren().length > 0
        && dragHost.getChildren()[0] instanceof CTabFolder) {
      CTabFolder ctf = (CTabFolder) dragHost.getChildren()[0];
      dragCtrl.setParent(ctf);
      dragHost.setVisible(true);
    } else {
      dragCtrl.setParent(dragHost);
    }
  } else {
    dragHost.setVisible(false);
  }
}

代码示例来源:origin: org.xworker/xworker_swt

@Override
public Control remove(Shell parent, Control control) {
  Thing parentThing = Designer.getThing(parent);
  Thing itemThing = Designer.getThing(control);                
  parentThing.removeChild(itemThing);
  parentThing.save();
  
  int index = -1;
  for(int i=0; i<parent.getChildren().length; i++){
    index++;
    if(parent.getChildren()[i] == control){
      break;
    }
  }
  control.dispose();        
  SwtUtils.layout(parent);
  
  if(index != -1){
    if(parent.getChildren().length > index){
      return parent.getChildren()[index];
    }else if(parent.getChildren().length > index - 1  && index != 0){
      return parent.getChildren()[index - 1];
    }else{
      return parent;
    }
  }else{
    return parent;
  }
}

代码示例来源:origin: org.xworker/xworker_swt

public ItemInfo getItemIndex(Shell parent, Control control){
  int index = -1;
  for(Control item : parent.getChildren()){
    index++;
    if(item == control){
      return new ItemInfo(index, Designer.getThing(item));
    }
  }
  
  return null;
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

@Override
public void track(DnDInfo info) {
  super.track(info);
  if (dropAgent != null && ds != null && !ds.isDisposed() && ds.getChildren().length == 0) {
    ds.dispose();
    ds = null;
  }
  if (dropAgent == null)
    attachToCursor(info);
  if (ds != null)
    ds.setLocation(info.cursorPos.x - 5, info.cursorPos.y - 5);
}

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

@Override
public void track(DnDInfo info) {
  super.track(info);
  if (dropAgent != null && ds != null && !ds.isDisposed() && ds.getChildren().length == 0) {
    ds.dispose();
    ds = null;
  }
  if (dropAgent == null) {
    attachToCursor(info);
  }
  if (ds != null) {
    ds.setLocation(info.cursorPos.x - 5, info.cursorPos.y - 5);
  }
}

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

@Override
public void setVisible( boolean visible ) {
 checkWidget();
 boolean wasVisible = getVisible();
 super.setVisible( visible );
 // Emulate OS behavior: in SWT, a layout is triggered during
 // Shell#setVisible(true)
 if( visible && !wasVisible && !isDisposed() ) {
  changed( getChildren() );
  layout( true, true );
 }
}

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

@Override
  public void shellClosed(ShellEvent e) {
      if (isDisposed) {
        return;
      }
      if (e.doit) {
        Shell s = (Shell)e.widget;
        ShellListener l = (ShellListener)s.getData(CLOSE_LISTENER);
        if (l != null) {
          s.setData(CLOSE_LISTENER, null);
          l.shellClosed(e);
          // The shell can 'cancel' the close by setting
          // the 'doit' to false...if so, do nothing
          if (e.doit) {
          for (Control control : s.getChildren()) {
              control.dispose();
            }
            availableShells.add(s);
            s.setVisible(false);
          }
          else {
            // Restore the listener
            s.setData(CLOSE_LISTENER, l);
          }
        }
      }
      e.doit = false;
   }
};

代码示例来源:origin: stackoverflow.com

for(Control c: shell.getChildren())

代码示例来源:origin: stackoverflow.com

String shellTitle = currentActiveShell.getText();
Control[] children = currentActiveShell.getChildren();
for (int i = 0; i < children.length; i++) {
  Control child = children[i];

代码示例来源:origin: stackoverflow.com

Listener listener = new Listener () {
  public void handleEvent (Event e) {
    Control [] children = shell.getChildren ();
    for (int i=0; i<children.length; i++) {
      Control child = children [i];

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

private void attach() {
  dragElement.getParent().getChildren().remove(dragElement);
  ((Shell) baseWindow.getWidget()).getDisplay().update();
  dragWindow = MBasicFactory.INSTANCE.createWindow();
  dragWindow.getTags().add(DragHostId);
  // define the initial location and size for the window
  Point cp = ((Shell) baseWindow.getWidget()).getDisplay()
      .getCursorLocation();
  Point size = new Point(200, 200);
  if (dragElement.getWidget() instanceof Control) {
    Control ctrl = (Control) dragElement.getWidget();
    size = ctrl.getSize();
  } else if (dragElement.getWidget() instanceof ToolItem) {
    ToolItem ti = (ToolItem) dragElement.getWidget();
    Rectangle bounds = ti.getBounds();
    size = new Point(bounds.width + 3, bounds.height + 3);
  }
  dragWindow.setX(cp.x + xOffset);
  dragWindow.setY(cp.y + yOffset);
  dragWindow.setWidth(size.x);
  dragWindow.setHeight(size.y);
  // add the window as a child of the base window
  baseWindow.getWindows().add(dragWindow);
  getShell().layout(getShell().getChildren(), SWT.CHANGED | SWT.DEFER);
  getShell().setVisible(true);
}

代码示例来源:origin: stefanhaustein/flowgrid

void setCurrentEditor(final ArtifactEditorFactory editorFactory, boolean mayHideTitle) {
  for(Control control: shell.getChildren()) {
    control.dispose();

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

private void attach() {
  dragElement.getParent().getChildren().remove(dragElement);
  ((Shell) baseWindow.getWidget()).getDisplay().update();
  dragWindow = MBasicFactory.INSTANCE.createWindow();
  dragWindow.getTags().add(DragHostId);
  formatModel(dragWindow);
  // define the initial location and size for the window
  Point cp = ((Shell) baseWindow.getWidget()).getDisplay()
      .getCursorLocation();
  Point size = new Point(200, 200);
  if (dragElement.getWidget() instanceof Control) {
    Control ctrl = (Control) dragElement.getWidget();
    size = ctrl.getSize();
  } else if (dragElement.getWidget() instanceof ToolItem) {
    ToolItem ti = (ToolItem) dragElement.getWidget();
    Rectangle bounds = ti.getBounds();
    size = new Point(bounds.width + 3, bounds.height + 3);
  }
  dragWindow.setX(cp.x + xOffset);
  dragWindow.setY(cp.y + yOffset);
  dragWindow.setWidth(size.x);
  dragWindow.setHeight(size.y);
  // add the window as a child of the base window
  baseWindow.getWindows().add(dragWindow);
  getShell().layout(getShell().getChildren(), SWT.CHANGED | SWT.DEFER);
  getShell().setVisible(true);
}

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

for (int i = 0; i < shell.getChildren().length; i++) {
  processChildren(shell.getChildren()[i], buffer);

代码示例来源:origin: org.xworker/xworker_swt

public static Object update(ActionContext actionContext){
  Thing self = actionContext.getObject("self");
  Shell shell = actionContext.getObject("shell");
  for(Control control : shell.getChildren()){
    control.dispose();

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

Control[] children = shell.getChildren();
for (Control control : children) {
  SWTSkinObject so = (SWTSkinObject) control.getData("SkinObject");

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

if (shell.getChildren()[0] != detailArea) {
  shell.setLocation(shell.getLocation().x, originalShellLocation.y
      - detailArea.getSize().y - 3);

相关文章

微信公众号

最新文章

更多

Shell类方法