(itemObject: GObject)
| 285 | } |
| 286 | |
| 287 | private handleItemClick(itemObject: GObject): void { |
| 288 | if (!(itemObject instanceof GButton)) { |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | if (itemObject.grayed) { |
| 293 | this._list.selectedIndex = -1; |
| 294 | return; |
| 295 | } |
| 296 | |
| 297 | const c = itemObject.getController('checked'); |
| 298 | if (c && c.selectedIndex !== 0) { |
| 299 | if (c.selectedIndex === 1) { |
| 300 | c.selectedIndex = 2; |
| 301 | } else { |
| 302 | c.selectedIndex = 1; |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | const r = this._contentPane.parent as GRoot | null; |
| 307 | if (r) { |
| 308 | r.hidePopup(this._contentPane); |
| 309 | } |
| 310 | |
| 311 | const handler = itemObject.data as SimpleHandler | null; |
| 312 | if (handler) { |
| 313 | if (typeof handler === 'function') { |
| 314 | handler(); |
| 315 | } else if (typeof handler.run === 'function') { |
| 316 | handler.run(); |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | private onAddedToStage(): void { |
| 322 | this._list.selectedIndex = -1; |
no test coverage detected