1 /*==================================================================== 2 3 Objectweb Browser Framework 4 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL 5 Contact: openccm@objectweb.org 6 7 This library is free software; you can redistribute it and/or 8 modify it under the terms of the GNU Lesser General Public 9 License as published by the Free Software Foundation; either 10 version 2.1 of the License, or any later version. 11 12 This library is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 Lesser General Public License for more details. 16 17 You should have received a copy of the GNU Lesser General Public 18 License along with this library; if not, write to the Free Software 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 20 USA 21 22 Initial developer(s): Philippe Merle, Jerome Moroy. 23 Contributor(s): ______________________________________. 24 25 ====================================================================*/ 26 27 package org.objectweb.util.browser.api; 28 29 import javax.swing.JPanel; 30 31 /** 32 * <p> 33 * Contains all the methods called by the console on the viewPanel.<br> 34 * In order to define a panel, you can have a look to the corresponding 35 * <a HREF="../../../../../../resources/browser_dtd.html#panel">DTD element</a> or to 36 * an <a HREF="package-summary.html#xml">XML example.</a> 37 * </p> 38 * 39 * <p> 40 * Example: 41 * <pre> 42 * public void 43 * selected(TreeView treeView) 44 * { 45 * String[] titre = {"Keys","Values"}; 46 * Properties properties = (Properties)treeView.getSelectedObject(); 47 * Enumeration keys = properties.keys(); 48 * Enumeration elements = properties.elements(); 49 * String[][] contenu = new String[properties.size()][2]; 50 * for (int i = 0; i < properties.size(); i++) { 51 * contenu[i] = new String[]{(String) keys.nextElement(),(String)elements.nextElement()}; 52 * } 53 * panel_.add(new JScrollPane(new JTable(contenu,titre))); 54 * } 55 * 56 * public JPanel 57 * getPanel() 58 * { 59 * return panel_; 60 * } 61 * 62 * public void 63 * unselected(TreeView treeView) 64 * { 65 * // Nothing to do 66 * } 67 * </pre> 68 * This panel creates a JTable containing all the property registered in 69 * a <code>java.util.Properties<code> object. 70 * This JTable is divided into two parts: A "key" column containing the 71 * key values and a "value" column containing the values of the property. 72 * </p> 73 * 74 * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>, 75 * <a HREF="mailto:Jerome.Moroy@lifl.fr">Jérôme Moroy</a> 76 * 77 * @version 0.2 78 */ 79 public interface Panel 80 extends View 81 { 82 83 /** 84 * Invokes just after instanciation. 85 * 86 * @param treeview A view on the tree. 87 */ 88 public void selected(TreeView treeview); 89 90 /** 91 * Provides the panel to display. 92 * 93 * @return The panel to display. 94 */ 95 public JPanel getPanel(); 96 97 /** 98 * Invokes just before removing. 99 * 100 * @param treeview A view on the tree. 101 */ 102 public void unselected(TreeView treeview); 103 104 }