01 /*
02 * Copyright (c) 1995-2010, The University of Sheffield. See the file
03 * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
04 *
05 * This file is part of GATE (see http://gate.ac.uk/), and is free
06 * software, licenced under the GNU Library General Public License,
07 * Version 2, June 1991 (in the distribution as file licence.html,
08 * and also available at http://gate.ac.uk/gate/licence.html).
09 *
10 * Valentin Tablan 09/03/2001
11 *
12 * $Id: Handle.java 12006 2009-12-01 17:24:28Z thomas_heitz $
13 *
14 */
15 package gate.gui;
16
17
18 import java.awt.Window;
19
20 import javax.swing.*;
21
22 import gate.event.ProgressListener;
23 import gate.event.StatusListener;
24
25 /**
26 * Interface for classes used to store the information about an open resource.
27 * Such information will include icon to be used for tree components,
28 * popup menu for right click events, etc.
29 */
30 public interface Handle extends ProgressListener, StatusListener {
31
32 public Icon getIcon();
33
34 public String getTitle();
35
36 /**
37 * Returns a GUI component to be used as a small viewer/editor, e.g. below
38 * the main tree in the Gate GUI for the selected resource
39 */
40 public JComponent getSmallView();
41
42 /**
43 * Returns the large view for this resource. This view will go into the main
44 * display area.
45 */
46 public JComponent getLargeView();
47
48 /**
49 * Returns <tt>true</tt> if the views have already been built for this handle.
50 * @return a <tt>boolean</tt> value.
51 */
52 public boolean viewsBuilt();
53
54 /**
55 * Called when this handle is not required any more.
56 */
57 public void cleanup();
58
59 /**
60 * A call to this method will cause the handle to destroy all the views built
61 * for the target resource.
62 *
63 */
64 public void removeViews();
65
66 public JPopupMenu getPopup();
67
68 public String getTooltipText();
69
70 public Object getTarget();
71
72 /**
73 * Returns the top level GUI component that is a parent to all other GUI
74 * components
75 */
76 public Window getWindow();
77 }
|