void createShell(org.eclipse.swt.widgets.Display display) { shell = new org.eclipse.swt.widgets.Shell(display); shell.setText(resources.getString("Window_title")); org.eclipse.swt.layout.GridLayout layout = new org.eclipse.swt.layout.GridLayout(); layout.numColumns = 1; shell.setLayout(layout); shell.addShellListener( new org.eclipse.swt.events.ShellAdapter() { public void shellClosed(org.eclipse.swt.events.ShellEvent e) { lineStyler.disposeColors(); text.removeLineStyleListener(lineStyler); } }); }
public static void main(java.lang.String[] args) { org.eclipse.swt.widgets.Display display = new org.eclipse.swt.widgets.Display(); org.eclipse.swt.widgets.Shell shell = new org.eclipse.swt.widgets.Shell(display); shell.setText(getResourceString("window.title")); shell.setLayout(new org.eclipse.swt.layout.GridLayout()); org.eclipse.swt.examples.paint.PaintExample instance = new org.eclipse.swt.examples.paint.PaintExample(shell); instance.createToolBar(shell); org.eclipse.swt.widgets.Composite composite = new org.eclipse.swt.widgets.Composite(shell, SWT.NONE); composite.setLayout(new org.eclipse.swt.layout.FillLayout()); composite.setLayoutData(new org.eclipse.swt.layout.GridData(SWT.FILL, SWT.FILL, true, true)); instance.createGUI(composite); instance.setDefaults(); setShellSize(display, shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } instance.dispose(); }