Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 12329
Collapse All | Expand All

(-)CellEditor.java (+26 lines)
Lines 67-72 Link Here
67
	 */
67
	 */
68
	private Control control = null;
68
	private Control control = null;
69
69
70
	/**
71
	 * This cell editor's style
72
	 */
73
	private int style = SWT.NONE;
74
70
	/** 
75
	/** 
71
	 * Struct-like layout data for cell editors, with reasonable defaults
76
	 * Struct-like layout data for cell editors, with reasonable defaults
72
	 * for all fields.
77
	 * for all fields.
Lines 134-139 Link Here
134
 * @param parent the parent control
139
 * @param parent the parent control
135
 */
140
 */
136
protected CellEditor(Composite parent) {
141
protected CellEditor(Composite parent) {
142
	this(parent, SWT.NONE);
143
}
144
/**
145
 * Creates a new cell editor under the given parent control.
146
 * The cell editor has no cell validator.
147
 *
148
 * @param parent the parent control
149
 * @param style the style bits
150
 * @since 2.1
151
 */
152
protected CellEditor(Composite parent, int style) {
153
	this.style = style;
137
	control = createControl(parent);
154
	control = createControl(parent);
138
155
139
	// See 1GD5CA6: ITPUI:ALL - TaskView.setSelection does not work
156
	// See 1GD5CA6: ITPUI:ALL - TaskView.setSelection does not work
Lines 277-282 Link Here
277
	for (int i = 0; i < listeners.length; ++i) {
294
	for (int i = 0; i < listeners.length; ++i) {
278
		((IPropertyChangeListener) listeners[i]).propertyChange(new PropertyChangeEvent(this, actionId, null, null));
295
		((IPropertyChangeListener) listeners[i]).propertyChange(new PropertyChangeEvent(this, actionId, null, null));
279
	}
296
	}
297
}
298
/**
299
 * Returns the style bits for this this cell editor.
300
 *
301
 * @return the style for this cell editor
302
 * @since 2.1
303
 */
304
public int getStyle() {
305
	return style;
280
}
306
}
281
/**
307
/**
282
 * Returns the control used to implement this cell editor.
308
 * Returns the control used to implement this cell editor.
(-)CheckboxCellEditor.java (-1 / +14 lines)
Lines 5-10 Link Here
5
 * All Rights Reserved.
5
 * All Rights Reserved.
6
 */
6
 */
7
import org.eclipse.jface.util.Assert;
7
import org.eclipse.jface.util.Assert;
8
import org.eclipse.swt.SWT;
8
import org.eclipse.swt.widgets.*;
9
import org.eclipse.swt.widgets.*;
9
10
10
/**
11
/**
Lines 34-40 Link Here
34
 * @param parent the parent control
35
 * @param parent the parent control
35
 */
36
 */
36
public CheckboxCellEditor(Composite parent) {
37
public CheckboxCellEditor(Composite parent) {
37
	super(parent);
38
	this(parent, SWT.NONE);
39
}
40
/**
41
 * Creates a new checkbox cell editor parented under the given control.
42
 * The cell editor value is a boolean value, which is initially <code>false</code>. 
43
 * Initially, the cell editor has no cell validator.
44
 *
45
 * @param parent the parent control
46
 * @param style the style bits
47
 * @since 2.1
48
 */
49
public CheckboxCellEditor(Composite parent, int style) {
50
	super(parent, style);
38
}
51
}
39
/**
52
/**
40
 * The <code>CheckboxCellEditor</code> implementation of
53
 * The <code>CheckboxCellEditor</code> implementation of
(-)ColorCellEditor.java (-2 / +14 lines)
Lines 90-96 Link Here
90
 * @param parent the parent control
90
 * @param parent the parent control
91
 */
91
 */
92
public ColorCellEditor(Composite parent) {
92
public ColorCellEditor(Composite parent) {
93
	super(parent);
93
	this(parent, SWT.NONE);
94
}
95
/**
96
 * Creates a new color cell editor parented under the given control.
97
 * The cell editor value is black (<code>RGB(0,0,0)</code>) initially, and has no 
98
 * validator.
99
 *
100
 * @param parent the parent control
101
 * @param style the style bits
102
 * @since 2.1
103
 */
104
public ColorCellEditor(Composite parent, int style) {
105
	super(parent, style);
94
	doSetValue(new RGB(0, 0, 0));
106
	doSetValue(new RGB(0, 0, 0));
95
}
107
}
96
/**
108
/**
Lines 148-154 Link Here
148
 */
160
 */
