public GradientEditorDialog(Shell shellParent, Gradient gSelected, ColorDefinition endColor) { this.gCurrent = gSelected; if (gCurrent != null) { gBackup = (Gradient) EcoreUtil.copy(gSelected); } else { gCurrent = AttributeFactory.eINSTANCE.createGradient(); gCurrent.setStartColor(ColorDefinitionImpl.create(254, 254, 254)); gCurrent.setEndColor( endColor ); } shell = new Shell(shellParent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL); shell.setLayout(new FillLayout()); placeComponents(); shell.setText(Messages.getString("GradientEditorDialog.Lbl.GradientEditor")); shell.setSize(400, 320); shell.setDefaultButton(btnAccept); UIHelper.centerOnScreen(shell); shell.layout(); shell.open(); while (!shell.isDisposed()) { if (!shell.getDisplay().readAndDispatch()) { shell.getDisplay().sleep(); } } }
public GradientEditorDialog( Shell shellParent, Gradient gSelected, ColorDefinition selectedColor ) { this.gCurrent = gSelected; if ( gCurrent != null ) { gBackup = (Gradient) EcoreUtil.copy( gSelected ); } else { gCurrent = AttributeFactory.eINSTANCE.createGradient( );  setGradientColor( gCurrent, selectedColor ); } shell = new Shell( shellParent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL ); shell.setLayout( new FillLayout( ) ); placeComponents( ); shell.setText( Messages.getString( "GradientEditorDialog.Lbl.GradientEditor" ) ); shell.setSize( 400, 320 ); shell.setDefaultButton( btnAccept ); UIHelper.centerOnScreen( shell ); shell.layout( ); shell.open( ); while ( !shell.isDisposed( ) ) { if ( !shell.getDisplay( ).readAndDispatch( ) ) { shell.getDisplay( ).sleep( ); } } }
    public GradientEditorDialog(Shell shellParent, Gradient gSelected, ColorDefinition endColor)    {        this.gCurrent = gSelected;        if (gCurrent != null)        {            gBackup = (Gradient) EcoreUtil.copy(gSelected);        }        else        {            gCurrent = AttributeFactory.eINSTANCE.createGradient();            gCurrent.setStartColor(ColorDefinitionImpl.create(254, 254, 254));            gCurrent.setEndColor( endColor );        }        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);        shell.setDefaultButton(btnAccept);        UIHelper.centerOnScreen(shell);        shell.layout();        shell.open();        while (!shell.isDisposed())        {            if (!shell.getDisplay().readAndDispatch())            {                shell.getDisplay().sleep();            }        }    }