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

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

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

Shell.setLayout介绍

暂无

代码示例

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

public void widgetSelected( SelectionEvent e ) {
  final Shell dialog = new Shell( shell, SWT.DIALOG_TRIM );
  dialog.setText( BaseMessages.getString( PKG, "JobGetPOP.SelectDate" ) );
  dialog.setImage( GUIResource.getInstance().getImageSpoon() );
  dialog.setLayout( new GridLayout( 3, false ) );
  final DateTime calendar = new DateTime( dialog, SWT.CALENDAR );
  final DateTime time = new DateTime( dialog, SWT.TIME | SWT.TIME );
  new Label( dialog, SWT.NONE );
  new Label( dialog, SWT.NONE );
  Button ok = new Button( dialog, SWT.PUSH );
  ok.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  ok.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) );
  ok.addSelectionListener( new SelectionAdapter() {
   public void widgetSelected( SelectionEvent e ) {
    Calendar cal = Calendar.getInstance();
    cal.set( Calendar.YEAR, calendar.getYear() );
    cal.set( Calendar.MONTH, calendar.getMonth() );
    cal.set( Calendar.DAY_OF_MONTH, calendar.getDay() );
    cal.set( Calendar.HOUR_OF_DAY, time.getHours() );
    cal.set( Calendar.MINUTE, time.getMinutes() );
    cal.set( Calendar.SECOND, time.getSeconds() );
    wReadFrom.setText( new SimpleDateFormat( JobEntryGetPOP.DATE_PATTERN ).format( cal.getTime() ) );
    dialog.close();
   }
  } );
  dialog.setDefaultButton( ok );
  dialog.pack();
  dialog.open();
 }
} );

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

public void widgetSelected( SelectionEvent e ) {
  final Shell dialog = new Shell( shell, SWT.DIALOG_TRIM );
  dialog.setText( BaseMessages.getString( PKG, "MailInput.SelectDate" ) );
  dialog.setImage( GUIResource.getInstance().getImageSpoon() );
  dialog.setLayout( new GridLayout( 3, false ) );
  final DateTime calendar = new DateTime( dialog, SWT.CALENDAR );
  final DateTime time = new DateTime( dialog, SWT.TIME | SWT.TIME );
  new Label( dialog, SWT.NONE );
  new Label( dialog, SWT.NONE );
  Button ok = new Button( dialog, SWT.PUSH );
  ok.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  ok.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) );
  ok.addSelectionListener( new SelectionAdapter() {
   public void widgetSelected( SelectionEvent e ) {
    Calendar cal = Calendar.getInstance();
    cal.set( Calendar.YEAR, calendar.getYear() );
    cal.set( Calendar.MONTH, calendar.getMonth() );
    cal.set( Calendar.DAY_OF_MONTH, calendar.getDay() );
    cal.set( Calendar.HOUR_OF_DAY, time.getHours() );
    cal.set( Calendar.MINUTE, time.getMinutes() );
    cal.set( Calendar.SECOND, time.getSeconds() );
    wReadFrom.setText( new SimpleDateFormat( MailInputMeta.DATE_PATTERN ).format( cal.getTime() ) );
    dialog.close();
   }
  } );
  dialog.setDefaultButton( ok );
  dialog.pack();
  dialog.open();
 }
} );

代码示例来源: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 void widgetSelected( SelectionEvent e ) {
  final Shell dialogto = new Shell( shell, SWT.DIALOG_TRIM );
  dialogto.setText( BaseMessages.getString( PKG, "MailInput.SelectDate" ) );
  dialogto.setImage( GUIResource.getInstance().getImageSpoon() );
  dialogto.setLayout( new GridLayout( 3, false ) );
  final DateTime calendarto = new DateTime( dialogto, SWT.CALENDAR | SWT.BORDER );
  final DateTime timeto = new DateTime( dialogto, SWT.TIME | SWT.TIME );
  new Label( dialogto, SWT.NONE );
  new Label( dialogto, SWT.NONE );
  Button okto = new Button( dialogto, SWT.PUSH );
  okto.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  okto.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) );
  okto.addSelectionListener( new SelectionAdapter() {
   public void widgetSelected( SelectionEvent e ) {
    Calendar cal = Calendar.getInstance();
    cal.set( Calendar.YEAR, calendarto.getYear() );
    cal.set( Calendar.MONTH, calendarto.getMonth() );
    cal.set( Calendar.DAY_OF_MONTH, calendarto.getDay() );
    cal.set( Calendar.HOUR_OF_DAY, timeto.getHours() );
    cal.set( Calendar.MINUTE, timeto.getMinutes() );
    cal.set( Calendar.SECOND, timeto.getSeconds() );
    wReadTo.setText( new SimpleDateFormat( MailInputMeta.DATE_PATTERN ).format( cal.getTime() ) );
    dialogto.close();
   }
  } );
  dialogto.setDefaultButton( okto );
  dialogto.pack();
  dialogto.open();
 }
} );

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

