|
Link Here
|
| 170 |
widget.destroy(); |
170 |
widget.destroy(); |
| 171 |
}, |
171 |
}, |
| 172 |
|
172 |
|
|
|
173 |
testCreateMenuItemByProtocolAtPosition : function() { |
| 174 |
var menu = createPopUpMenuByProtocol( "w3" ); |
| 175 |
menu.setHasShowListener( true ); |
| 176 |
menu._menuShown(); |
| 177 |
|
| 178 |
createMenuItemByProtocol( "w4", "w3", [ "PUSH" ] ); |
| 179 |
createMenuItemByProtocol( "w5", "w3", [ "PUSH" ] ); |
| 180 |
var item = createMenuItemByProtocol( "w6", "w3", [ "PUSH" ], 1 ); |
| 181 |
|
| 182 |
assertEquals( 0, menu._layout.indexOf( menu._preItem ) ); |
| 183 |
assertEquals( 2, menu._layout.indexOf( item ) ); |
| 184 |
menu.destroy(); |
| 185 |
}, |
| 186 |
|
| 173 |
testCreateMenuItemWithMnemonicByProtocol : function() { |
187 |
testCreateMenuItemWithMnemonicByProtocol : function() { |
| 174 |
var menu = createPopUpMenuByProtocol( "w3" ); |
188 |
var menu = createPopUpMenuByProtocol( "w3" ); |
| 175 |
var item = createMenuItemByProtocol( "w4", "w3", [ "PUSH" ] ); |
189 |
var item = createMenuItemByProtocol( "w4", "w3", [ "PUSH" ] ); |
|
Link Here
|
| 1833 |
return ObjectRegistry.getObject( id ); |
1847 |
return ObjectRegistry.getObject( id ); |
| 1834 |
}; |
1848 |
}; |
| 1835 |
|
1849 |
|
| 1836 |
var createMenuItemByProtocol = function( id, parentId, style ) { |
1850 |
var createMenuItemByProtocol = function( id, parentId, style, index ) { |
| 1837 |
MessageProcessor.processOperation( { |
1851 |
MessageProcessor.processOperation( { |
| 1838 |
"target" : id, |
1852 |
"target" : id, |
| 1839 |
"action" : "create", |
1853 |
"action" : "create", |
|
Link Here
|
| 1841 |
"properties" : { |
1855 |
"properties" : { |
| 1842 |
"style" : style, |
1856 |
"style" : style, |
| 1843 |
"parent" : parentId, |
1857 |
"parent" : parentId, |
| 1844 |
"index" : 0 |
1858 |
"index" : index ? index : 0 |
| 1845 |
} |
1859 |
} |
| 1846 |
} ); |
1860 |
} ); |
| 1847 |
return ObjectRegistry.getObject( id ); |
1861 |
return ObjectRegistry.getObject( id ); |