01: /*
02: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
03: * for visualizing and manipulating spatial features with geometry and attributes.
04: *
05: * Copyright (C) 2003 Vivid Solutions
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or (at your option) any later version.
11: *
12: * This program 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
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20: *
21: * For more information, contact:
22: *
23: * Vivid Solutions
24: * Suite #1A
25: * 2328 Government Street
26: * Victoria BC V8T 5G5
27: * Canada
28: *
29: * (250)385-6040
30: * www.vividsolutions.com
31: */
32:
33: package com.vividsolutions.jump.workbench.plugin;
34:
35: /**
36: * <p> Plug-ins are code modules that can be easily added to or
37: * removed from JUMP Workbench. For example, each menu item in the
38: * JUMP Workbench is a PlugIn. Typically plug-ins are executed with a
39: * menu item -- FeatureInstaller has methods for adding plug-ins as
40: * menu items. Alternatively, a plug-in need not be associated with a
41: * menu-item; it might, for example, simply run some code when the
42: * Workbench starts up.
43: * </p>
44: *
45: * <p>
46: * "Built-in" plug-ins are configured in a Setup class. Third-party plug-ins reside
47: * in a JAR file that also contains an Extension class that configures them.
48: * During development, third-party plug-ins may be specified in the
49: * workbench-properties.xml file, to avoid having to build a JAR file.
50: * </p>
51: *
52: * @see com.vividsolutions.jump.workbench.Setup
53: * @see Extension
54: * @see PlugInManager
55: */
56: public interface PlugIn {
57: /**
58: * Called when Workbench starts up to allow plugins to initialize themselves.
59: */
60: public void initialize(PlugInContext context) throws Exception;
61:
62: /**
63: * Performs the action for this plugin.
64: * For threaded plugins with dialogs, this method contains the code to
65: * invoke the dialog. If the user cancels the dialog, this method
66: * should return <code>false</code> to prevent the run method
67: * from being called.
68: *
69: * @return true if the action completed, false if it was aborted.
70: * Used by ThreadedPlugIns to indicate that their #run method needn't be
71: * called next.
72: * @throws Exception if a problem occurs during plug-in execution
73: * @see ThreadedPlugIn
74: */
75: public boolean execute(PlugInContext context) throws Exception;
76:
77: /**
78: * Returns a very brief description of this PlugIn e.g. for display as a menu item
79: * @return the name of this PlugIn
80: */
81: public String getName();
82: }
|