149
protected Control createContents(Composite cell) {
161
protected Control createContents(Composite cell) {
150
	Color bg = cell.getBackground();
162
	Color bg = cell.getBackground();
151
	composite = new Composite(cell, SWT.NONE);
163
	composite = new Composite(cell, getStyle());
152
	composite.setBackground(bg);
164
	composite.setBackground(bg);
153
	composite.setLayout(new ColorCellLayout());
165
	composite.setLayout(new ColorCellLayout());
154
	colorLabel = new Label(composite, SWT.LEFT);
166
	colorLabel = new Label(composite, SWT.LEFT);
(-)ComboBoxCellEditor.java (-2 / +17 lines)
Lines 48-54 Link Here
48
 * @param items the list of strings for the combo box
48
 * @param items the list of strings for the combo box
49
 */
49
 */
50
public ComboBoxCellEditor(Composite parent, String[] items) {
50
public ComboBoxCellEditor(Composite parent, String[] items) {
51
	super(parent);
51
	this(parent, items, SWT.NONE);
52
}
53
/**
54
 * Creates a new cell editor with a combo containing the given 
55
 * list of choices and parented under the given control. The cell
56
 * editor value is the zero-based index of the selected item.
57
 * Initially, the cell editor has no cell validator and
58
 * the first item in the list is selected. 
59
 *
60
 * @param parent the parent control
61
 * @param items the list of strings for the combo box
62
 * @param style the style bits
63
 * @since 2.1
64
 */
65
public ComboBoxCellEditor(Composite parent, String[] items, int style) {
66
	super(parent, style);
52
	Assert.isNotNull(items);
67
	Assert.isNotNull(items);
53
	this.items = items;
68
	this.items = items;
54
	selection = 0;
69
	selection = 0;
Lines 59-65 Link Here
59
 */
74
 */
60
protected Control createControl(Composite parent) {
75
protected Control createControl(Composite parent) {
61
	
76
	
62
	comboBox = new CCombo(parent, SWT.NONE);
77
	comboBox = new CCombo(parent, getStyle());
63
	comboBox.setFont(parent.getFont());
78
	comboBox.setFont(parent.getFont());
64
79
65
	comboBox.addKeyListener(new KeyAdapter() {
80
	comboBox.addKeyListener(new KeyAdapter() {
(-)DialogCellEditor.java (-2 / +14 lines)
Lines 100-106 Link Here
100
 * @param parent the parent control
100
 * @param parent the parent control
101
 */
101
 */
102
protected DialogCellEditor(Composite parent) {
102
protected DialogCellEditor(Composite parent) {
103
	super(parent);
103
	this(parent, SWT.NONE);
104
}
105
/**
106
 * Creates a new dialog cell editor parented under the given control.
107
 * The cell editor value is <code>null</code> initially, and has no 
108
 * validator.
109
 *
110
 * @param parent the parent control
111
 * @param style the style bits
112
 * @since 2.1
113
 */
114
protected DialogCellEditor(Composite parent, int style) {
115
	super(parent, style);
104
}
116
}
105
/**
117
/**
106
 * Creates the button for this cell editor under the given parent control.
118
 * Creates the button for this cell editor under the given parent control.
Lines 145-151 Link Here
145
	Font font = parent.getFont();
157
	Font font = parent.getFont();
146
	Color bg = parent.getBackground();
158
	Color bg = parent.getBackground();
147
159
148
	editor = new Composite(parent, SWT.NONE);
160
	editor = new Composite(parent, getStyle());
149
	editor.setFont(font);
161
	editor.setFont(font);
150
	editor.setBackground(bg);
162
	editor.setBackground(bg);
151
	editor.setLayout(new DialogCellLayout());
163
	editor.setLayout(new DialogCellLayout());
(-)TextCellEditor.java (-4 / +16 lines)
Lines 43-49 Link Here
43
 * @param parent the parent control
43
 * @param parent the parent control
44
 */
44
 */
45
public TextCellEditor(Composite parent) {
45
public TextCellEditor(Composite parent) {
46
	super(parent);
46
	// specify no borders on text widget as cell outline in
47
	// table already provides the look of a border.
48
	this(parent, SWT.SINGLE);
49
}
50
/**
51
 * Creates a new text string cell editor parented under the given control.
52
 * The cell editor value is the string itself, which is initially the empty string. 
53
 * Initially, the cell editor has no cell validator.
54
 *
55
 * @param parent the parent control
56
 * @param style the style bits
57
 * @since 2.1
58
 */
59
public TextCellEditor(Composite parent, int style) {
60
	super(parent, style);
47
}
61
}
48
/**
62
/**
49
 * Checks to see if the "deleteable" state (can delete/
63
 * Checks to see if the "deleteable" state (can delete/
Lines 85-93 Link Here
85
 * Method declared on CellEditor.
99
 * Method declared on CellEditor.
86
 */
100
 */
87
protected Control createControl(Composite parent) {
101
protected Control createControl(Composite parent) {
88
	// specify no borders on text widget as cell outline in
102
	text = new Text(parent, getStyle());
89
	// table already provides the look of a border.
90
	text = new Text(parent, SWT.SINGLE);
91
	text.addKeyListener(new KeyAdapter() {
103
	text.addKeyListener(new KeyAdapter() {
92
		// hook key pressed - see PR 14201  
104
		// hook key pressed - see PR 14201  
93
		public void keyPressed(KeyEvent e) {
105
		public void keyPressed(KeyEvent e) {

Return to bug 12329