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(); }
Display display = new Display(); Shell shell1 = openDocumentShell(display); Shell shell2 = openDocumentShell(display); while (!shell1.isDisposed() || !shell2.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); shell.setLayout(new FillLayout()); Button button = new Button(shell, SWT.PUSH); button.setText("Open Modal Dialog"); System.out.println("Button pressed, about to open modal dialog"); final Shell dialogShell = new Shell(shell, SWT.PRIMARY_MODAL | SWT.SHEET); dialogShell.setLayout(new FillLayout()); Button closeButton = new Button(dialogShell, SWT.PUSH); closeButton.setText("Close"); dialogShell.open(); shell.open(); return shell;
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(); }
final Display display = new Display(); final Shell shell = new Shell(display); shell.setText("Git ToDo"); FillLayout layout = new FillLayout(); shell.setLayout(layout); Composite composite = new Composite(shell, SWT.NONE); composite.setLayout(new FillLayout()); // Possible missing layout? final GitToDoTree tableViewer = new GitToDoTree(composite);
shell.setLayout( shellLayout ); shell.setText( BaseMessages.getString( PKG, "GetRepositoryNamesDialog.DialogTitle" ) ); sCompParent.setLayout( new FillLayout( SWT.VERTICAL ) ); GridData sCompGridData = new GridData( GridData.FILL_BOTH ); sCompGridData.grabExcessHorizontalSpace = true; setSize(); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
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(); }
try { shell.setSize(200, 100); shell.setLayout(new FillLayout()); createComponents(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); if (!shell.isDisposed()) { shell.dispose();
@Override protected JavaGraphics createGraphics (Config config) { Display.setAppName(config.appName); display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); shell.addShellListener(new ShellAdapter() { public void shellActivated (ShellEvent e) { onResume(); } public void shellDeactivated (ShellEvent e) { onPause(); } }); comp = new Composite(shell, SWT.NONE); comp.setLayout(null); return new SWTGraphics(this, config, comp); }
shell.setLayout( shellLayout ); shell.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Shell.Title" ) ); sCompParent.setLayout( new FillLayout( SWT.VERTICAL ) ); GridData sCompGridData = new GridData( GridData.FILL_BOTH ); sCompGridData.grabExcessHorizontalSpace = true; input.setChanged( backupChanged ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
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(); }
/** Creates a new SWT platform and prepares it for operation. */ public SWTPlatform (Config config) { super(config); Display.setAppName(config.appName); display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); shell.addShellListener(new ShellAdapter() { public void shellActivated (ShellEvent e) { dispatchEvent(lifecycle, Lifecycle.RESUME); } public void shellDeactivated (ShellEvent e) { dispatchEvent(lifecycle, Lifecycle.PAUSE); } }); comp = new Composite(shell, SWT.NONE); comp.setLayout(null); graphics = new SWTGraphics(this, comp); input = new SWTInput(this); }
formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( BaseMessages.getString( PKG, "JobSpecial.Dummy.Label" ) ); time.setLayout( new FillLayout() ); wHour = new Spinner( time, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wHour.setMinimum( 0 ); enableDisableControls(); shell.open(); props.setDialogSize( shell, "JobSpecialDialogSize" ); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
shell.setSize( bounds.width > 300 ? bounds.width : 300, 200 ); shell.setLocation( location.x, location.y + bounds.height ); shell.setLayout( new FillLayout() ); final List list = new List( shell, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL ); props.setLook( list ); shell.open();
/** Creates a new SWT platform and prepares it for operation. */ public SWTPlatform (Config config) { super(config); Display.setAppName(config.appName); display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); shell.addShellListener(new ShellAdapter() { public void shellActivated (ShellEvent e) { dispatchEvent(lifecycle, Lifecycle.RESUME); } public void shellDeactivated (ShellEvent e) { dispatchEvent(lifecycle, Lifecycle.PAUSE); } }); comp = new Composite(shell, SWT.NONE); comp.setLayout(null); graphics = new SWTGraphics(this, comp); input = new SWTInput(this); }
shell.setLayout( shellLayout ); shell.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Shell.Title" ) ); sCompParent.setLayout( new FillLayout( SWT.VERTICAL ) ); GridData sCompGridData = new GridData( GridData.FILL_BOTH ); sCompGridData.grabExcessHorizontalSpace = true; input.setChanged( changed ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
public Shell open (Display display) { Shell shell = new Shell (display); shell.setLayout(new FillLayout()); Label label = new Label (shell, SWT.CENTER); label.setText (resHello.getString("Hello_world")); shell.pack (); shell.open (); return shell; } }
formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( BaseMessages.getString( PKG, "ValidatorDialog.Shell.Title" ) ); wSComp.setLayout( new FillLayout() ); FormData fdComp = new FormData(); fdComp.left = new FormAttachment( middle, 0 ); input.setChanged( changed ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
public void sampleApp(Shell shell) { shell.setLayout(new FillLayout()); shell.setText("Hello"); JLabel lab=new JLabel("Hello World"); Label username_checkout=new Label(shell, SWT.BOLD); username_checkout.setText("User Name"); Button button=new Button(shell,SWT.PUSH); button.setText("push"); shell.setSize(270,270); shell.open(); }
final Shell shell = new Shell(display); shell.setText("StackOverflow"); shell.setLayout(new FillLayout()); shell.open(); while (!shell.isDisposed()) if (!display.readAndDispatch()) display.sleep();
Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); shell.open(); while(!shell.isDisposed()) if(!display.readAndDispatch()) display.sleep();