1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.jameleon.plugin.jiffie.tags;
21
22 import net.sf.jameleon.plugin.jiffie.IEFunctionTag;
23
24 /***
25 * Sets focus on an opened <b>IE</b> window with the provided title or index.
26 * If the title or browserIndex are not provided, then the window at
27 * the top of the list will be activated. The window at the top of
28 * the list is usually the most recently opened window, but can be
29 * the most recently activated window depending on if this tag was
30 * used before in the same session.
31 *
32 * @jameleon.function name="ie-set-window-focus" type="navigation"
33 */
34 public class IESetWindowFocusTag extends IEFunctionTag {
35
36 /***
37 * The title of the desired window to set focus on
38 * @jameleon.attribute
39 */
40 protected String title;
41 /***
42 * The nth window in the list of open windows
43 * @jameleon.attribute
44 */
45 protected Integer browserIndex;
46
47 public void testBlock() {
48 if (title != null) {
49 activateBrowserWithTitle(title);
50 }else if ( browserIndex != null ) {
51 activateBrowserWithIndex(browserIndex.intValue());
52 }else{
53 activateLastNewWindow();
54 }
55 }
56 }