< prev index next >

tools/Jemmy/JemmyFX/src/org/jemmy/fx/WindowList.java

Print this page




  30 import java.util.LinkedList;
  31 import java.util.List;
  32 import javafx.stage.Window;
  33 import org.jemmy.action.GetAction;
  34 import org.jemmy.lookup.ControlList;
  35 
  36 
  37 /**
  38  * Allows to search among windows.
  39  * @author shura
  40  */
  41 class WindowList implements ControlList {
  42 
  43     @Override
  44     public List<?> getControls() {
  45         GetAction<List<?>> scenes = new GetAction<List<?>>() {
  46 
  47             @Override
  48             public void run(Object... parameters) {
  49                 LinkedList<Window> res = new LinkedList<Window>();
  50                 Iterator<Window> windows = Window.impl_getWindows();
  51                 while(windows.hasNext()) {
  52                     res.add(windows.next());
  53                 }
  54                 setResult(res);
  55             }
  56         };
  57         try {
  58             Root.ROOT.getEnvironment().getExecutor().execute(Root.ROOT.getEnvironment(), true, scenes);
  59             return scenes.getResult();
  60         } catch (Throwable th) {
  61             th.printStackTrace(System.err);
  62             return new ArrayList();
  63         }
  64     }
  65 }


  30 import java.util.LinkedList;
  31 import java.util.List;
  32 import javafx.stage.Window;
  33 import org.jemmy.action.GetAction;
  34 import org.jemmy.lookup.ControlList;
  35 
  36 
  37 /**
  38  * Allows to search among windows.
  39  * @author shura
  40  */
  41 class WindowList implements ControlList {
  42 
  43     @Override
  44     public List<?> getControls() {
  45         GetAction<List<?>> scenes = new GetAction<List<?>>() {
  46 
  47             @Override
  48             public void run(Object... parameters) {
  49                 LinkedList<Window> res = new LinkedList<Window>();
  50                 res.addAll(Window.getWindows());



  51                 setResult(res);
  52             }
  53         };
  54         try {
  55             Root.ROOT.getEnvironment().getExecutor().execute(Root.ROOT.getEnvironment(), true, scenes);
  56             return scenes.getResult();
  57         } catch (Throwable th) {
  58             th.printStackTrace(System.err);
  59             return new ArrayList();
  60         }
  61     }
  62 }
< prev index next >