View Javadoc

1   /*
2       Jiffie Plugin for Jameleon - An Internet Explorer plug-in for Jameleon
3       Copyright (C) 2004-2006 Christian W. Hargraves (engrean@hotmail.com) and
4                          Matthias Marschall (matthias@marschalls.de)
5   
6       This program is free software; you can redistribute it and/or modify
7       it under the terms of the GNU General Public License as published by
8       the Free Software Foundation; either version 2 of the License, or
9       (at your option) any later version.
10  
11      This program is distributed in the hope that it will be useful,
12      but WITHOUT ANY WARRANTY; without even the implied warranty of
13      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14      GNU General Public License for more details.
15  
16      You should have received a copy of the GNU General Public License
17      along with this program; if not, write to the Free Software
18      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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  }