View Javadoc
1 /* 2 * (C) 2002 David Carr david@carr.name 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 */ 18 19 package net.sourceforge.mflow.api; 20 21 import java.lang.reflect.InvocationTargetException; 22 23 import javax.swing.Icon; 24 import javax.swing.JDialog; 25 26 /*** 27 * @author carrd 28 */ 29 public interface Plugin { 30 /*** 31 * Get the version number for this plugin. 32 * 33 * @return The version number. 34 */ 35 String getVersion(); 36 37 /*** 38 * Get the class name for this plugin. 39 * 40 * @return The class name. 41 */ 42 String getClassName(); 43 44 /*** 45 * Get the name of this plugin. 46 * 47 * @return The name. 48 */ 49 String getName(); 50 51 /*** 52 * Get the type of this plugin. 53 * 54 * @return The type. 55 */ 56 String getType(); 57 58 /*** 59 * Get the description of this plugin. 60 * 61 * @return The description, or <b>null</b> if no description is available. 62 */ 63 String getDescription(); 64 65 /*** 66 * Get the icon for this plugin. 67 * 68 * @return The icon, or <b>null</b> if no icon is available. 69 */ 70 Icon getIcon(); 71 72 /*** 73 * @return true if the plugin is currently loaded. 74 */ 75 boolean isLoaded(); 76 77 /*** 78 * Load the plugin. This method attempts to load the plugin entry-point class 79 * and create an instance of it. The entry-point class must have a public 80 * constructor that accepts a <code>Plugin</code> object as an argument; it 81 * will be invoked with a reference to this plugin. 82 * 83 * @throws InvocationTargetException If the plugin could not be loaded. 84 */ 85 void load() throws InvocationTargetException; 86 87 /*** 88 * Dispose of the plugin. This method calls the <code>dispose()</code> 89 * method on the plugin entry-point class, if there is one, and then destroys 90 * its reference to the class. The class can be re-loaded via another call to 91 * <code>load()</code>. 92 */ 93 void dispose(); 94 95 /*** 96 * Get a reference to the instance of the plugin entry-point class. 97 * 98 * @return The instance, or <code>null</code> if the class has not yet been 99 * loaded. 100 */ 101 Object getPluginObject(); 102 103 /*** 104 * Gets an instance of the configuration dialog for the plugin, if any. 105 * 106 * @return The instance, or <code>null</code> if the plugin has not yet 107 * been loaded or has no configuration dialog. 108 */ 109 JDialog getConfigurationDialog(); 110 }

This page was automatically generated by Maven