|
Lines 17-23
Link Here
|
| 17 |
qx.Class.define( "org.eclipse.swt.ToolItemUtil", { |
17 |
qx.Class.define( "org.eclipse.swt.ToolItemUtil", { |
| 18 |
|
18 |
|
| 19 |
statics : { |
19 |
statics : { |
| 20 |
createSeparator : function( id, parent, isFlat ) { |
20 |
createSeparator : function( id, parent, index, isFlat ) { |
| 21 |
var sep = new qx.ui.toolbar.Separator(); |
21 |
var sep = new qx.ui.toolbar.Separator(); |
| 22 |
var line = sep.getFirstChild(); |
22 |
var line = sep.getFirstChild(); |
| 23 |
sep.setUserData( "line", line ); |
23 |
sep.setUserData( "line", line ); |
|
Lines 27-33
Link Here
|
| 27 |
} |
27 |
} |
| 28 |
org.eclipse.swt.WidgetManager.getInstance().add( sep, id, false ); |
28 |
org.eclipse.swt.WidgetManager.getInstance().add( sep, id, false ); |
| 29 |
sep.setParent( parent ); |
29 |
sep.setParent( parent ); |
| 30 |
parent.add( sep ); |
30 |
parent.addAt( sep, index ); |
| 31 |
}, |
31 |
}, |
| 32 |
|
32 |
|
| 33 |
setControl : function( sep, control ) { |
33 |
setControl : function( sep, control ) { |
|
Lines 45-54
Link Here
|
| 45 |
} |
45 |
} |
| 46 |
}, |
46 |
}, |
| 47 |
|
47 |
|
| 48 |
createRadio : function( id, parent, selected, neighbour ) { |
48 |
createRadio : function( id, parent, index, selected, neighbour ) { |
| 49 |
var radio = new qx.ui.toolbar.RadioButton(); |
49 |
var radio = new qx.ui.toolbar.RadioButton(); |
| 50 |
radio.setDisableUncheck( true ); |
50 |
radio.setDisableUncheck( true ); |
| 51 |
parent.add( radio ); |
51 |
parent.addAt( radio, index ); |
| 52 |
if( neighbour ) { |
52 |
if( neighbour ) { |
| 53 |
radio.radioManager = neighbour.radioManager; |
53 |
radio.radioManager = neighbour.radioManager; |
| 54 |
} else { |
54 |
} else { |
|
Lines 66-72
Link Here
|
| 66 |
org.eclipse.swt.ToolItemUtil._registerMouseListeners( radio ); |
66 |
org.eclipse.swt.ToolItemUtil._registerMouseListeners( radio ); |
| 67 |
}, |
67 |
}, |
| 68 |
|
68 |
|
| 69 |
createPush : function( id, parent, isFlat ) { |
69 |
createPush : function( id, parent, index, isFlat ) { |
| 70 |
var push = new qx.ui.toolbar.Button(); |
70 |
var push = new qx.ui.toolbar.Button(); |
| 71 |
if( isFlat ) { |
71 |
if( isFlat ) { |
| 72 |
push.addState( "rwt_FLAT" ); |
72 |
push.addState( "rwt_FLAT" ); |
|
Lines 75-87
Link Here
|
| 75 |
push.setLabel( "(empty)" ); |
75 |
push.setLabel( "(empty)" ); |
| 76 |
push.getLabelObject().setMode( qx.constant.Style.LABEL_MODE_HTML ); |
76 |
push.getLabelObject().setMode( qx.constant.Style.LABEL_MODE_HTML ); |
| 77 |
push.setLabel( "" ); |
77 |
push.setLabel( "" ); |
| 78 |
parent.add( push ); |
78 |
parent.addAt( push, index ); |
| 79 |
org.eclipse.swt.WidgetManager.getInstance().add( push, id, false ); |
79 |
org.eclipse.swt.WidgetManager.getInstance().add( push, id, false ); |
| 80 |
org.eclipse.swt.ToolItemUtil._registerMouseListeners( push ); |
80 |
org.eclipse.swt.ToolItemUtil._registerMouseListeners( push ); |
| 81 |
}, |
81 |
}, |
| 82 |
|
82 |
|
| 83 |
createDropDown : function( id, parent, isFlat ) { |
83 |
createDropDown : function( id, parent, index, isFlat ) { |
| 84 |
org.eclipse.swt.ToolItemUtil.createPush( id, parent, isFlat ); |
84 |
org.eclipse.swt.ToolItemUtil.createPush( id, parent, index, isFlat ); |
| 85 |
var button |
85 |
var button |
| 86 |
= org.eclipse.swt.WidgetManager.getInstance().findWidgetById( id ); |
86 |
= org.eclipse.swt.WidgetManager.getInstance().findWidgetById( id ); |
| 87 |
var dropDown = new qx.ui.toolbar.Button( "", "widget/arrows/down.gif" ); |
87 |
var dropDown = new qx.ui.toolbar.Button( "", "widget/arrows/down.gif" ); |
|
Lines 90-96
Link Here
|
| 90 |
if( isFlat ) { |
90 |
if( isFlat ) { |
| 91 |
dropDown.addState( "rwt_FLAT" ); |
91 |
dropDown.addState( "rwt_FLAT" ); |
| 92 |
} |
92 |
} |
| 93 |
parent.add( dropDown ); |
93 |
parent.addAfter( dropDown, button ); |
| 94 |
var dropDownId = org.eclipse.swt.ToolItemUtil._getDropDownId( button ); |
94 |
var dropDownId = org.eclipse.swt.ToolItemUtil._getDropDownId( button ); |
| 95 |
org.eclipse.swt.WidgetManager.getInstance().add( dropDown, dropDownId, false ); |
95 |
org.eclipse.swt.WidgetManager.getInstance().add( dropDown, dropDownId, false ); |
| 96 |
// Register enable listener that keeps enabled state of dropDown in sync |
96 |
// Register enable listener that keeps enabled state of dropDown in sync |
|
Lines 139-147
Link Here
|
| 139 |
} |
139 |
} |
| 140 |
}, |
140 |
}, |
| 141 |
|
141 |
|
| 142 |
createCheck : function( id, parent ) { |
142 |
createCheck : function( id, parent, index ) { |
| 143 |
var button = new qx.ui.toolbar.CheckBox(); |
143 |
var button = new qx.ui.toolbar.CheckBox(); |
| 144 |
parent.add( button ); |
144 |
parent.addAt( button, index ); |
| 145 |
org.eclipse.swt.WidgetManager.getInstance().add( button, id, false ); |
145 |
org.eclipse.swt.WidgetManager.getInstance().add( button, id, false ); |
| 146 |
org.eclipse.swt.ToolItemUtil._registerMouseListeners( button ); |
146 |
org.eclipse.swt.ToolItemUtil._registerMouseListeners( button ); |
| 147 |
}, |
147 |
}, |