/**
  * Opens GradientSelectionDialog without transparency setting available, receives the return
  * values and uses them to create the resulting GradientData object.
  *
  * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(org.eclipse.swt.widgets.Control)
  */
 protected Object openDialogBox(Control cellEditorWindow) {
   String value = (String) getValue();
   RGB color1 = null, color2 = null;
   int gradientStyle = -1;
   // value is in format: RGB {x, x, x},RGB {x, x, x},style
   // parse it
   if (value != null) {
     StringTokenizer st = new StringTokenizer(value, ",{}"); // $NON-NLS-1$
     try {
       int red, green, blue;
       st.nextToken().trim(); // RGB string			
       // color1
       red = Integer.parseInt(st.nextToken().trim());
       green = Integer.parseInt(st.nextToken().trim());
       blue = Integer.parseInt(st.nextToken().trim());
       if (red > -1 && green > -1 && blue > -1) {
         color1 = new RGB(red, green, blue);
       }
       st.nextToken().trim(); // RGB string			
       // color2
       red = Integer.parseInt(st.nextToken().trim());
       green = Integer.parseInt(st.nextToken().trim());
       blue = Integer.parseInt(st.nextToken().trim());
       if (red > -1 && green > -1 && blue > -1) {
         color2 = new RGB(red, green, blue);
       }
       // style
       GradientStyle gradientStyleObj =
           GradientStyle.get(value.substring(value.lastIndexOf(',') + 1).trim());
       if (gradientStyleObj != null) {
         gradientStyle = gradientStyleObj.getValue();
       }
     } finally {
       if (color1 == null || color2 == null || gradientStyle == -1) {
         value = null;
       }
     }
   }
   if (value == null) {
     // use default
     GradientData def = GradientData.getDefaultGradientData();
     color1 = FigureUtilities.integerToRGB(def.getGradientColor1());
     color2 = FigureUtilities.integerToRGB(def.getGradientColor2());
     gradientStyle = def.getGradientStyle();
   }
   GradientSelectionDialog dialog =
       new GradientSelectionDialog(
           cellEditorWindow.getShell(), SWT.APPLICATION_MODAL, color1, color2, gradientStyle, 0);
   int result = dialog.open();
   if (result == SWT.OK) {
     return new GradientData(
         FigureUtilities.RGBToInteger(dialog.getGradientColor1()),
         FigureUtilities.RGBToInteger(dialog.getGradientColor2()),
         dialog.getGradientStyle());
   } else if (result == -1) { // user selected Clear button
     // make the calls here, since parent ignores null, and we need to clear gradient
     markDirty();
     doSetValue(null);
     fireApplyEditorValue();
   }
   return null;
 }