comparison dwtx/jface/viewers/AbstractComboBoxCellEditor.d @ 71:4878bef4a38e

Some fixing
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 04:03:58 +0200
parents 46a6e0e6ccd4
children 5df4896124c7
comparison
equal deleted inserted replaced
70:46a6e0e6ccd4 71:4878bef4a38e
15 15
16 import dwt.DWT; 16 import dwt.DWT;
17 import dwt.custom.CCombo; 17 import dwt.custom.CCombo;
18 import dwt.widgets.Composite; 18 import dwt.widgets.Composite;
19 19
20 import dwt.dwthelper.Runnable;
21 import dwt.dwthelper.utils;
22
20 /** 23 /**
21 * Abstract base class for Cell-Editors presented as combo boxes 24 * Abstract base class for Cell-Editors presented as combo boxes
22 * 25 *
23 * @since 3.4 26 * @since 3.4
24 * 27 *
25 */ 28 */
26 abstract class AbstractComboBoxCellEditor extends CellEditor { 29 abstract class AbstractComboBoxCellEditor : CellEditor {
27 /** 30 /**
28 * The list is dropped down when the activation is done through the mouse 31 * The list is dropped down when the activation is done through the mouse
29 */ 32 */
30 public static final int DROP_DOWN_ON_MOUSE_ACTIVATION = 1; 33 public static const int DROP_DOWN_ON_MOUSE_ACTIVATION = 1;
31 34
32 /** 35 /**
33 * The list is dropped down when the activation is done through the keyboard 36 * The list is dropped down when the activation is done through the keyboard
34 */ 37 */
35 public static final int DROP_DOWN_ON_KEY_ACTIVATION = 1 << 1; 38 public static const int DROP_DOWN_ON_KEY_ACTIVATION = 1 << 1;
36 39
37 /** 40 /**
38 * The list is dropped down when the activation is done without 41 * The list is dropped down when the activation is done without
39 * ui-interaction 42 * ui-interaction
40 */ 43 */
41 public static final int DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION = 1 << 2; 44 public static const int DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION = 1 << 2;
42 45
43 /** 46 /**
44 * The list is dropped down when the activation is done by traversing from 47 * The list is dropped down when the activation is done by traversing from
45 * cell to cell 48 * cell to cell
46 */ 49 */
47 public static final int DROP_DOWN_ON_TRAVERSE_ACTIVATION = 1 << 3; 50 public static const int DROP_DOWN_ON_TRAVERSE_ACTIVATION = 1 << 3;
48 51
49 private int activationStyle = DWT.NONE; 52 private int activationStyle = DWT.NONE;
50 53
51 /** 54 /**
52 * Create a new cell-editor 55 * Create a new cell-editor
54 * @param parent 57 * @param parent
55 * the parent of the combo 58 * the parent of the combo
56 * @param style 59 * @param style
57 * the style used to create the combo 60 * the style used to create the combo
58 */ 61 */
59 AbstractComboBoxCellEditor(Composite parent, int style) { 62 this(Composite parent, int style) {
60 super(parent, style); 63 super(parent, style);
61 } 64 }
62 65
63 /** 66 /**
64 * Creates a new cell editor with no control and no st of choices. 67 * Creates a new cell editor with no control and no st of choices.
65 * Initially, the cell editor has no cell validator. 68 * Initially, the cell editor has no cell validator.
66 * 69 *
67 */ 70 */
68 AbstractComboBoxCellEditor() { 71 this() {
69 } 72 }
70 73
71 /* 74 /*
72 * (non-Javadoc) 75 * (non-Javadoc)
73 * 76 *
90 && (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) !is 0) { 93 && (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) !is 0) {
91 dropDown = true; 94 dropDown = true;
92 } 95 }
93 96
94 if (dropDown) { 97 if (dropDown) {
95 getControl().getDisplay().asyncExec(new Runnable() { 98 getControl().getDisplay().asyncExec(new class Runnable {
96 99
97 public void run() { 100 public void run() {
98 ((CCombo) getControl()).setListVisible(true); 101 ((CCombo) getControl()).setListVisible(true);
99 } 102 }
100 103