View Javadoc

1   /*
2       Jiffie Plugin for Jameleon - An Internet Explorer plug-in for Jameleon
3       Copyright (C) 2004 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.util;
21  
22  import net.sf.jiffie.InternetExplorer;
23  
24  import java.util.Vector;
25  
26  /***
27   * This interface defines methods for dealing with multiple open browser windows. It enables to manage the storage of
28   * multiple browser windows (InternetExplorer instances).
29   * todo Implement access to a browser window by it's window title (instead of index only)
30   */
31  public interface BrowserCache {
32  
33      public Vector getBrowserCache();
34  
35      /***
36       * Add a browser instance to the cache. Usually newly opened browser windows should be added to the cache.
37       * @param ie The browser window that should be added to the cache.
38       */
39      void addBrowser(InternetExplorer ie);
40  
41      /***
42       * Remove a browser instance from the cache. This should usually happen on quit of the browser window.
43       * @param ie The browser window that should be removed from the cache.
44       */
45      void removeBrowser(InternetExplorer ie);
46  
47      /***
48       * Get the first browser window from the cache. The first instance is usually the "root" of all subsequently opened
49       * browser windows.
50       * @return The first browse window that is in the cache.
51       */
52      public InternetExplorer getFirstBrowser();
53  
54      /***
55       * Get the i-th browser window from the cache. If all opened browser windows are added to the cache, it returns the
56       * i-th browser window that has been opened.
57       * @param i The index of the browser window in the cache. This is usually the i-th browser window opened.
58       * @return The i-th browser window.
59       */
60      public InternetExplorer getBrowserAt(int i);
61  
62      /***
63       * Get the browser window from the cache with the matching title. 
64       * @param title The title of the browser window in the cache.
65       * @return The matching browser window.
66       */
67      public InternetExplorer getBrowserWithTitle(String title);
68  }