shell = new Shell(shellParent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; shell.setLayout(new FillLayout()); placeComponents(); shell .setText(new MessageFormat(Messages.getString("FormatSpecifierDialog.Title.FormatSpecifier")).format(new Object[] { sTitle})); shell.pack(); shell.setDefaultButton(btnAccept); UIHelper.centerOnScreen(shell); shell.layout(); shell.open(); while (!shell.isDisposed()) { if (!shell.getDisplay().readAndDispatch()) { shell.getDisplay().sleep(); } } }
shell = new Shell( shellParent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL ); GridLayout gridLayout = new GridLayout( ); gridLayout.numColumns = 2; shell.setLayout( new FillLayout( ) ); placeComponents( ); shell.setText( Messages.getString( "FormatSpecifierDialog.Title.EditFormat" ) ); shell.pack( ); shell.setDefaultButton( btnAccept ); UIHelper.centerOnScreen( shell ); shell.layout( ); shell.open( ); while ( !shell.isDisposed( ) ) { if ( !shell.getDisplay( ).readAndDispatch( ) ) { shell.getDisplay( ).sleep( ); } } }
    public FormatSpecifierDialog(Shell shellParent, FormatSpecifier formatspecifier, String sTitle)    {        super();        if (formatspecifier != null)        {            this.formatspecifier = (FormatSpecifier) EcoreUtil.copy(formatspecifier);        }        shell = new Shell(shellParent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);        GridLayout gridLayout = new GridLayout();        gridLayout.numColumns = 2;        shell.setLayout(new FillLayout());        placeComponents();        shell            .setText(new MessageFormat(Messages.getString("FormatSpecifierDialog.Title.FormatSpecifier")).format(new Object[] { sTitle})); //$NON-NLS-1$        shell.pack();        shell.setDefaultButton(btnAccept);        UIHelper.centerOnScreen(shell);        shell.layout();        shell.open();        while (!shell.isDisposed())        {            if (!shell.getDisplay().readAndDispatch())            {                shell.getDisplay().sleep();            }        }    }