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