shell.setLocation(Display.getCurrent().getClientArea().width / 2 - (shell.getSize().x / 2), Display .getCurrent().getClientArea().height / 2 - (shell.getSize().y / 2));
UIHelper.centerOnScreen(shell);
	public GradientEditorDialog(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));		}		display = Display.getCurrent();        shell = new Shell(Display.getCurrent(), SWT.DIALOG_TRIM | SWT.RESIZE/* | SWT.APPLICATION_MODAL */);        shell.setLayout(new FillLayout());		placeComponents();        shell.setText("Gradient Editor:");        shell.setSize(400, 320);        shell.setLocation(Display.getCurrent().getClientArea().width / 2 - (shell.getSize().x / 2), Display            .getCurrent().getClientArea().height            / 2 - (shell.getSize().y / 2));        shell.open();        while (!shell.isDisposed())        {            if (!shell.getDisplay().readAndDispatch())            {                shell.getDisplay().sleep();            }        }	}