Lines 34-40
Link Here
|
34 |
this.control = control; |
34 |
this.control = control; |
35 |
this.attribute = attribute; |
35 |
this.attribute = attribute; |
36 |
if (!attribute.equals(SWTProperties.ENABLED) |
36 |
if (!attribute.equals(SWTProperties.ENABLED) |
37 |
&& !attribute.equals(SWTProperties.VISIBLE)) { |
37 |
&& !attribute.equals(SWTProperties.VISIBLE) && !attribute.equals(SWTProperties.TOOLTIP_TEXT)) { |
38 |
throw new IllegalArgumentException(); |
38 |
throw new IllegalArgumentException(); |
39 |
} |
39 |
} |
40 |
} |
40 |
} |
Lines 45-62
Link Here
|
45 |
control.setEnabled(((Boolean) value).booleanValue()); |
45 |
control.setEnabled(((Boolean) value).booleanValue()); |
46 |
} else if (attribute.equals(SWTProperties.VISIBLE)) { |
46 |
} else if (attribute.equals(SWTProperties.VISIBLE)) { |
47 |
control.setVisible(((Boolean) value).booleanValue()); |
47 |
control.setVisible(((Boolean) value).booleanValue()); |
|
|
48 |
} else if (attribute.equals(SWTProperties.TOOLTIP_TEXT)) { |
49 |
control.setToolTipText((String) value); |
48 |
} |
50 |
} |
49 |
fireValueChange(Diffs.createValueDiff(oldValue, value)); |
51 |
fireValueChange(Diffs.createValueDiff(oldValue, value)); |
50 |
} |
52 |
} |
51 |
|
53 |
|
52 |
public Object doGetValue() { |
54 |
public Object doGetValue() { |
53 |
boolean value = attribute.equals(SWTProperties.ENABLED) ? control |
55 |
if (attribute.equals(SWTProperties.ENABLED)) { |
54 |
.getEnabled() : control.getVisible(); |
56 |
return control.getEnabled() ? Boolean.TRUE : Boolean.FALSE; |
55 |
return value ? Boolean.TRUE : Boolean.FALSE; |
57 |
} |
|
|
58 |
if (attribute.equals(SWTProperties.VISIBLE)) { |
59 |
return control.getVisible() ? Boolean.TRUE : Boolean.FALSE; |
60 |
} |
61 |
return control.getToolTipText(); |
56 |
} |
62 |
} |
57 |
|
63 |
|
58 |
public Object getValueType() { |
64 |
public Object getValueType() { |
59 |
return Boolean.TYPE; |
65 |
return attribute.equals(SWTProperties.TOOLTIP_TEXT) ? String.class : Boolean.TYPE; |
60 |
} |
66 |
} |
61 |
|
67 |
|
62 |
} |
68 |
} |