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 194734 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jface/databinding/swt/ToolItemProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.ToolItemTooltipTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT ToolItems
19
 * 
20
 * @since 1.3
21
 */
22
public class ToolItemProperties {
23
	/**
24
	 * Returns a value property for the tooltip text of a SWT ToolItems.
25
	 * 
26
	 * @return a value property for the tooltip text of a SWT ToolItems.
27
	 */
28
	public static IValueProperty tooltipText() {
29
		return new ToolItemTooltipTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/TextProperties.java (-46 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.TextEditableProperty;
16
import org.eclipse.jface.internal.databinding.swt.TextTextProperty;
17
import org.eclipse.swt.SWT;
18
19
/**
20
 * A factory for creating properties of SWT Texts.
21
 * 
22
 * @since 1.3
23
 */
24
public class TextProperties {
25
	/**
26
	 * Returns a value property for the text of a SWT Text.
27
	 * 
28
	 * @param event
29
	 *            the SWT event type to register for change events. May be
30
	 *            {@link SWT#None}, {@link SWT#Modify} or {@link SWT#FocusOut}.
31
	 * 
32
	 * @return a value property for the text of a SWT Text.
33
	 */
34
	public static IValueProperty text(int event) {
35
		return new TextTextProperty(event);
36
	}
37
38
	/**
39
	 * Returns a value property for the editable state of a SWT Text.
40
	 * 
41
	 * @return a value property for the editable state of a SWT Text.
42
	 */
43
	public static IValueProperty editable() {
44
		return new TextEditableProperty();
45
	}
46
}
(-)src/org/eclipse/jface/databinding/swt/ScaleProperties.java (-51 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.ScaleMaximumProperty;
16
import org.eclipse.jface.internal.databinding.swt.ScaleMinimumProperty;
17
import org.eclipse.jface.internal.databinding.swt.ScaleSelectionProperty;
18
19
/**
20
 * A factory for creating properties of SWT Scales.
21
 * 
22
 * @since 1.3
23
 */
24
public class ScaleProperties {
25
	/**
26
	 * Returns a value property for the selected value of a SWT Scale.
27
	 * 
28
	 * @return a value property for the selected value of a SWT Scale.
29
	 */
30
	public static IValueProperty selection() {
31
		return new ScaleSelectionProperty();
32
	}
33
34
	/**
35
	 * Returns a value property for the minimum value of a SWT Scale.
36
	 * 
37
	 * @return a value property for the minimum value of a SWT Scale.
38
	 */
39
	public static IValueProperty minimum() {
40
		return new ScaleMinimumProperty();
41
	}
42
43
	/**
44
	 * Returns a value property for the maximum value of a SWT Scale.
45
	 * 
46
	 * @return a value property for the maximum value of a SWT Scale.
47
	 */
48
	public static IValueProperty maximum() {
49
		return new ScaleMaximumProperty();
50
	}
51
}
(-)src/org/eclipse/jface/databinding/swt/TrayItemProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.TrayItemTooltipTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT TrayItems
19
 * 
20
 * @since 1.3
21
 */
22
public class TrayItemProperties {
23
	/**
24
	 * Returns a value property for the tooltip text of a SWT TrayItems.
25
	 * 
26
	 * @return a value property for the tooltip text of a SWT TrayItems.
27
	 */
28
	public static IValueProperty tooltipText() {
29
		return new TrayItemTooltipTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/LabelProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.LabelTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT Labels.
19
 * 
20
 * @since 1.3
21
 */
22
public class LabelProperties {
23
	/**
24
	 * Returns a value property for the text of a SWT Label.
25
	 * 
26
	 * @return a value property for the text of a SWT Label.
27
	 */
28
	public static IValueProperty text() {
29
		return new LabelTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/SpinnerProperties.java (-51 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.SpinnerMaximumProperty;
16
import org.eclipse.jface.internal.databinding.swt.SpinnerMinimumProperty;
17
import org.eclipse.jface.internal.databinding.swt.SpinnerSelectionProperty;
18
19
/**
20
 * A factory for creating properties of SWT Spinners.
21
 * 
22
 * @since 1.3
23
 */
24
public class SpinnerProperties {
25
	/**
26
	 * Returns a value property for the selected value of a SWT Spinner.
27
	 * 
28
	 * @return a value property for the selected value of a SWT Spinner.
29
	 */
30
	public static IValueProperty selection() {
31
		return new SpinnerSelectionProperty();
32
	}
33
34
	/**
35
	 * Returns a value property for the minimum value of a SWT Spinner.
36
	 * 
37
	 * @return a value property for the minimum value of a SWT Spinner.
38
	 */
39
	public static IValueProperty minimum() {
40
		return new SpinnerMinimumProperty();
41
	}
42
43
	/**
44
	 * Returns a value property for the maximum value of a SWT Spinner.
45
	 * 
46
	 * @return a value property for the maximum value of a SWT Spinner.
47
	 */
48
	public static IValueProperty maximum() {
49
		return new SpinnerMaximumProperty();
50
	}
51
}
(-)src/org/eclipse/jface/databinding/swt/TableProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.TableSingleSelectionIndexProperty;
16
17
/**
18
 * A factory for creating properties of SWT Tables.
19
 * 
20
 * @since 1.3
21
 */
22
public class TableProperties {
23
	/**
24
	 * Returns a value property for the single selection index of a SWT Table.
25
	 * 
26
	 * @return a value property for the single selection index of a SWT Table.
27
	 */
28
	public static IValueProperty singleSelectionIndex() {
29
		return new TableSingleSelectionIndexProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/ItemProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.ItemTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT controls.
19
 * 
20
 * @since 1.3
21
 */
22
public class ItemProperties {
23
	/**
24
	 * Returns a value property for the text of a SWT Item.
25
	 * 
26
	 * @return a value property for the text of a SWT Item
27
	 */
28
	public static IValueProperty text() {
29
		return new ItemTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/ControlProperties.java (-121 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.ControlBackgroundProperty;
16
import org.eclipse.jface.internal.databinding.swt.ControlBoundsProperty;
17
import org.eclipse.jface.internal.databinding.swt.ControlEnabledProperty;
18
import org.eclipse.jface.internal.databinding.swt.ControlFocusedProperty;
19
import org.eclipse.jface.internal.databinding.swt.ControlFontProperty;
20
import org.eclipse.jface.internal.databinding.swt.ControlForegroundProperty;
21
import org.eclipse.jface.internal.databinding.swt.ControlLocationProperty;
22
import org.eclipse.jface.internal.databinding.swt.ControlSizeProperty;
23
import org.eclipse.jface.internal.databinding.swt.ControlTooltipTextProperty;
24
import org.eclipse.jface.internal.databinding.swt.ControlVisibleProperty;
25
26
/**
27
 * A factory for creating properties of SWT controls.
28
 * 
29
 * @since 1.3
30
 */
31
public class ControlProperties {
32
	/**
33
	 * Returns a value property for the enablement state of a SWT Control.
34
	 * 
35
	 * @return a value property for the enablement state of a SWT Control.
36
	 */
37
	public static IValueProperty enabled() {
38
		return new ControlEnabledProperty();
39
	}
40
41
	/**
42
	 * Returns a value property for the visibility state of a SWT Control.
43
	 * 
44
	 * @return a value property for the visibility state of a SWT Control.
45
	 */
46
	public static IValueProperty visible() {
47
		return new ControlVisibleProperty();
48
	}
49
50
	/**
51
	 * Returns a value property for the tooltip text of a SWT Control.
52
	 * 
53
	 * @return a value property for the tooltip text of a SWT Control.
54
	 */
55
	public static IValueProperty toolTipText() {
56
		return new ControlTooltipTextProperty();
57
	}
58
59
	/**
60
	 * Returns a value property for the foreground color of a SWT Control.
61
	 * 
62
	 * @return a value property for the foreground color of a SWT Control.
63
	 */
64
	public static IValueProperty foreground() {
65
		return new ControlForegroundProperty();
66
	}
67
68
	/**
69
	 * Returns a value property for the background color of a SWT Control.
70
	 * 
71
	 * @return a value property for the background color of a SWT Control.
72
	 */
73
	public static IValueProperty background() {
74
		return new ControlBackgroundProperty();
75
	}
76
77
	/**
78
	 * Returns a value property for the font of a SWT Control.
79
	 * 
80
	 * @return a value property for the font of a SWT Control.
81
	 */
82
	public static IValueProperty font() {
83
		return new ControlFontProperty();
84
	}
85
86
	/**
87
	 * Returns a value property for the size of a SWT Control.
88
	 * 
89
	 * @return a value property for the size of a SWT Control.
90
	 */
91
	public static IValueProperty size() {
92
		return new ControlSizeProperty();
93
	}
94
95
	/**
96
	 * Returns a value property for the location of a SWT Control.
97
	 * 
98
	 * @return a value property for the location of a SWT Control.
99
	 */
100
	public static IValueProperty location() {
101
		return new ControlLocationProperty();
102
	}
103
104
	/**
105
	 * Returns a value property for the bounds of a SWT Control.
106
	 * 
107
	 * @return a value property for the bounds of a SWT Control.
108
	 */
109
	public static IValueProperty bounds() {
110
		return new ControlBoundsProperty();
111
	}
112
113
	/**
114
	 * Returns a value property for the focus state of a SWT Control.
115
	 * 
116
	 * @return a value property for the focus state of a SWT Control.
117
	 */
118
	public static IValueProperty focused() {
119
		return new ControlFocusedProperty();
120
	}
121
}
(-)src/org/eclipse/jface/databinding/swt/CLabelProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.CLabelTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT Labels.
19
 * 
20
 * @since 1.3
21
 */
22
public class CLabelProperties {
23
	/**
24
	 * Returns a value property for the text of a SWT Label.
25
	 * 
26
	 * @return a value property for the text of a SWT Label.
27
	 */
28
	public static IValueProperty text() {
29
		return new CLabelTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/CTabItemProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.CTabItemTooltipTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT CTabItems
19
 * 
20
 * @since 1.3
21
 */
22
public class CTabItemProperties {
23
	/**
24
	 * Returns a value property for the tooltip text of a SWT CTabItem.
25
	 * 
26
	 * @return a value property for the tooltip text of a SWT CTabItem.
27
	 */
28
	public static IValueProperty tooltipText() {
29
		return new CTabItemTooltipTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/TreeColumnProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.TreeItemTooltipTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT TabItems
19
 * 
20
 * @since 1.3
21
 */
22
public class TreeColumnProperties {
23
	/**
24
	 * Returns a value property for the tooltip text of a SWT TreeColumn.
25
	 * 
26
	 * @return a value property for the tooltip text of a SWT TreeColumn.
27
	 */
28
	public static IValueProperty tooltipText() {
29
		return new TreeItemTooltipTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/SWTObservables.java (-186 / +34 lines)
Lines 26-60 Link Here
26
import org.eclipse.core.databinding.observable.value.IObservableValue;
26
import org.eclipse.core.databinding.observable.value.IObservableValue;
27
import org.eclipse.core.databinding.observable.value.IVetoableValue;
27
import org.eclipse.core.databinding.observable.value.IVetoableValue;
28
import org.eclipse.core.databinding.observable.value.ValueChangingEvent;
28
import org.eclipse.core.databinding.observable.value.ValueChangingEvent;
29
import org.eclipse.core.databinding.property.list.IListProperty;
30
import org.eclipse.core.databinding.property.value.IValueProperty;
31
import org.eclipse.jface.internal.databinding.swt.SWTDelayedObservableValueDecorator;
29
import org.eclipse.jface.internal.databinding.swt.SWTDelayedObservableValueDecorator;
32
import org.eclipse.jface.internal.databinding.swt.SWTObservableListDecorator;
33
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
34
import org.eclipse.jface.internal.databinding.swt.SWTVetoableValueDecorator;
30
import org.eclipse.jface.internal.databinding.swt.SWTVetoableValueDecorator;
35
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.custom.CCombo;
37
import org.eclipse.swt.custom.CLabel;
38
import org.eclipse.swt.custom.CTabItem;
39
import org.eclipse.swt.custom.StyledText;
40
import org.eclipse.swt.widgets.Button;
41
import org.eclipse.swt.widgets.Combo;
42
import org.eclipse.swt.widgets.Control;
31
import org.eclipse.swt.widgets.Control;
43
import org.eclipse.swt.widgets.Display;
32
import org.eclipse.swt.widgets.Display;
44
import org.eclipse.swt.widgets.Item;
45
import org.eclipse.swt.widgets.Label;
46
import org.eclipse.swt.widgets.Link;
47
import org.eclipse.swt.widgets.List;
48
import org.eclipse.swt.widgets.Scale;
49
import org.eclipse.swt.widgets.Shell;
50
import org.eclipse.swt.widgets.Spinner;
51
import org.eclipse.swt.widgets.TabItem;
52
import org.eclipse.swt.widgets.Table;
53
import org.eclipse.swt.widgets.TableColumn;
54
import org.eclipse.swt.widgets.Text;
55
import org.eclipse.swt.widgets.ToolItem;
56
import org.eclipse.swt.widgets.TrayItem;
57
import org.eclipse.swt.widgets.TreeColumn;
58
import org.eclipse.swt.widgets.Widget;
33
import org.eclipse.swt.widgets.Widget;
59
34
60
/**
35
/**
Lines 124-135 Link Here
124
				.observeDelayedValue(delay, observable), observable.getWidget());
99
				.observeDelayedValue(delay, observable), observable.getWidget());
125
	}
100
	}
126
101
127
	private static ISWTObservableValue observeWidgetProperty(Widget widget,
128
			IValueProperty property) {
129
		return new SWTObservableValueDecorator(property.observe(getRealm(widget
130
				.getDisplay()), widget), widget);
131
	}
132
133
	/**
102
	/**
134
	 * Returns an observable value tracking the enabled state of the given
103
	 * Returns an observable value tracking the enabled state of the given
135
	 * control
104
	 * control
Lines 140-146 Link Here
140
	 *         control
109
	 *         control
141
	 */
110
	 */
142
	public static ISWTObservableValue observeEnabled(Control control) {
111
	public static ISWTObservableValue observeEnabled(Control control) {
143
		return observeWidgetProperty(control, ControlProperties.enabled());
112
		return (ISWTObservableValue) WidgetProperties.enabled()
113
				.observe(control);
144
	}
114
	}
145
115
146
	/**
116
	/**
Lines 153-159 Link Here
153
	 *         control
123
	 *         control
154
	 */
124
	 */
155
	public static ISWTObservableValue observeVisible(Control control) {
125
	public static ISWTObservableValue observeVisible(Control control) {
156
		return observeWidgetProperty(control, ControlProperties.visible());
126
		return (ISWTObservableValue) WidgetProperties.visible()
127
				.observe(control);
157
	}
128
	}
158
129
159
	/**
130
	/**
Lines 175-203 Link Here
175
	 * @since 1.3
146
	 * @since 1.3
176
	 */
147
	 */
177
	public static ISWTObservableValue observeTooltipText(Widget widget) {
148
	public static ISWTObservableValue observeTooltipText(Widget widget) {
178
		if (widget instanceof Control) {
149
		return (ISWTObservableValue) WidgetProperties.tooltipText().observe(
179
			return observeTooltipText((Control) widget);
150
				widget);
180
		}
181
182
		IValueProperty property;
183
		if (widget instanceof CTabItem) {
184
			property = CTabItemProperties.tooltipText();
185
		} else if (widget instanceof TabItem) {
186
			property = TabItemProperties.tooltipText();
187
		} else if (widget instanceof TableColumn) {
188
			property = TableColumnProperties.tooltipText();
189
		} else if (widget instanceof ToolItem) {
190
			property = ToolItemProperties.tooltipText();
191
		} else if (widget instanceof TrayItem) {
192
			property = TrayItemProperties.tooltipText();
193
		} else if (widget instanceof TreeColumn) {
194
			property = TreeColumnProperties.tooltipText();
195
		} else {
196
			throw new IllegalArgumentException(
197
					"Item [" + widget.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
198
		}
199
200
		return observeWidgetProperty(widget, property);
201
	}
151
	}
202
152
203
	/**
153
	/**
Lines 210-216 Link Here
210
	 *         control
160
	 *         control
211
	 */
161
	 */
212
	public static ISWTObservableValue observeTooltipText(Control control) {
162
	public static ISWTObservableValue observeTooltipText(Control control) {
213
		return observeWidgetProperty(control, ControlProperties.toolTipText());
163
		return (ISWTObservableValue) WidgetProperties.tooltipText().observe(
164
				control);
214
	}
165
	}
215
166
216
	/**
167
	/**
Lines 231-255 Link Here
231
	 *             if <code>control</code> type is unsupported
182
	 *             if <code>control</code> type is unsupported
232
	 */
183
	 */
233
	public static ISWTObservableValue observeSelection(Control control) {
184
	public static ISWTObservableValue observeSelection(Control control) {
234
		IValueProperty property;
185
		return (ISWTObservableValue) WidgetProperties.selection().observe(
235
		if (control instanceof Spinner) {
186
				control);
236
			property = SpinnerProperties.selection();
237
		} else if (control instanceof Button) {
238
			property = ButtonProperties.selection();
239
		} else if (control instanceof Combo) {
240
			property = ComboProperties.selection();
241
		} else if (control instanceof CCombo) {
242
			property = CComboProperties.selection();
243
		} else if (control instanceof List) {
244
			property = ListProperties.selection();
245
		} else if (control instanceof Scale) {
246
			property = ScaleProperties.selection();
247
		} else {
248
			throw new IllegalArgumentException(
249
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
250
		}
251
252
		return observeWidgetProperty(control, property);
253
	}
187
	}
254
188
255
	/**
189
	/**
Lines 266-282 Link Here
266
	 *             if <code>control</code> type is unsupported
200
	 *             if <code>control</code> type is unsupported
267
	 */
201
	 */
268
	public static ISWTObservableValue observeMin(Control control) {
202
	public static ISWTObservableValue observeMin(Control control) {
269
		IValueProperty property;
203
		return (ISWTObservableValue) WidgetProperties.minimum()
270
		if (control instanceof Spinner) {
204
				.observe(control);
271
			property = SpinnerProperties.minimum();
272
		} else if (control instanceof Scale) {
273
			property = ScaleProperties.minimum();
274
		} else {
275
			throw new IllegalArgumentException(
276
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
277
		}
278
279
		return observeWidgetProperty(control, property);
280
	}
205
	}
281
206
282
	/**
207
	/**
Lines 293-309 Link Here
293
	 *             if <code>control</code> type is unsupported
218
	 *             if <code>control</code> type is unsupported
294
	 */
219
	 */
295
	public static ISWTObservableValue observeMax(Control control) {
220
	public static ISWTObservableValue observeMax(Control control) {
296
		IValueProperty property;
221
		return (ISWTObservableValue) WidgetProperties.maximum()
297
		if (control instanceof Spinner) {
222
				.observe(control);
298
			property = SpinnerProperties.maximum();
299
		} else if (control instanceof Scale) {
300
			property = ScaleProperties.maximum();
301
		} else {
302
			throw new IllegalArgumentException(
303
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
304
		}
305
306
		return observeWidgetProperty(control, property);
307
	}
223
	}
308
224
309
	/**
225
	/**
Lines 322-339 Link Here
322
	 *             if <code>control</code> type is unsupported
238
	 *             if <code>control</code> type is unsupported
323
	 */
239
	 */
324
	public static ISWTObservableValue observeText(Control control, int event) {
240
	public static ISWTObservableValue observeText(Control control, int event) {
325
		IValueProperty property;
241
		return new SWTVetoableValueDecorator(WidgetProperties.text(event)
326
		if (control instanceof Text) {
242
				.observe(control), control);
327
			property = TextProperties.text(event);
328
		} else if (control instanceof StyledText) {
329
			property = StyledTextProperties.text(event);
330
		} else {
331
			throw new IllegalArgumentException(
332
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
333
		}
334
335
		return new SWTVetoableValueDecorator(property.observe(getRealm(control
336
				.getDisplay()), control), control);
337
	}
243
	}
338
244
339
	/**
245
	/**
Lines 358-371 Link Here
358
	 * @since 1.3
264
	 * @since 1.3
359
	 */
265
	 */
360
	public static ISWTObservableValue observeText(Widget widget) {
266
	public static ISWTObservableValue observeText(Widget widget) {
361
		if (widget instanceof Control) {
267
		return (ISWTObservableValue) WidgetProperties.text().observe(widget);
362
			return observeText((Control) widget);
363
		} else if (widget instanceof Item) {
364
			return observeWidgetProperty(widget, ItemProperties.text());
365
		}
366
367
		throw new IllegalArgumentException(
368
				"Widget [" + widget.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
369
	}
268
	}
370
269
371
	/**
270
	/**
Lines 388-416 Link Here
388
	 *             if <code>control</code> type is unsupported
287
	 *             if <code>control</code> type is unsupported
389
	 */
288
	 */
390
	public static ISWTObservableValue observeText(Control control) {
289
	public static ISWTObservableValue observeText(Control control) {
391
		if (control instanceof Text || control instanceof StyledText) {
290
		return (ISWTObservableValue) WidgetProperties.text().observe(control);
392
			return observeText(control, SWT.None);
393
		}
394
395
		IValueProperty property;
396
		if (control instanceof Label) {
397
			property = LabelProperties.text();
398
		} else if (control instanceof Link) {
399
			property = LinkProperties.text();
400
		} else if (control instanceof CLabel) {
401
			property = CLabelProperties.text();
402
		} else if (control instanceof Combo) {
403
			property = ComboProperties.text();
404
		} else if (control instanceof CCombo) {
405
			property = CComboProperties.text();
406
		} else if (control instanceof Shell) {
407
			property = ShellProperties.text();
408
		} else {
409
			throw new IllegalArgumentException(
410
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
411
		}
412
413
		return observeWidgetProperty(control, property);
414
	}
291
	}
415
292
416
	/**
293
	/**
Lines 428-447 Link Here
428
	 *             if <code>control</code> type is unsupported
305
	 *             if <code>control</code> type is unsupported
429
	 */
306
	 */
430
	public static IObservableList observeItems(Control control) {
307
	public static IObservableList observeItems(Control control) {
431
		IListProperty property;
308
		return WidgetProperties.items().observe(control);
432
		if (control instanceof Combo) {
433
			property = ComboProperties.items();
434
		} else if (control instanceof CCombo) {
435
			property = CComboProperties.items();
436
		} else if (control instanceof List) {
437
			property = ListProperties.items();
438
		} else {
439
			throw new IllegalArgumentException(
440
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
441
		}
442
443
		return new SWTObservableListDecorator(property.observe(getRealm(control
444
				.getDisplay()), control), control);
445
	}
309
	}
446
310
447
	/**
311
	/**
Lines 461-481 Link Here
461
	 */
325
	 */
462
	public static ISWTObservableValue observeSingleSelectionIndex(
326
	public static ISWTObservableValue observeSingleSelectionIndex(
463
			Control control) {
327
			Control control) {
464
		IValueProperty property;
328
		return (ISWTObservableValue) WidgetProperties.singleSelectionIndex()
465
		if (control instanceof Table) {
329
				.observe(control);
466
			property = TableProperties.singleSelectionIndex();
467
		} else if (control instanceof Combo) {
468
			property = ComboProperties.singleSelectionIndex();
469
		} else if (control instanceof CCombo) {
470
			property = CComboProperties.singleSelectionIndex();
471
		} else if (control instanceof List) {
472
			property = ListProperties.singleSelectionIndex();
473
		} else {
474
			throw new IllegalArgumentException(
475
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
476
		}
477
478
		return observeWidgetProperty(control, property);
479
	}
330
	}
480
331
481
	/**
332
	/**
Lines 488-494 Link Here
488
	 *         control
339
	 *         control
489
	 */
340
	 */
490
	public static ISWTObservableValue observeForeground(Control control) {
341
	public static ISWTObservableValue observeForeground(Control control) {
491
		return observeWidgetProperty(control, ControlProperties.foreground());
342
		return (ISWTObservableValue) WidgetProperties.foreground().observe(
343
				control);
492
	}
344
	}
493
345
494
	/**
346
	/**
Lines 501-507 Link Here
501
	 *         control
353
	 *         control
502
	 */
354
	 */
503
	public static ISWTObservableValue observeBackground(Control control) {
355
	public static ISWTObservableValue observeBackground(Control control) {
504
		return observeWidgetProperty(control, ControlProperties.background());
356
		return (ISWTObservableValue) WidgetProperties.background().observe(
357
				control);
505
	}
358
	}
506
359
507
	/**
360
	/**
Lines 512-518 Link Here
512
	 * @return an observable value tracking the font of the given control
365
	 * @return an observable value tracking the font of the given control
513
	 */
366
	 */
514
	public static ISWTObservableValue observeFont(Control control) {
367
	public static ISWTObservableValue observeFont(Control control) {
515
		return observeWidgetProperty(control, ControlProperties.font());
368
		return (ISWTObservableValue) WidgetProperties.font().observe(control);
516
	}
369
	}
517
370
518
	/**
371
	/**
Lines 524-530 Link Here
524
	 * @since 1.3
377
	 * @since 1.3
525
	 */
378
	 */
526
	public static ISWTObservableValue observeSize(Control control) {
379
	public static ISWTObservableValue observeSize(Control control) {
527
		return observeWidgetProperty(control, ControlProperties.size());
380
		return (ISWTObservableValue) WidgetProperties.size().observe(control);
528
	}
381
	}
529
382
530
	/**
383
	/**
Lines 536-542 Link Here
536
	 * @since 1.3
389
	 * @since 1.3
537
	 */
390
	 */
538
	public static ISWTObservableValue observeLocation(Control control) {
391
	public static ISWTObservableValue observeLocation(Control control) {
539
		return observeWidgetProperty(control, ControlProperties.location());
392
		return (ISWTObservableValue) WidgetProperties.location().observe(
393
				control);
540
	}
394
	}
541
395
542
	/**
396
	/**
Lines 548-554 Link Here
548
	 * @since 1.3
402
	 * @since 1.3
549
	 */
403
	 */
550
	public static ISWTObservableValue observeFocus(Control control) {
404
	public static ISWTObservableValue observeFocus(Control control) {
551
		return observeWidgetProperty(control, ControlProperties.focused());
405
		return (ISWTObservableValue) WidgetProperties.focused()
406
				.observe(control);
552
	}
407
	}
553
408
554
	/**
409
	/**
Lines 560-566 Link Here
560
	 * @since 1.3
415
	 * @since 1.3
561
	 */
416
	 */
562
	public static ISWTObservableValue observeBounds(Control control) {
417
	public static ISWTObservableValue observeBounds(Control control) {
563
		return observeWidgetProperty(control, ControlProperties.bounds());
418
		return (ISWTObservableValue) WidgetProperties.bounds().observe(control);
564
	}
419
	}
565
420
566
	/**
421
	/**
Lines 576-590 Link Here
576
	 *             if <code>control</code> type is unsupported
431
	 *             if <code>control</code> type is unsupported
577
	 */
432
	 */
578
	public static ISWTObservableValue observeEditable(Control control) {
433
	public static ISWTObservableValue observeEditable(Control control) {
579
		IValueProperty property;
434
		return (ISWTObservableValue) WidgetProperties.editable().observe(
580
		if (control instanceof Text) {
435
				control);
581
			property = TextProperties.editable();
582
		} else {
583
			throw new IllegalArgumentException(
584
					"Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
585
		}
586
587
		return observeWidgetProperty(control, property);
588
	}
436
	}
589
437
590
	private static class DisplayRealm extends Realm {
438
	private static class DisplayRealm extends Realm {
(-)src/org/eclipse/jface/databinding/swt/LinkProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.LinkTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT Links.
19
 * 
20
 * @since 1.3
21
 */
22
public class LinkProperties {
23
	/**
24
	 * Returns a value property for the text of a SWT Link.
25
	 * 
26
	 * @return a value property for the text of a SWT Link.
27
	 */
28
	public static IValueProperty text() {
29
		return new LinkTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/ButtonProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.ButtonSelectionProperty;
16
17
/**
18
 * A factory for creating properties of SWT Buttons.
19
 * 
20
 * @since 1.3
21
 */
22
public class ButtonProperties {
23
	/**
24
	 * Returns a value property for the selection state of a SWT Button.
25
	 * 
26
	 * @return a value property for the selection state of a SWT Button.
27
	 */
28
	public static IValueProperty selection() {
29
		return new ButtonSelectionProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/CComboProperties.java (-62 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.list.IListProperty;
15
import org.eclipse.core.databinding.property.value.IValueProperty;
16
import org.eclipse.jface.internal.databinding.swt.CComboItemsProperty;
17
import org.eclipse.jface.internal.databinding.swt.CComboSelectionProperty;
18
import org.eclipse.jface.internal.databinding.swt.CComboSingleSelectionIndexProperty;
19
import org.eclipse.jface.internal.databinding.swt.CComboTextProperty;
20
21
/**
22
 * A factory for creating properties of SWT CCombos
23
 * 
24
 * @since 1.3
25
 */
26
public class CComboProperties {
27
	/**
28
	 * Returns a value property for the selection text of a SWT CCombo.
29
	 * 
30
	 * @return a value property for the selection text of a SWT CCombo.
31
	 */
32
	public static IValueProperty selection() {
33
		return new CComboSelectionProperty();
34
	}
35
36
	/**
37
	 * Returns a value property for the text of a SWT CCombo.
38
	 * 
39
	 * @return a value property for the text of a SWT CCombo.
40
	 */
41
	public static IValueProperty text() {
42
		return new CComboTextProperty();
43
	}
44
45
	/**
46
	 * Returns a list property for the items of a SWT CCombo.
47
	 * 
48
	 * @return a list property for the items of a SWT CCombo.
49
	 */
50
	public static IListProperty items() {
51
		return new CComboItemsProperty();
52
	}
53
54
	/**
55
	 * Returns a value property for the single selection index of a SWT Combo.
56
	 * 
57
	 * @return a value property for the single selection index of a SWT Combo.
58
	 */
59
	public static IValueProperty singleSelectionIndex() {
60
		return new CComboSingleSelectionIndexProperty();
61
	}
62
}
(-)src/org/eclipse/jface/databinding/swt/StyledTextProperties.java (-36 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.StyledTextTextProperty;
16
import org.eclipse.swt.SWT;
17
18
/**
19
 * A factory for creating properties of SWT StyledTexts.
20
 * 
21
 * @since 1.3
22
 */
23
public class StyledTextProperties {
24
	/**
25
	 * Returns a value property for the text of a SWT StyledText.
26
	 * 
27
	 * @param event
28
	 *            the SWT event type to register for change events. May be
29
	 *            {@link SWT#None}, {@link SWT#Modify} or {@link SWT#FocusOut}.
30
	 * 
31
	 * @return a value property for the text of a SWT StyledText.
32
	 */
33
	public static IValueProperty text(int event) {
34
		return new StyledTextTextProperty(event);
35
	}
36
}
(-)src/org/eclipse/jface/databinding/swt/ListProperties.java (-52 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.list.IListProperty;
15
import org.eclipse.core.databinding.property.value.IValueProperty;
16
import org.eclipse.jface.internal.databinding.swt.ListItemsProperty;
17
import org.eclipse.jface.internal.databinding.swt.ListSelectionProperty;
18
import org.eclipse.jface.internal.databinding.swt.ListSingleSelectionIndexProperty;
19
20
/**
21
 * A factory for creating properties of SWT List controls.
22
 * 
23
 * @since 1.3
24
 */
25
public class ListProperties {
26
	/**
27
	 * Returns a value property for observing the selection text of a SWT List.
28
	 * 
29
	 * @return a value property for observing the selection text of a SWT List.
30
	 */
31
	public static IValueProperty selection() {
32
		return new ListSelectionProperty();
33
	}
34
35
	/**
36
	 * Returns a list property for observing the items in a SWT List.
37
	 * 
38
	 * @return a list property for observing the items in a SWT List.
39
	 */
40
	public static IListProperty items() {
41
		return new ListItemsProperty();
42
	}
43
44
	/**
45
	 * Returns a value property for the single selection index of a SWT List.
46
	 * 
47
	 * @return a value property for the single selection index of a SWT List.
48
	 */
49
	public static IValueProperty singleSelectionIndex() {
50
		return new ListSingleSelectionIndexProperty();
51
	}
52
}
(-)src/org/eclipse/jface/databinding/swt/ShellProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.ShellTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT Shells.
19
 * 
20
 * @since 1.3
21
 */
22
public class ShellProperties {
23
	/**
24
	 * Returns a value property for the text of a SWT Shell.
25
	 * 
26
	 * @return a value property for the text of a SWT Shell.
27
	 */
28
	public static IValueProperty text() {
29
		return new ShellTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/TabItemProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.TabItemTooltipTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT TabItems
19
 * 
20
 * @since 1.3
21
 */
22
public class TabItemProperties {
23
	/**
24
	 * Returns a value property for the tooltip text of a SWT TabItem.
25
	 * 
26
	 * @return a value property for the tooltip text of a SWT TabItem.
27
	 */
28
	public static IValueProperty tooltipText() {
29
		return new TabItemTooltipTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/databinding/swt/ComboProperties.java (-62 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.list.IListProperty;
15
import org.eclipse.core.databinding.property.value.IValueProperty;
16
import org.eclipse.jface.internal.databinding.swt.ComboItemsProperty;
17
import org.eclipse.jface.internal.databinding.swt.ComboSelectionProperty;
18
import org.eclipse.jface.internal.databinding.swt.ComboSingleSelectionIndexProperty;
19
import org.eclipse.jface.internal.databinding.swt.ComboTextProperty;
20
21
/**
22
 * A factory for creating properties of SWT Combos.
23
 * 
24
 * @since 1.3
25
 */
26
public class ComboProperties {
27
	/**
28
	 * Returns a value property for the selection text of a SWT Combo.
29
	 * 
30
	 * @return a value property for the selection text of a SWT Combo.
31
	 */
32
	public static IValueProperty selection() {
33
		return new ComboSelectionProperty();
34
	}
35
36
	/**
37
	 * Returns a value property for the text of a SWT Combo.
38
	 * 
39
	 * @return a value property for the text of a SWT Combo.
40
	 */
41
	public static IValueProperty text() {
42
		return new ComboTextProperty();
43
	}
44
45
	/**
46
	 * Returns a list property for the items of a SWT Combo.
47
	 * 
48
	 * @return a list property for the items of a SWT Combo.
49
	 */
50
	public static IListProperty items() {
51
		return new ComboItemsProperty();
52
	}
53
54
	/**
55
	 * Returns a value property for the single selection index of a SWT Combo.
56
	 * 
57
	 * @return a value property for the single selection index of a SWT Combo.
58
	 */
59
	public static IValueProperty singleSelectionIndex() {
60
		return new ComboSingleSelectionIndexProperty();
61
	}
62
}
(-)src/org/eclipse/jface/databinding/swt/TableColumnProperties.java (-31 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.value.IValueProperty;
15
import org.eclipse.jface.internal.databinding.swt.TableColumnTooltipTextProperty;
16
17
/**
18
 * A factory for creating properties of SWT TableColumns
19
 * 
20
 * @since 1.3
21
 */
22
public class TableColumnProperties {
23
	/**
24
	 * Returns a value property for the tooltip text of a SWT TableColumns.
25
	 * 
26
	 * @return a value property for the tooltip text of a SWT TableColumns.
27
	 */
28
	public static IValueProperty tooltipText() {
29
		return new TableColumnTooltipTextProperty();
30
	}
31
}
(-)src/org/eclipse/jface/internal/databinding/swt/WidgetValueProperty.java (+6 lines)
Lines 12-17 Link Here
12
package org.eclipse.jface.internal.databinding.swt;
12
package org.eclipse.jface.internal.databinding.swt;
13
13
14
import org.eclipse.core.databinding.observable.Realm;
14
import org.eclipse.core.databinding.observable.Realm;
15
import org.eclipse.core.databinding.observable.value.IObservableValue;
15
import org.eclipse.core.databinding.property.INativePropertyListener;
16
import org.eclipse.core.databinding.property.INativePropertyListener;
16
import org.eclipse.core.databinding.property.IPropertyChangeListener;
17
import org.eclipse.core.databinding.property.IPropertyChangeListener;
17
import org.eclipse.core.databinding.property.PropertyChangeEvent;
18
import org.eclipse.core.databinding.property.PropertyChangeEvent;
Lines 86-89 Link Here
86
					WidgetValueProperty.this));
87
					WidgetValueProperty.this));
87
		}
88
		}
88
	}
89
	}
90
91
	public IObservableValue observe(Realm realm, Object source) {
92
		return new SWTObservableValueDecorator(super.observe(realm, source),
93
				(Widget) source);
94
	}
89
}
95
}
(-)src/org/eclipse/jface/internal/databinding/swt/WidgetListProperty.java (+5 lines)
Lines 12-17 Link Here
12
package org.eclipse.jface.internal.databinding.swt;
12
package org.eclipse.jface.internal.databinding.swt;
13
13
14
import org.eclipse.core.databinding.observable.Realm;
14
import org.eclipse.core.databinding.observable.Realm;
15
import org.eclipse.core.databinding.observable.list.IObservableList;
15
import org.eclipse.core.databinding.property.list.SimpleListProperty;
16
import org.eclipse.core.databinding.property.list.SimpleListProperty;
16
import org.eclipse.jface.databinding.swt.SWTObservables;
17
import org.eclipse.jface.databinding.swt.SWTObservables;
17
import org.eclipse.swt.widgets.Widget;
18
import org.eclipse.swt.widgets.Widget;
Lines 26-29 Link Here
26
			return SWTObservables.getRealm(((Widget) source).getDisplay());
27
			return SWTObservables.getRealm(((Widget) source).getDisplay());
27
		return super.getPreferredRealm(source);
28
		return super.getPreferredRealm(source);
28
	}
29
	}
30
31
	public IObservableList observe(Realm realm, Object source) {
32
		return new SWTObservableListDecorator(super.observe(realm, source), (Widget) source);
33
	}
29
}
34
}
(-)src/org/eclipse/jface/databinding/swt/WidgetProperties.java (+442 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Matthew Hall and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Matthew Hall - initial API and implementation (bug 194734)
10
 ******************************************************************************/
11
12
package org.eclipse.jface.databinding.swt;
13
14
import org.eclipse.core.databinding.property.list.DelegatingListProperty;
15
import org.eclipse.core.databinding.property.list.IListProperty;
16
import org.eclipse.core.databinding.property.value.DelegatingValueProperty;
17
import org.eclipse.core.databinding.property.value.IValueProperty;
18
import org.eclipse.jface.internal.databinding.swt.ButtonSelectionProperty;
19
import org.eclipse.jface.internal.databinding.swt.CComboItemsProperty;
20
import org.eclipse.jface.internal.databinding.swt.CComboSelectionProperty;
21
import org.eclipse.jface.internal.databinding.swt.CComboSingleSelectionIndexProperty;
22
import org.eclipse.jface.internal.databinding.swt.CComboTextProperty;
23
import org.eclipse.jface.internal.databinding.swt.CLabelTextProperty;
24
import org.eclipse.jface.internal.databinding.swt.CTabItemTooltipTextProperty;
25
import org.eclipse.jface.internal.databinding.swt.ComboItemsProperty;
26
import org.eclipse.jface.internal.databinding.swt.ComboSelectionProperty;
27
import org.eclipse.jface.internal.databinding.swt.ComboSingleSelectionIndexProperty;
28
import org.eclipse.jface.internal.databinding.swt.ComboTextProperty;
29
import org.eclipse.jface.internal.databinding.swt.ControlBackgroundProperty;
30
import org.eclipse.jface.internal.databinding.swt.ControlBoundsProperty;
31
import org.eclipse.jface.internal.databinding.swt.ControlEnabledProperty;
32
import org.eclipse.jface.internal.databinding.swt.ControlFocusedProperty;
33
import org.eclipse.jface.internal.databinding.swt.ControlFontProperty;
34
import org.eclipse.jface.internal.databinding.swt.ControlForegroundProperty;
35
import org.eclipse.jface.internal.databinding.swt.ControlLocationProperty;
36
import org.eclipse.jface.internal.databinding.swt.ControlSizeProperty;
37
import org.eclipse.jface.internal.databinding.swt.ControlTooltipTextProperty;
38
import org.eclipse.jface.internal.databinding.swt.ControlVisibleProperty;
39
import org.eclipse.jface.internal.databinding.swt.ItemTextProperty;
40
import org.eclipse.jface.internal.databinding.swt.LabelTextProperty;
41
import org.eclipse.jface.internal.databinding.swt.LinkTextProperty;
42
import org.eclipse.jface.internal.databinding.swt.ListItemsProperty;
43
import org.eclipse.jface.internal.databinding.swt.ListSelectionProperty;
44
import org.eclipse.jface.internal.databinding.swt.ListSingleSelectionIndexProperty;
45
import org.eclipse.jface.internal.databinding.swt.ScaleMaximumProperty;
46
import org.eclipse.jface.internal.databinding.swt.ScaleMinimumProperty;
47
import org.eclipse.jface.internal.databinding.swt.ScaleSelectionProperty;
48
import org.eclipse.jface.internal.databinding.swt.ShellTextProperty;
49
import org.eclipse.jface.internal.databinding.swt.SpinnerMaximumProperty;
50
import org.eclipse.jface.internal.databinding.swt.SpinnerMinimumProperty;
51
import org.eclipse.jface.internal.databinding.swt.SpinnerSelectionProperty;
52
import org.eclipse.jface.internal.databinding.swt.StyledTextTextProperty;
53
import org.eclipse.jface.internal.databinding.swt.TabItemTooltipTextProperty;
54
import org.eclipse.jface.internal.databinding.swt.TableColumnTooltipTextProperty;
55
import org.eclipse.jface.internal.databinding.swt.TableSingleSelectionIndexProperty;
56
import org.eclipse.jface.internal.databinding.swt.TextEditableProperty;
57
import org.eclipse.jface.internal.databinding.swt.TextTextProperty;
58
import org.eclipse.jface.internal.databinding.swt.ToolItemTooltipTextProperty;
59
import org.eclipse.jface.internal.databinding.swt.TrayItemTooltipTextProperty;
60
import org.eclipse.jface.internal.databinding.swt.TreeItemTooltipTextProperty;
61
import org.eclipse.swt.SWT;
62
import org.eclipse.swt.custom.CCombo;
63
import org.eclipse.swt.custom.CLabel;
64
import org.eclipse.swt.custom.CTabItem;
65
import org.eclipse.swt.custom.StyledText;
66
import org.eclipse.swt.widgets.Button;
67
import org.eclipse.swt.widgets.Combo;
68
import org.eclipse.swt.widgets.Control;
69
import org.eclipse.swt.widgets.Item;
70
import org.eclipse.swt.widgets.Label;
71
import org.eclipse.swt.widgets.Link;
72
import org.eclipse.swt.widgets.List;
73
import org.eclipse.swt.widgets.Scale;
74
import org.eclipse.swt.widgets.Shell;
75
import org.eclipse.swt.widgets.Spinner;
76
import org.eclipse.swt.widgets.TabItem;
77
import org.eclipse.swt.widgets.Table;
78
import org.eclipse.swt.widgets.TableColumn;
79
import org.eclipse.swt.widgets.Text;
80
import org.eclipse.swt.widgets.ToolItem;
81
import org.eclipse.swt.widgets.TrayItem;
82
import org.eclipse.swt.widgets.TreeColumn;
83
import org.eclipse.swt.widgets.TreeItem;
84
85
/**
86
 * A factory for creating properties of SWT controls.
87
 * 
88
 * @since 1.3
89
 */
90
public class WidgetProperties {
91
	/**
92
	 * Returns a value property for observing the background color of a
93
	 * {@link Control}.
94
	 * 
95
	 * @return a value property for observing the background color of a
96
	 *         {@link Control}.
97
	 */
98
	public static IValueProperty background() {
99
		return new ControlBackgroundProperty();
100
	}
101
102
	/**
103
	 * Returns a value property for observing the bounds of a {@link Control}.
104
	 * 
105
	 * @return a value property for observing the bounds of a {@link Control}.
106
	 */
107
	public static IValueProperty bounds() {
108
		return new ControlBoundsProperty();
109
	}
110
111
	/**
112
	 * Returns a value property for observing the editable state of a
113
	 * {@link Text}.
114
	 * 
115
	 * @return a value property for observing the editable state of a
116
	 *         {@link Text}.
117
	 */
118
	public static IValueProperty editable() {
119
		return new TextEditableProperty();
120
	}
121
122
	/**
123
	 * Returns a value property for observing the enablement state of a
124
	 * {@link Control}.
125
	 * 
126
	 * @return a value property for observing the enablement state of a
127
	 *         {@link Control}.
128
	 */
129
	public static IValueProperty enabled() {
130
		return new ControlEnabledProperty();
131
	}
132
133
	/**
134
	 * Returns a value property for observing the focus state of a
135
	 * {@link Control}.
136
	 * 
137
	 * @return a value property for observing the focus state of a
138
	 *         {@link Control}.
139
	 */
140
	public static IValueProperty focused() {
141
		return new ControlFocusedProperty();
142
	}
143
144
	/**
145
	 * Returns a value property for observing the font of a {@link Control}.
146
	 * 
147
	 * @return a value property for observing the font of a {@link Control}.
148
	 */
149
	public static IValueProperty font() {
150
		return new ControlFontProperty();
151
	}
152
153
	/**
154
	 * Returns a value property for observing the foreground color of a
155
	 * {@link Control}.
156
	 * 
157
	 * @return a value property for observing the foreground color of a
158
	 *         {@link Control}.
159
	 */
160
	public static IValueProperty foreground() {
161
		return new ControlForegroundProperty();
162
	}
163
164
	/**
165
	 * Returns a list property for observing the items of a {@link CCombo},
166
	 * {@link Combo} or {@link List}.
167
	 * 
168
	 * @return a list property for observing the items of a {@link CCombo},
169
	 *         {@link Combo} or {@link List}.
170
	 */
171
	public static IListProperty items() {
172
		return new DelegatingListProperty(String.class) {
173
			private IListProperty cCombo = new CComboItemsProperty();
174
			private IListProperty combo = new ComboItemsProperty();
175
			private IListProperty list = new ListItemsProperty();
176
177
			protected IListProperty doGetDelegate(Object source) {
178
				if (source instanceof CCombo)
179
					return cCombo;
180
				if (source instanceof Combo)
181
					return combo;
182
				if (source instanceof List)
183
					return list;
184
				throw new IllegalArgumentException(
185
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
186
			}
187
		};
188
	}
189
190
	/**
191
	 * Returns a value property for observing the location of a {@link Control}.
192
	 * 
193
	 * @return a value property for observing the location of a {@link Control}.
194
	 */
195
	public static IValueProperty location() {
196
		return new ControlLocationProperty();
197
	}
198
199
	/**
200
	 * Returns a value property for observing the maximum value of a
201
	 * {@link Scale} or {@link Spinner}.
202
	 * 
203
	 * @return a value property for observing the maximum value of a
204
	 *         {@link Scale} or {@link Spinner}.
205
	 */
206
	public static IValueProperty maximum() {
207
		return new DelegatingValueProperty(Integer.TYPE) {
208
			private IValueProperty scale = new ScaleMaximumProperty();
209
			private IValueProperty spinner = new SpinnerMaximumProperty();
210
211
			protected IValueProperty doGetDelegate(Object source) {
212
				if (source instanceof Scale)
213
					return scale;
214
				if (source instanceof Spinner)
215
					return spinner;
216
				throw new IllegalArgumentException(
217
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
218
			}
219
		};
220
	}
221
222
	/**
223
	 * Returns a value property for observing the minimum value of a
224
	 * {@link Scale} or {@link Spinner}.
225
	 * 
226
	 * @return a value property for observing the minimum value of a
227
	 *         {@link Scale} or {@link Spinner}.
228
	 */
229
	public static IValueProperty minimum() {
230
		return new DelegatingValueProperty(Integer.TYPE) {
231
			private IValueProperty scale = new ScaleMinimumProperty();
232
			private IValueProperty spinner = new SpinnerMinimumProperty();
233
234
			protected IValueProperty doGetDelegate(Object source) {
235
				if (source instanceof Scale)
236
					return scale;
237
				if (source instanceof Spinner)
238
					return spinner;
239
				throw new IllegalArgumentException(
240
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
241
			}
242
		};
243
	}
244
245
	/**
246
	 * Returns a value property for observing the selection state of a
247
	 * {@link Button}, {@link CCombo}, {@link Combo}, {@link List},
248
	 * {@link Scale} or {@link Spinner}.
249
	 * 
250
	 * @return a value property for observing the selection state of a
251
	 *         {@link Button}, {@link CCombo}, {@link Combo}, {@link List},
252
	 *         {@link Scale} or {@link Spinner}.
253
	 */
254
	public static IValueProperty selection() {
255
		return new DelegatingValueProperty() {
256
			private IValueProperty button = new ButtonSelectionProperty();
257
			private IValueProperty cCombo = new CComboSelectionProperty();
258
			private IValueProperty combo = new ComboSelectionProperty();
259
			private IValueProperty list = new ListSelectionProperty();
260
			private IValueProperty scale = new ScaleSelectionProperty();
261
			private IValueProperty spinner = new SpinnerSelectionProperty();
262
263
			protected IValueProperty doGetDelegate(Object source) {
264
				if (source instanceof Button)
265
					return button;
266
				if (source instanceof CCombo)
267
					return cCombo;
268
				if (source instanceof Combo)
269
					return combo;
270
				if (source instanceof List)
271
					return list;
272
				if (source instanceof Scale)
273
					return scale;
274
				if (source instanceof Spinner)
275
					return spinner;
276
				throw new IllegalArgumentException(
277
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
278
			}
279
		};
280
	}
281
282
	/**
283
	 * Returns a value property for observing the single selection index of a
284
	 * {@link CCombo}, {@link Combo}, {@link List} or {@link Table}.
285
	 * 
286
	 * @return a value property for the single selection index of a SWT Combo.
287
	 */
288
	public static IValueProperty singleSelectionIndex() {
289
		return new DelegatingValueProperty(Integer.TYPE) {
290
			private IValueProperty cCombo = new CComboSingleSelectionIndexProperty();
291
			private IValueProperty combo = new ComboSingleSelectionIndexProperty();
292
			private IValueProperty list = new ListSingleSelectionIndexProperty();
293
			private IValueProperty table = new TableSingleSelectionIndexProperty();
294
295
			protected IValueProperty doGetDelegate(Object source) {
296
				if (source instanceof CCombo)
297
					return cCombo;
298
				if (source instanceof Combo)
299
					return combo;
300
				if (source instanceof List)
301
					return list;
302
				if (source instanceof Table)
303
					return table;
304
				throw new IllegalArgumentException(
305
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
306
			}
307
		};
308
	}
309
310
	/**
311
	 * Returns a value property for observing the size of a {@link Control}.
312
	 * 
313
	 * @return a value property for observing the size of a {@link Control}.
314
	 */
315
	public static IValueProperty size() {
316
		return new ControlSizeProperty();
317
	}
318
319
	/**
320
	 * Returns a value property for observing the text of a {@link CCombo},
321
	 * {@link CLabel}, {@link Combo}, {@link Label}, {@link Item}, {@link Link},
322
	 * {@link Shell} or {@link Text}.
323
	 * 
324
	 * @return a value property for observing the text of a {@link CCombo},
325
	 *         {@link CLabel}, {@link Combo}, {@link Label}, {@link Item},
326
	 *         {@link Link}, {@link Shell} or {@link Text}.
327
	 */
328
	public static IValueProperty text() {
329
		return new DelegatingValueProperty(String.class) {
330
			private IValueProperty cCombo = new CComboTextProperty();
331
			private IValueProperty cLabel = new CLabelTextProperty();
332
			private IValueProperty combo = new ComboTextProperty();
333
			private IValueProperty item = new ItemTextProperty();
334
			private IValueProperty label = new LabelTextProperty();
335
			private IValueProperty link = new LinkTextProperty();
336
			private IValueProperty shell = new ShellTextProperty();
337
			private IValueProperty text = new TextTextProperty(SWT.None);
338
339
			protected IValueProperty doGetDelegate(Object source) {
340
				if (source instanceof CCombo)
341
					return cCombo;
342
				if (source instanceof CLabel)
343
					return cLabel;
344
				if (source instanceof Combo)
345
					return combo;
346
				if (source instanceof Item)
347
					return item;
348
				if (source instanceof Label)
349
					return label;
350
				if (source instanceof Link)
351
					return link;
352
				if (source instanceof Shell)
353
					return shell;
354
				if (source instanceof Text)
355
					return text;
356
				throw new IllegalArgumentException(
357
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
358
			}
359
		};
360
	}
361
362
	/**
363
	 * Returns a value property for observing the text of a {@link StyledText}
364
	 * or {@link Text}.
365
	 * 
366
	 * @param event
367
	 *            the SWT event type to register for change events. May be
368
	 *            {@link SWT#None}, {@link SWT#Modify} or {@link SWT#FocusOut}.
369
	 * 
370
	 * @return a value property for observing the text of a {@link StyledText}
371
	 *         or {@link Text}.
372
	 */
373
	public static IValueProperty text(final int event) {
374
		return new DelegatingValueProperty(String.class) {
375
			private IValueProperty styledText = new StyledTextTextProperty(
376
					event);
377
			private IValueProperty text = new TextTextProperty(event);
378
379
			protected IValueProperty doGetDelegate(Object source) {
380
				if (source instanceof StyledText)
381
					return styledText;
382
				if (source instanceof Text)
383
					return text;
384
				throw new IllegalArgumentException(
385
						"Widget [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
386
			}
387
		};
388
	}
389
390
	/**
391
	 * Returns a value property for observing the tooltip text of a
392
	 * {@link CTabItem}, {@link Control}, {@link TabItem}, {@link TableColumn},
393
	 * {@link ToolItem}, {@link TrayItem}, {@link TreeColumn} or
394
	 * {@link TreeItem}.
395
	 * 
396
	 * @return a value property for observing the tooltip text of a
397
	 *         {@link CTabItem}, {@link Control}, {@link TabItem},
398
	 *         {@link TableColumn}, {@link ToolItem}, {@link TrayItem},
399
	 *         {@link TreeColumn} or {@link TreeItem}.
400
	 */
401
	public static IValueProperty tooltipText() {
402
		return new DelegatingValueProperty(String.class) {
403
			private IValueProperty cTabItem = new CTabItemTooltipTextProperty();
404
			private IValueProperty control = new ControlTooltipTextProperty();
405
			private IValueProperty tabItem = new TabItemTooltipTextProperty();
406
			private IValueProperty tableColumn = new TableColumnTooltipTextProperty();
407
			private IValueProperty toolItem = new ToolItemTooltipTextProperty();
408
			private IValueProperty trayItem = new TrayItemTooltipTextProperty();
409
			private IValueProperty treeItem = new TreeItemTooltipTextProperty();
410
411
			protected IValueProperty doGetDelegate(Object source) {
412
				if (source instanceof CTabItem)
413
					return cTabItem;
414
				if (source instanceof Control)
415
					return control;
416
				if (source instanceof TabItem)
417
					return tabItem;
418
				if (source instanceof TableColumn)
419
					return tableColumn;
420
				if (source instanceof ToolItem)
421
					return toolItem;
422
				if (source instanceof TrayItem)
423
					return trayItem;
424
				if (source instanceof TreeItem)
425
					return treeItem;
426
				throw new IllegalArgumentException(
427
						"Item [" + source.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
428
			}
429
		};
430
	}
431
432
	/**
433
	 * Returns a value property for observing the visibility state of a
434
	 * {@link Control}.
435
	 * 
436
	 * @return a value property for observing the visibility state of a
437
	 *         {@link Control}.
438
	 */
439
	public static IValueProperty visible() {
440
		return new ControlVisibleProperty();
441
	}
442
}
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ScaleObservableValueMaxTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.ScaleProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Scale;
28
import org.eclipse.swt.widgets.Scale;
Lines 97-103 Link Here
97
		}
97
		}
98
98
99
		public IObservableValue createObservableValue(Realm realm) {
99
		public IObservableValue createObservableValue(Realm realm) {
100
			return ScaleProperties.maximum().observe(realm, scale);
100
			return WidgetProperties.maximum().observe(realm, scale);
101
		}
101
		}
102
102
103
		public void change(IObservable observable) {
103
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ScaleObservableValueMinTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.ScaleProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Scale;
28
import org.eclipse.swt.widgets.Scale;
Lines 97-103 Link Here
97
		}
97
		}
98
98
99
		public IObservableValue createObservableValue(Realm realm) {
99
		public IObservableValue createObservableValue(Realm realm) {
100
			return ScaleProperties.minimum().observe(realm, scale);
100
			return WidgetProperties.minimum().observe(realm, scale);
101
		}
101
		}
102
102
103
		public void change(IObservable observable) {
103
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/TableSingleSelectionObservableValueTest.java (-2 / +2 lines)
Lines 23-29 Link Here
23
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
24
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.TableProperties;
26
import org.eclipse.jface.databinding.swt.WidgetProperties;
27
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.SWT;
28
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Display;
29
import org.eclipse.swt.widgets.Shell;
29
import org.eclipse.swt.widgets.Shell;
Lines 109-115 Link Here
109
		}
109
		}
110
110
111
		public IObservableValue createObservableValue(Realm realm) {
111
		public IObservableValue createObservableValue(Realm realm) {
112
			return TableProperties.singleSelectionIndex().observe(realm, table);
112
			return WidgetProperties.singleSelectionIndex().observe(realm, table);
113
		}
113
		}
114
114
115
		public Object getValueType(IObservableValue observable) {
115
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ShellObservableValueTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
22
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
23
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.ShellProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
26
import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
27
import org.eclipse.swt.widgets.Shell;
27
import org.eclipse.swt.widgets.Shell;
28
28
Lines 112-118 Link Here
112
		}
112
		}
113
113
114
		public IObservableValue createObservableValue(Realm realm) {
114
		public IObservableValue createObservableValue(Realm realm) {
115
			return ShellProperties.text().observe(realm, shell);
115
			return WidgetProperties.text().observe(realm, shell);
116
		}
116
		}
117
117
118
		public Object getValueType(IObservableValue observable) {
118
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/CLabelObservableValueTest.java (-2 / +2 lines)
Lines 21-28 Link Here
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.CLabelProperties;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.custom.CLabel;
27
import org.eclipse.swt.custom.CLabel;
28
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Display;
Lines 90-96 Link Here
90
		}
90
		}
91
91
92
		public IObservableValue createObservableValue(Realm realm) {
92
		public IObservableValue createObservableValue(Realm realm) {
93
			return CLabelProperties.text().observe(realm, label);
93
			return WidgetProperties.text().observe(realm, label);
94
		}
94
		}
95
95
96
		public void change(IObservable observable) {
96
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ScaleObservableValueSelectionTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.ScaleProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Scale;
28
import org.eclipse.swt.widgets.Scale;
Lines 97-103 Link Here
97
		}
97
		}
98
98
99
		public IObservableValue createObservableValue(Realm realm) {
99
		public IObservableValue createObservableValue(Realm realm) {
100
			return ScaleProperties.selection().observe(realm, scale);
100
			return WidgetProperties.selection().observe(realm, scale);
101
		}
101
		}
102
102
103
		public void change(IObservable observable) {
103
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/StyledTextObservableValueModifyTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.core.databinding.observable.value.IObservableValue;
22
import org.eclipse.core.databinding.observable.value.IObservableValue;
23
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
24
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
25
import org.eclipse.jface.databinding.swt.StyledTextProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.custom.StyledText;
27
import org.eclipse.swt.custom.StyledText;
28
import org.eclipse.swt.widgets.Shell;
28
import org.eclipse.swt.widgets.Shell;
Lines 55-61 Link Here
55
		}
55
		}
56
56
57
		public IObservableValue createObservableValue(Realm realm) {
57
		public IObservableValue createObservableValue(Realm realm) {
58
			return StyledTextProperties.text(SWT.Modify).observe(realm, text);
58
			return WidgetProperties.text(SWT.Modify).observe(realm, text);
59
		}
59
		}
60
60
61
		public Object getValueType(IObservableValue observable) {
61
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/CComboObservableValueTextTest.java (-2 / +2 lines)
Lines 22-29 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
25
import org.eclipse.jface.databinding.swt.CComboProperties;
26
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.WidgetProperties;
27
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
27
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
28
import org.eclipse.swt.SWT;
28
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.custom.CCombo;
29
import org.eclipse.swt.custom.CCombo;
Lines 89-95 Link Here
89
		}
89
		}
90
90
91
		public IObservableValue createObservableValue(Realm realm) {
91
		public IObservableValue createObservableValue(Realm realm) {
92
			return new SWTObservableValueDecorator(CComboProperties.text()
92
			return new SWTObservableValueDecorator(WidgetProperties.text()
93
					.observe(realm, combo), combo);
93
					.observe(realm, combo), combo);
94
		}
94
		}
95
95
(-)src/org/eclipse/jface/tests/internal/databinding/swt/TextObservableValueFocusOutTest.java (-2 / +2 lines)
Lines 21-27 Link Here
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.TextProperties;
24
import org.eclipse.jface.databinding.swt.WidgetProperties;
25
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.widgets.Shell;
26
import org.eclipse.swt.widgets.Shell;
27
import org.eclipse.swt.widgets.Text;
27
import org.eclipse.swt.widgets.Text;
Lines 54-60 Link Here
54
		}
54
		}
55
55
56
		public IObservableValue createObservableValue(Realm realm) {
56
		public IObservableValue createObservableValue(Realm realm) {
57
			return TextProperties.text(SWT.FocusOut).observe(realm, text);
57
			return WidgetProperties.text(SWT.FocusOut).observe(realm, text);
58
		}
58
		}
59
59
60
		public Object getValueType(IObservableValue observable) {
60
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ComboObservableValueTextTest.java (-2 / +2 lines)
Lines 22-29 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
25
import org.eclipse.jface.databinding.swt.ComboProperties;
26
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.WidgetProperties;
27
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
27
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
28
import org.eclipse.swt.SWT;
28
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.widgets.Combo;
29
import org.eclipse.swt.widgets.Combo;
Lines 90-96 Link Here
90
		}
90
		}
91
91
92
		public IObservableValue createObservableValue(Realm realm) {
92
		public IObservableValue createObservableValue(Realm realm) {
93
			return new SWTObservableValueDecorator(ComboProperties.text()
93
			return new SWTObservableValueDecorator(WidgetProperties.text()
94
					.observe(realm, combo), combo);
94
					.observe(realm, combo), combo);
95
		}
95
		}
96
96
(-)src/org/eclipse/jface/tests/internal/databinding/swt/SpinnerObservableValueSelectionTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SpinnerProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Shell;
28
import org.eclipse.swt.widgets.Shell;
Lines 97-103 Link Here
97
		}
97
		}
98
98
99
		public IObservableValue createObservableValue(Realm realm) {
99
		public IObservableValue createObservableValue(Realm realm) {
100
			return SpinnerProperties.selection().observe(realm, spinner);
100
			return WidgetProperties.selection().observe(realm, spinner);
101
		}
101
		}
102
102
103
		public void change(IObservable observable) {
103
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/TextEditableObservableValueTest.java (-2 / +2 lines)
Lines 21-27 Link Here
21
import org.eclipse.jface.databinding.conformance.ObservableDelegateTest;
21
import org.eclipse.jface.databinding.conformance.ObservableDelegateTest;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.TextProperties;
24
import org.eclipse.jface.databinding.swt.WidgetProperties;
25
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.widgets.Shell;
26
import org.eclipse.swt.widgets.Shell;
27
import org.eclipse.swt.widgets.Text;
27
import org.eclipse.swt.widgets.Text;
Lines 102-108 Link Here
102
		}
102
		}
103
103
104
		public IObservableValue createObservableValue(Realm realm) {
104
		public IObservableValue createObservableValue(Realm realm) {
105
			return TextProperties.editable().observe(realm, text);
105
			return WidgetProperties.editable().observe(realm, text);
106
		}
106
		}
107
107
108
		public Object getValueType(IObservableValue observable) {
108
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ComboObservableValueTest.java (-3 / +3 lines)
Lines 17-24 Link Here
17
import org.eclipse.core.databinding.observable.value.IObservableValue;
17
import org.eclipse.core.databinding.observable.value.IObservableValue;
18
import org.eclipse.core.databinding.property.value.IValueProperty;
18
import org.eclipse.core.databinding.property.value.IValueProperty;
19
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
19
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
20
import org.eclipse.jface.databinding.swt.ComboProperties;
21
import org.eclipse.jface.databinding.swt.SWTObservables;
20
import org.eclipse.jface.databinding.swt.SWTObservables;
21
import org.eclipse.jface.databinding.swt.WidgetProperties;
22
import org.eclipse.jface.internal.databinding.swt.ComboSelectionProperty;
22
import org.eclipse.jface.internal.databinding.swt.ComboSelectionProperty;
23
import org.eclipse.jface.internal.databinding.swt.ComboTextProperty;
23
import org.eclipse.jface.internal.databinding.swt.ComboTextProperty;
24
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
24
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
Lines 56-63 Link Here
56
	}
56
	}
57
57
58
	public void testSetValueWithNull() {
58
	public void testSetValueWithNull() {
59
		testSetValueWithNull(ComboProperties.text());
59
		testSetValueWithNull(WidgetProperties.text());
60
		testSetValueWithNull(ComboProperties.selection());
60
		testSetValueWithNull(WidgetProperties.selection());
61
	}
61
	}
62
62
63
	protected void testSetValueWithNull(IValueProperty property) {
63
	protected void testSetValueWithNull(IValueProperty property) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/LabelObservableValueTest.java (-2 / +2 lines)
Lines 21-28 Link Here
21
import org.eclipse.jface.databinding.conformance.ObservableDelegateTest;
21
import org.eclipse.jface.databinding.conformance.ObservableDelegateTest;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.LabelProperties;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Label;
28
import org.eclipse.swt.widgets.Label;
Lines 93-99 Link Here
93
		}
93
		}
94
94
95
		public IObservableValue createObservableValue(Realm realm) {
95
		public IObservableValue createObservableValue(Realm realm) {
96
			return LabelProperties.text().observe(realm, label);
96
			return WidgetProperties.text().observe(realm, label);
97
		}
97
		}
98
98
99
		public void change(IObservable observable) {
99
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/TextObservableValueTest.java (-7 / +7 lines)
Lines 17-23 Link Here
17
import org.eclipse.core.databinding.observable.Realm;
17
import org.eclipse.core.databinding.observable.Realm;
18
import org.eclipse.core.databinding.observable.value.IObservableValue;
18
import org.eclipse.core.databinding.observable.value.IObservableValue;
19
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
19
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
20
import org.eclipse.jface.databinding.swt.TextProperties;
20
import org.eclipse.jface.databinding.swt.WidgetProperties;
21
import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
21
import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
22
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.SWT;
23
import org.eclipse.swt.widgets.Shell;
23
import org.eclipse.swt.widgets.Shell;
Lines 47-62 Link Here
47
	 */
47
	 */
48
	public void testConstructorUpdateEventTypes() {
48
	public void testConstructorUpdateEventTypes() {
49
		try {
49
		try {
50
			TextProperties.text(SWT.None);
50
			WidgetProperties.text(SWT.None);
51
			TextProperties.text(SWT.FocusOut);
51
			WidgetProperties.text(SWT.FocusOut);
52
			TextProperties.text(SWT.Modify);
52
			WidgetProperties.text(SWT.Modify);
53
			assertTrue(true);
53
			assertTrue(true);
54
		} catch (IllegalArgumentException e) {
54
		} catch (IllegalArgumentException e) {
55
			fail();
55
			fail();
56
		}
56
		}
57
57
58
		try {
58
		try {
59
			TextProperties.text(SWT.Verify);
59
			WidgetProperties.text(SWT.Verify);
60
			fail();
60
			fail();
61
		} catch (IllegalArgumentException e) {
61
		} catch (IllegalArgumentException e) {
62
			assertTrue(true);
62
			assertTrue(true);
Lines 69-75 Link Here
69
	 * @throws Exception
69
	 * @throws Exception
70
	 */
70
	 */
71
	public void testGetValueBeforeFocusOutChangeEventsFire() throws Exception {
71
	public void testGetValueBeforeFocusOutChangeEventsFire() throws Exception {
72
		IObservableValue observableValue = TextProperties.text(SWT.FocusOut)
72
		IObservableValue observableValue = WidgetProperties.text(SWT.FocusOut)
73
				.observe(Realm.getDefault(), text);
73
				.observe(Realm.getDefault(), text);
74
		observableValue.addValueChangeListener(listener);
74
		observableValue.addValueChangeListener(listener);
75
75
Lines 96-102 Link Here
96
	}
96
	}
97
97
98
	public void testDispose() throws Exception {
98
	public void testDispose() throws Exception {
99
		IObservableValue observableValue = TextProperties.text(SWT.Modify)
99
		IObservableValue observableValue = WidgetProperties.text(SWT.Modify)
100
				.observe(Realm.getDefault(), text);
100
				.observe(Realm.getDefault(), text);
101
		ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker();
101
		ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker();
102
		observableValue.addValueChangeListener(testCounterValueChangeListener);
102
		observableValue.addValueChangeListener(testCounterValueChangeListener);
(-)src/org/eclipse/jface/tests/internal/databinding/swt/StyledTextObservableValueFocusOutTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.core.databinding.observable.value.IObservableValue;
22
import org.eclipse.core.databinding.observable.value.IObservableValue;
23
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
24
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
25
import org.eclipse.jface.databinding.swt.StyledTextProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.custom.StyledText;
27
import org.eclipse.swt.custom.StyledText;
28
import org.eclipse.swt.widgets.Shell;
28
import org.eclipse.swt.widgets.Shell;
Lines 55-61 Link Here
55
		}
55
		}
56
56
57
		public IObservableValue createObservableValue(Realm realm) {
57
		public IObservableValue createObservableValue(Realm realm) {
58
			return StyledTextProperties.text(SWT.FocusOut).observe(realm, text);
58
			return WidgetProperties.text(SWT.FocusOut).observe(realm, text);
59
		}
59
		}
60
60
61
		public Object getValueType(IObservableValue observable) {
61
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/CComboObservableValueSelectionTest.java (-2 / +2 lines)
Lines 22-30 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
25
import org.eclipse.jface.databinding.swt.CComboProperties;
26
import org.eclipse.jface.databinding.swt.ISWTObservable;
25
import org.eclipse.jface.databinding.swt.ISWTObservable;
27
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.SWTObservables;
27
import org.eclipse.jface.databinding.swt.WidgetProperties;
28
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
28
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
29
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
30
import org.eclipse.swt.custom.CCombo;
30
import org.eclipse.swt.custom.CCombo;
Lines 91-97 Link Here
91
		}
91
		}
92
92
93
		public IObservableValue createObservableValue(Realm realm) {
93
		public IObservableValue createObservableValue(Realm realm) {
94
			return new SWTObservableValueDecorator(CComboProperties.selection()
94
			return new SWTObservableValueDecorator(WidgetProperties.selection()
95
					.observe(realm, combo), combo);
95
					.observe(realm, combo), combo);
96
		}
96
		}
97
97
(-)src/org/eclipse/jface/tests/internal/databinding/swt/CComboSingleSelectionObservableValueTest.java (-2 / +2 lines)
Lines 21-28 Link Here
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.CComboProperties;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
26
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
27
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.SWT;
28
import org.eclipse.swt.custom.CCombo;
28
import org.eclipse.swt.custom.CCombo;
Lines 78-84 Link Here
78
		}
78
		}
79
79
80
		public IObservableValue createObservableValue(Realm realm) {
80
		public IObservableValue createObservableValue(Realm realm) {
81
			return CComboProperties.singleSelectionIndex()
81
			return WidgetProperties.singleSelectionIndex()
82
					.observe(realm, combo);
82
					.observe(realm, combo);
83
		}
83
		}
84
84
(-)src/org/eclipse/jface/tests/internal/databinding/swt/SpinnerObservableValueMinTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SpinnerProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Shell;
28
import org.eclipse.swt.widgets.Shell;
Lines 97-103 Link Here
97
		}
97
		}
98
98
99
		public IObservableValue createObservableValue(Realm realm) {
99
		public IObservableValue createObservableValue(Realm realm) {
100
			return SpinnerProperties.minimum().observe(realm, spinner);
100
			return WidgetProperties.minimum().observe(realm, spinner);
101
		}
101
		}
102
102
103
		public void change(IObservable observable) {
103
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/CComboObservableValueTest.java (-3 / +3 lines)
Lines 18-26 Link Here
18
import org.eclipse.core.databinding.observable.value.IObservableValue;
18
import org.eclipse.core.databinding.observable.value.IObservableValue;
19
import org.eclipse.core.databinding.property.value.IValueProperty;
19
import org.eclipse.core.databinding.property.value.IValueProperty;
20
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
20
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
21
import org.eclipse.jface.databinding.swt.CComboProperties;
22
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
21
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
23
import org.eclipse.jface.databinding.swt.SWTObservables;
22
import org.eclipse.jface.databinding.swt.SWTObservables;
23
import org.eclipse.jface.databinding.swt.WidgetProperties;
24
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
24
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
25
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.custom.CCombo;
26
import org.eclipse.swt.custom.CCombo;
Lines 56-63 Link Here
56
	}
56
	}
57
57
58
	public void testSetValueWithNull() {
58
	public void testSetValueWithNull() {
59
		testSetValueWithNull(CComboProperties.text());
59
		testSetValueWithNull(WidgetProperties.text());
60
		testSetValueWithNull(CComboProperties.selection());
60
		testSetValueWithNull(WidgetProperties.selection());
61
	}
61
	}
62
62
63
	protected void testSetValueWithNull(IValueProperty property) {
63
	protected void testSetValueWithNull(IValueProperty property) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/TextObservableValueModifyTest.java (-2 / +2 lines)
Lines 21-27 Link Here
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
21
import org.eclipse.core.databinding.observable.value.IObservableValue;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.TextProperties;
24
import org.eclipse.jface.databinding.swt.WidgetProperties;
25
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.widgets.Shell;
26
import org.eclipse.swt.widgets.Shell;
27
import org.eclipse.swt.widgets.Text;
27
import org.eclipse.swt.widgets.Text;
Lines 54-60 Link Here
54
		}
54
		}
55
55
56
		public IObservableValue createObservableValue(Realm realm) {
56
		public IObservableValue createObservableValue(Realm realm) {
57
			return TextProperties.text(SWT.Modify).observe(realm, text);
57
			return WidgetProperties.text(SWT.Modify).observe(realm, text);
58
		}
58
		}
59
59
60
		public Object getValueType(IObservableValue observable) {
60
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ComboObservableValueSelectionTest.java (-2 / +2 lines)
Lines 22-30 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
25
import org.eclipse.jface.databinding.swt.ComboProperties;
26
import org.eclipse.jface.databinding.swt.ISWTObservable;
25
import org.eclipse.jface.databinding.swt.ISWTObservable;
27
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.SWTObservables;
27
import org.eclipse.jface.databinding.swt.WidgetProperties;
28
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
28
import org.eclipse.jface.internal.databinding.swt.SWTObservableValueDecorator;
29
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
30
import org.eclipse.swt.widgets.Combo;
30
import org.eclipse.swt.widgets.Combo;
Lines 93-99 Link Here
93
		}
93
		}
94
94
95
		public IObservableValue createObservableValue(Realm realm) {
95
		public IObservableValue createObservableValue(Realm realm) {
96
			return new SWTObservableValueDecorator(ComboProperties.selection()
96
			return new SWTObservableValueDecorator(WidgetProperties.selection()
97
					.observe(realm, combo), combo);
97
					.observe(realm, combo), combo);
98
		}
98
		}
99
99
(-)src/org/eclipse/jface/tests/internal/databinding/swt/SpinnerObservableValueMaxTest.java (-2 / +2 lines)
Lines 22-28 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
24
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SpinnerProperties;
25
import org.eclipse.jface.databinding.swt.WidgetProperties;
26
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.swt.widgets.Shell;
28
import org.eclipse.swt.widgets.Shell;
Lines 97-103 Link Here
97
		}
97
		}
98
98
99
		public IObservableValue createObservableValue(Realm realm) {
99
		public IObservableValue createObservableValue(Realm realm) {
100
			return SpinnerProperties.maximum().observe(realm, spinner);
100
			return WidgetProperties.maximum().observe(realm, spinner);
101
		}
101
		}
102
102
103
		public void change(IObservable observable) {
103
		public void change(IObservable observable) {
(-)src/org/eclipse/jface/tests/internal/databinding/swt/ButtonObservableValueTest.java (-2 / +2 lines)
Lines 22-30 Link Here
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
22
import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
23
import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
24
import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker;
25
import org.eclipse.jface.databinding.swt.ButtonProperties;
26
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
25
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
27
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.SWTObservables;
27
import org.eclipse.jface.databinding.swt.WidgetProperties;
28
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
28
import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
29
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
30
import org.eclipse.swt.widgets.Button;
30
import org.eclipse.swt.widgets.Button;
Lines 132-138 Link Here
132
		}
132
		}
133
133
134
		public IObservableValue createObservableValue(Realm realm) {
134
		public IObservableValue createObservableValue(Realm realm) {
135
			return ButtonProperties.selection().observe(realm, button);
135
			return WidgetProperties.selection().observe(realm, button);
136
		}
136
		}
137
137
138
		public Object getValueType(IObservableValue observable) {
138
		public Object getValueType(IObservableValue observable) {
(-)src/org/eclipse/jface/examples/databinding/snippets/Snippet025TableViewerWithPropertyDerivedColumns.java (-2 / +2 lines)
Lines 23-29 Link Here
23
import org.eclipse.core.databinding.observable.value.IObservableValue;
23
import org.eclipse.core.databinding.observable.value.IObservableValue;
24
import org.eclipse.core.databinding.property.Properties;
24
import org.eclipse.core.databinding.property.Properties;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
25
import org.eclipse.jface.databinding.swt.SWTObservables;
26
import org.eclipse.jface.databinding.swt.TextProperties;
26
import org.eclipse.jface.databinding.swt.WidgetProperties;
27
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
27
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
28
import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
28
import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
29
import org.eclipse.jface.databinding.viewers.SelectionProviderProperties;
29
import org.eclipse.jface.databinding.viewers.SelectionProviderProperties;
Lines 250-256 Link Here
250
			IObservableValue masterSelection = SelectionProviderProperties
250
			IObservableValue masterSelection = SelectionProviderProperties
251
					.singleSelection().observe(peopleViewer);
251
					.singleSelection().observe(peopleViewer);
252
252
253
			dbc.bindValue(TextProperties.text(SWT.Modify).observe(nameText),
253
			dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(nameText),
254
					BeanProperties.value(Person.class, "name").observeDetail(
254
					BeanProperties.value(Person.class, "name").observeDetail(
255
							masterSelection), null, null);
255
							masterSelection), null, null);
256
256

Return to bug 194734