tools/Jemmy/JemmyFX/src/org/jemmy/fx/control/MenuBarWrap.java

Print this page




  91         if (parent == null) {
  92             parent = new MenuItemParent(this) {
  93 
  94                 @Override
  95                 protected List getControls() {
  96                     return new FutureAction<>(getEnvironment(),()-> getControl().getMenus()).get();
  97                 }
  98             };
  99         }
 100         return parent;
 101     }
 102 
 103     /**
 104      * Allows to perform simple push and selection operations on the menu.
 105      *
 106      * @return
 107      */
 108     @As(MenuItem.class)
 109     public StringMenuOwner<MenuItem> asMenuOwner() {
 110         if (menuOwner == null) {
 111             menuOwner = new StringMenuOwnerImpl(this, this.as(Parent.class, Menu.class));
 112         }
 113         return menuOwner;
 114     }
 115 
 116     private Collapsible collapsible = null;
 117 
 118     /**
 119      * Collapses ass the sub-menus.
 120      *
 121      * @return
 122      */
 123     @As
 124     public Collapsible asCollapsible() {
 125         if (collapsible == null) {
 126             collapsible = () -> new FutureAction<>(getEnvironment(),() -> getControl().getMenus().stream().forEach(m -> m.hide()));
 127         }
 128         return collapsible;
 129     }
 130 
 131     @Override


  91         if (parent == null) {
  92             parent = new MenuItemParent(this) {
  93 
  94                 @Override
  95                 protected List getControls() {
  96                     return new FutureAction<>(getEnvironment(),()-> getControl().getMenus()).get();
  97                 }
  98             };
  99         }
 100         return parent;
 101     }
 102 
 103     /**
 104      * Allows to perform simple push and selection operations on the menu.
 105      *
 106      * @return
 107      */
 108     @As(MenuItem.class)
 109     public StringMenuOwner<MenuItem> asMenuOwner() {
 110         if (menuOwner == null) {
 111             menuOwner = new StringMenuOwnerImpl(this, (Parent <Menu>)this.as(Parent.class, Menu.class));
 112         }
 113         return menuOwner;
 114     }
 115 
 116     private Collapsible collapsible = null;
 117 
 118     /**
 119      * Collapses ass the sub-menus.
 120      *
 121      * @return
 122      */
 123     @As
 124     public Collapsible asCollapsible() {
 125         if (collapsible == null) {
 126             collapsible = () -> new FutureAction<>(getEnvironment(),() -> getControl().getMenus().stream().forEach(m -> m.hide()));
 127         }
 128         return collapsible;
 129     }
 130 
 131     @Override