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

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

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

Shell.isDisposed介绍

暂无

代码示例

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

Display display = Display.getDefault();
Shell dialogShell = new Shell(display, SWT.APPLICATION_MODAL);
// populate dialogShell
dialogShell.open();
while (!dialogShell.isDisposed()) {
  if (!display.readAndDispatch()) {
    display.sleep();
  }
}

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

public void open( String url ) {
 createDialog( "Google Drive", url, OPTIONS, LOGO );
 if ( receiver != null ) {
  ( (CustomLocalServerReceiver) receiver ).setUrl( url );
 }
 while ( !dialog.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
}

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

public static void main(String[] args) {
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.open();
  DirectoryDialog dialog = new DirectoryDialog(shell);
  dialog.setFilterPath("c:\\"); // Windows specific
  System.out.println("RESULT=" + dialog.open());
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
      display.sleep();
  }
  display.dispose();
}

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

private boolean open( RepositoryMeta repositoryMeta, boolean relogin, String errorMessage ) {
 new BrowserFunction( browser, "closeWindow" ) {
  @Override public Object function( Object[] arguments ) {
   browser.dispose();
   dialog.close();
   dialog.dispose();
   return true;
  }
 };
 controller.setCurrentRepository( repositoryMeta );
 controller.setRelogin( relogin );
 controller.setParentShell( dialog );
 while ( !dialog.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
 return result;
}

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

public JobEntryInterface open() {
 initUI();
 BaseStepDialog.setSize( shell );
 shell.open();
 Display display = getParent().getDisplay();
 while ( !shell.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
 return jobEntry;
}

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

while ( !dialog.isDisposed() ) {
 if ( !display.readAndDispatch() ) {
  display.sleep();

代码示例来源: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: pentaho/pentaho-kettle

private void open( final Display display ) {
 shell.pack();
 if ( width > 0 ) {
  final int height = shell.computeSize( width, SWT.DEFAULT ).y;
  // for some reason the actual width and minimum width are smaller than what is requested - add the
  // SHELL_WIDTH_OFFSET to get the desired size
  shell.setMinimumSize( width + SHELL_WIDTH_OFFSET, height );
  shell.setSize( width + SHELL_WIDTH_OFFSET, height );
 }
 shell.open();
 while ( !shell.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
}

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

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();

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

protected void openDialog() {
 shell.pack();
 // Set the focus on the OK button
 wOK.setFocus();
 Rectangle shellBounds = getParent().getBounds();
 Point dialogSize = shell.getSize();
 shell.setLocation( shellBounds.x + ( shellBounds.width - dialogSize.x ) / 2, shellBounds.y
   + ( shellBounds.height - dialogSize.y ) / 2 );
 shell.open();
 while ( !shell.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
}

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

private void open( final Display display ) {
 shell.pack();
 final int height = shell.computeSize( SHELL_WIDTH, SWT.DEFAULT ).y;
 // for some reason the actual width and minimum width are smaller than what is requested - add the
 // SHELL_WIDTH_OFFSET to get the desired size
 shell.setMinimumSize( SHELL_WIDTH + BaseDialog.SHELL_WIDTH_OFFSET, height );
 shell.setSize( SHELL_WIDTH + BaseDialog.SHELL_WIDTH_OFFSET, height );
 getData( meta );
 meta.setChanged( changed );
 shell.open();
 while ( !shell.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
}

代码示例来源: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: pentaho/pentaho-kettle

formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout( formLayout );
shell.setText( dialogTitle );
shell.open();
while ( !shell.isDisposed() ) {
 if ( !shell.getDisplay().readAndDispatch() ) {
  shell.getDisplay().sleep();

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

public static void main( String[] args ) {
  Display display = new Display();
  Shell shell = new Shell( display );
  shell.setLayout( new FillLayout() );
  final Table table = new Table( shell, SWT.VIRTUAL );
  table.setItemCount( 10000 );
  table.addListener( SWT.SetData, new Listener() {
    public void handleEvent( Event event ) {
      TableItem item = (TableItem)event.item;
      item.setText( "Item " + table.indexOf( item ) );
    }
  } );
  shell.setSize( 300, 500 );
  shell.open();
  while( !shell.isDisposed() ) {
    if( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  display.dispose();
}

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

public static void main( String[] args ) {
 DeviceData data = new DeviceData();
 data.tracking = true;
 Display display = new Display( data );
 Sleak sleak = new Sleak();
 Shell shell = new Shell( display );
 shell.setText( "S-Leak" );
 Point size = shell.getSize();
 shell.setSize( size.x / 2, size.y / 2 );
 sleak.create( shell );
 shell.open();
 // Launch your application here
 // e.g.
 // Shell shell = new Shell(display);
 // Button button1 = new Button(shell, SWT.PUSH);
 // button1.setBounds(10, 10, 100, 50);
 // button1.setText("Hello World");
 // Image image = new Image(display, 20, 20);
 // Button button2 = new Button(shell, SWT.PUSH);
 // button2.setBounds(10, 70, 100, 50);
 // button2.setImage(image);
 // shell.open();
 while ( !shell.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
 display.dispose();
}

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

formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout( formLayout );
shell.setText( title );
shell.open();
while ( !shell.isDisposed() ) {
 if ( !shell.getDisplay().readAndDispatch() ) {
  shell.getDisplay().sleep();

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

shell.setLayout(new GridLayout(1, false));
shell.setText("Hide Label");
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();

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

formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout( formLayout );
shell.setText( BaseMessages.getString( PKG, "InfobrightLoaderDialog.Shell.Title" ) );
input.setChanged( changed );
shell.open();
while ( !shell.isDisposed() ) {
 Display display = getParent().getDisplay();
 if ( !display.readAndDispatch() ) {
  display.sleep();

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

formLayout.marginHeight = Const.FORM_MARGIN;
shell.setLayout( formLayout );
shell.setText( BaseMessages.getString( PKG, "IngresVectorwiseLoaderDialog.Shell.Title" ));
shell.open();
while ( !shell.isDisposed() ) {
 Display display = getParent().getDisplay();
 if ( !display.readAndDispatch() ) {
  display.sleep();

相关文章

微信公众号

最新文章

更多

Shell类方法