public void widgetSelected( SelectionEvent e ) {
  final Shell dialogto = new Shell( shell, SWT.DIALOG_TRIM );
  dialogto.setText( BaseMessages.getString( PKG, "JobGetPOP.SelectDate" ) );
  dialogto.setImage( GUIResource.getInstance().getImageSpoon() );
  dialogto.setLayout( new GridLayout( 3, false ) );
  final DateTime calendarto = new DateTime( dialogto, SWT.CALENDAR | SWT.BORDER );
  final DateTime timeto = new DateTime( dialogto, SWT.TIME | SWT.TIME );
  new Label( dialogto, SWT.NONE );
  new Label( dialogto, SWT.NONE );
  Button okto = new Button( dialogto, SWT.PUSH );
  okto.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  okto.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) );
  okto.addSelectionListener( new SelectionAdapter() {
   public void widgetSelected( SelectionEvent e ) {
    Calendar cal = Calendar.getInstance();
    cal.set( Calendar.YEAR, calendarto.getYear() );
    cal.set( Calendar.MONTH, calendarto.getMonth() );
    cal.set( Calendar.DAY_OF_MONTH, calendarto.getDay() );
    cal.set( Calendar.HOUR_OF_DAY, timeto.getHours() );
    cal.set( Calendar.MINUTE, timeto.getMinutes() );
    cal.set( Calendar.SECOND, timeto.getSeconds() );
    wReadTo.setText( new SimpleDateFormat( JobEntryGetPOP.DATE_PATTERN ).format( cal.getTime() ) );
    dialogto.close();
   }
  } );
  dialogto.setDefaultButton( okto );
  dialogto.pack();
  dialogto.open();
 }
} );

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

@Override
public void widgetSelected( SelectionEvent e ) {
 final Shell dialog = new Shell( shell, SWT.DIALOG_TRIM );
 dialog.setText( BaseMessages.getString( PKG, "SalesforceInputDialog.SelectDate" ) );
 dialog.setImage( GUIResource.getInstance().getImageSpoon() );
 dialog.setLayout( new GridLayout( 3, false ) );
 dialog.setDefaultButton( ok );
 dialog.pack();
 dialog.open();

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

@Override
public void widgetSelected( SelectionEvent e ) {
 final Shell dialogto = new Shell( shell, SWT.DIALOG_TRIM );
 dialogto.setText( BaseMessages.getString( PKG, "SalesforceInputDialog.SelectDate" ) );
 dialogto.setImage( GUIResource.getInstance().getImageSpoon() );
 dialogto.setLayout( new GridLayout( 3, false ) );
 dialogto.setDefaultButton( okto );
 dialogto.pack();
 dialogto.open();

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

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

public void createDialog( String title, String url, int options, Image logo ) {
 Shell parent = getParent();
 display = parent.getDisplay();
 dialog = new Shell( parent, options );
 dialog.setText( title );
 dialog.setImage( logo );
 dialog.setSize( width, height );
 dialog.setLayout( new FillLayout() );
 try {
  browser = new Browser( dialog, SWT.NONE );
  browser.setUrl( url );
  browser.addCloseWindowListener( new CloseWindowListener() {
   @Override
   public void close( WindowEvent event ) {
    Browser browser = (Browser) event.widget;
    Shell shell = browser.getShell();
    shell.close();
   }
  } );
 } catch ( Exception e ) {
  MessageBox messageBox = new MessageBox( dialog, SWT.ICON_ERROR | SWT.OK );
  messageBox.setMessage( "Browser cannot be initialized." );
  messageBox.setText( "Exit" );
  messageBox.open();
 }
 setPosition();
 dialog.open();
}

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

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

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

public void open() {
 shell = new Shell( display );
 shell.setLayout( new FillLayout() );
 shell.setText( APP_NAME );
 try {
  readFiles( ROOT );
 } catch ( Exception e ) {
  new ErrorDialog(
   shell, "Error reading translations", "There was an unexpected error reading the translations", e );
 }
 // Put something on the screen
 sashform = new SashForm( shell, SWT.HORIZONTAL );
 sashform.setLayout( new FillLayout() );
 addList();
 addGrid();
 addListeners();
 sashform.setWeights( new int[] { 30, 70 } );
 sashform.setVisible( true );
 refresh();
 BaseStepDialog.setSize( shell );
 shell.open();
}

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

formLayout.marginHeight = Const.FORM_MARGIN;
shell.setText( BaseMessages.getString( PKG, "RepositoryImportDialog.Title" ) );
shell.setImage( GUIResource.getInstance().getImageSpoon() );
shell.setLayout( formLayout );
shell.open();
while ( !shell.isDisposed() ) {
 if ( !display.readAndDispatch() ) {
  display.sleep();

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

public void open() {
 shell = new Shell( display );
 shell.setLayout( new FillLayout() );
 shell.setText( APP_NAME );
 shell.setImage( GUIResource.getInstance().getImageLogoSmall() );
 try {
  readFiles();
 } catch ( Exception e ) {
  new ErrorDialog(
   shell, "Error reading translations", "There was an unexpected error reading the translations", e );
 }
 // Put something on the screen
 sashform = new SashForm( shell, SWT.HORIZONTAL );
 sashform.setLayout( new FormLayout() );
 addLists();
 addGrid();
 addListeners();
 sashform.setWeights( new int[] { 40, 60 } );
 sashform.setVisible( true );
 shell.pack();
 refresh();
 shell.setSize( 1024, 768 );
 shell.open();
}

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

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

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

formLayout.marginHeight = 15;
shell.setLayout( formLayout );
shell.setText( BaseMessages.getString( PKG, "RunConfigurationDeleteDialog.Title" ) );
shell.setImage( getImage() );
shell.open();
while ( !shell.isDisposed() ) {
 if ( !display.readAndDispatch() ) {
  display.sleep();

相关文章

微信公众号

最新文章

更多

Shell类方法