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

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

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

Shell.layout介绍

暂无

代码示例

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

public String open() {
 shell.layout();
 shell.open();
 // Detect X or ALT-F4 or something that kills this window...
 shell.addShellListener( new ShellAdapter() {
  public void shellClosed( ShellEvent e ) {
   cancel();
  }
 } );
 while ( !shell.isDisposed() ) {
  if ( !shell.getDisplay().readAndDispatch() ) {
   shell.getDisplay().sleep();
  }
 }
 return formula;
}

代码示例来源:origin: caoxinyu/RedisClient

/**
 * Open the window.
 * 
 */
public void open() {
  Display display = null;
  display = Display.getDefault();
  createContents();
  shell.open();
  shell.layout();
  while (!shell.isDisposed()) {
    try {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    } catch (Exception e) {
      MessageDialog.openError(shell,
          i18nFile.getText(I18nFile.ERROR),
          e.getLocalizedMessage());
      e.printStackTrace();
    }
  }
  display.dispose();
}

代码示例来源:origin: caoxinyu/RedisClient

/**
 * Open the dialog.
 * @return the result
 */
public Object open() {
  shell = new Shell(getParent(), getStyle());
  shell.setImage(image);
  
  createContents();
  shell.open();
  shell.layout();
  Display display = getParent().getDisplay();
  while (!shell.isDisposed()) {
    try {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    } catch (Exception e) {
      MessageDialog.openError(shell, RedisClient.i18nFile.getText(I18nFile.ERROR), e.getLocalizedMessage());
    }
  }
  return result;
}

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

data.exclude = b.getSelection();
bHidden.setVisible(!data.exclude);
shell.layout(false);

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

shell.layout();
shell.pack( true );
shell.open();

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

shell.layout();
if ( !scroll ) {
 shell.pack( true );

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

shell.layout();

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

public static void setSize( Shell shell, int minWidth, int minHeight, boolean packIt ) {
 PropsUI props = PropsUI.getInstance();
 WindowProperty winprop = props.getScreen( shell.getText() );
 if ( winprop != null ) {
  winprop.setShell( shell, minWidth, minHeight );
 } else {
  if ( packIt ) {
   shell.pack();
  } else {
   shell.layout();
  }
  // OK, sometimes this produces dialogs that are waay too big.
  // Try to limit this a bit, m'kay?
  // Use the same algorithm by cheating :-)
  //
  winprop = new WindowProperty( shell );
  winprop.setShell( shell, minWidth, minHeight );
  // Now, as this is the first time it gets opened, try to put it in the middle of the screen...
  Rectangle shellBounds = shell.getBounds();
  Monitor monitor = shell.getDisplay().getPrimaryMonitor();
  if ( shell.getParent() != null ) {
   monitor = shell.getParent().getMonitor();
  }
  Rectangle monitorClientArea = monitor.getClientArea();
  int middleX = monitorClientArea.x + ( monitorClientArea.width - shellBounds.width ) / 2;
  int middleY = monitorClientArea.y + ( monitorClientArea.height - shellBounds.height ) / 2;
  shell.setLocation( middleX, middleY );
 }
}

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

public static void setSize( Shell shell, int prefWidth, int prefHeight ) {
 PropsUI props = PropsUI.getInstance();
 WindowProperty winprop = props.getScreen( shell.getText() );
 if ( winprop != null ) {
  winprop.setShell( shell, prefWidth, prefHeight );
 } else {
  shell.layout();
  winprop = new WindowProperty( shell.getText(), false, new Rectangle( 0, 0, prefWidth, prefHeight ) );
  winprop.setShell( shell );
  // Now, as this is the first time it gets opened, try to put it in the middle of the screen...
  Rectangle shellBounds = shell.getBounds();
  Monitor monitor = shell.getDisplay().getPrimaryMonitor();
  if ( shell.getParent() != null ) {
   monitor = shell.getParent().getMonitor();
  }
  Rectangle monitorClientArea = monitor.getClientArea();
  int middleX = monitorClientArea.x + ( monitorClientArea.width - shellBounds.width ) / 2;
  int middleY = monitorClientArea.y + ( monitorClientArea.height - shellBounds.height ) / 2;
  shell.setLocation( middleX, middleY );
 }
}

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

shell.pack();
} else {
 shell.layout();

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

@SuppressWarnings( "deprecation" )
@Override
public void show( boolean force ) {
 if ( ( force ) || ( !buttonsCreated ) ) {
  setButtons();
 }
 isDialogHidden = false;
 dialog.getShell().setText( title );
 // Remember the size from a last time or do proper layouting of the window.
 //
 if ( getWidth() > 0 && getHeight() > 0 ) {
  BaseStepDialog.setSize( getShell(), getWidth(), getHeight(), true );
 } else {
  BaseStepDialog.setSize( getShell() );
 }
 width = getShell().getSize().x;
 height = getShell().getSize().y;
 dialog.getShell().layout( true, true );
 // Timing is everything - fire the onLoad events so that anyone who is trying to listens gets notified
 //
 notifyListeners( XulRoot.EVENT_ON_LOAD );
 setAppicon( appIcon );
 returnCode = dialog.open();
}

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

shell.layout( true, true );

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

wFields.setLayoutData( fdFields );
shell.layout( true, true );

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

shell.layout( true, true );

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

shell.layout();

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

@Override
 public void handleEvent(Event e) {
 
   existing_mapping = new int[0][0];
      for (int uid: item_uids ) {
     
     existing_mapping = ensureUIDInLayout( existing_mapping, uid );
   }
   
   buildGrid();
   
   shell.layout( true, true );
 }
});

代码示例来源:origin: com.diffplug.durian/durian-swt

/**
 * @deprecated As of SWT 4.6 (Neon), this functionality is {@link Control#requestLayout()}.
 */
@Deprecated
public static void requestLayout(Control control) {
  if (control instanceof Shell) {
    ((Shell) control).layout(null, SWT.DEFER);
  } else {
    control.getShell().layout(new Control[]{control}, SWT.DEFER);
  }
}

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

int OnProgressChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aCurSelfProgress, int aMaxSelfProgress, int aCurTotalProgress, int aMaxTotalProgress) {
  int currentKBytes = aCurTotalProgress / 1024;
  int totalKBytes = aMaxTotalProgress / 1024;
  if (shell != null && !shell.isDisposed ()) {
    Object[] arguments = {new Integer (currentKBytes), new Integer (totalKBytes)};
    String statusMsg = Compatibility.getMessage ("SWT_Download_Status", arguments); //$NON-NLS-1$
    status.setText (statusMsg);
    shell.layout (true);
    shell.getDisplay ().update ();
  }
  return XPCOM.NS_OK;
}

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

@Override
  public void handleEvent(Event event) {
    GridData gridData = (GridData) cPaint.getLayoutData();
    gridData.heightHint = spinnerHeight.getSelection();
    cPaint.setLayoutData(gridData);
    shell.layout();
  }
});

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

public void showHeapStatus(boolean show) {
  MUIElement hsElement = modelService.find("org.eclipse.ui.HeapStatus", model); //$NON-NLS-1$
  if (hsElement != null && hsElement.isToBeRendered() != show) {
    hsElement.setToBeRendered(show);
    getShell().layout(null, SWT.ALL | SWT.CHANGED | SWT.DEFER);
  }
}

相关文章

微信公众号

最新文章

更多

Shell类方法