shell.setDefaultButton(btnAccept);
    public GradientEditorDialog(Shell shellParent, Gradient gSelected)    {        this.gCurrent = gSelected;        if (gCurrent != null)        {            gBackup = (Gradient) EcoreUtil.copy(gSelected);        }        else        {            gCurrent = AttributeFactory.eINSTANCE.createGradient();            gCurrent.setStartColor(ColorDefinitionImpl.create(254, 0, 0));            gCurrent.setEndColor(ColorDefinitionImpl.create(0, 0, 254));        }        shell = new Shell(shellParent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);        shell.setLayout(new FillLayout());        placeComponents();        shell.setText(Messages.getString("GradientEditorDialog.Lbl.GradientEditor")); //$NON-NLS-1$        shell.setSize(400, 320);        UIHelper.centerOnScreen(shell);        shell.layout();        shell.open();        while (!shell.isDisposed())        {            if (!shell.getDisplay().readAndDispatch())            {                shell.getDisplay().sleep();            }        }    }