KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > editor2d > properties > RotationCellEditor


1 /**
2  * <p> Project: com.nightlabs.editor2d </p>
3  * <p> Copyright: Copyright (c) 2004 </p>
4  * <p> Company: NightLabs GmbH (Germany) </p>
5  * <p> Creation Date: 18.03.2005 </p>
6  * <p> Author: Daniel Mazurek </p>
7 **/

8 package com.nightlabs.editor2d.properties;
9
10 import org.eclipse.swt.widgets.Composite;
11
12 import com.nightlabs.rcp.property.ComboBoxCellEditor;
13
14 public class RotationCellEditor
15 extends ComboBoxCellEditor
16 {
17   public RotationCellEditor(Composite parent, String JavaDoc[] items, int style) {
18     super(parent, items, style);
19   }
20
21   /**
22    * The <code>ComboBoxCellEditor</code> implementation of
23    * this <code>CellEditor</code> framework method returns
24    * the String of the Selection
25    *
26    * @return the zero-based index of the current selection wrapped
27    * as an <code>Integer</code>
28    */

29   protected Object JavaDoc doGetValue()
30   {
31     if (comboBox.getText().equals(""))
32       return oldValue;
33     try {
34       Double JavaDoc d = new Double JavaDoc(comboBox.getText());
35     } catch (NumberFormatException JavaDoc e) {
36       return oldValue;
37     }
38     return new Double JavaDoc(comboBox.getText());
39 // return new Double(items[comboBox.getSelectionIndex()]);
40
}
41 }
42
Popular Tags