PageRenderTime 257ms CodeModel.GetById 121ms app.highlight 10ms RepoModel.GetById 121ms app.codeStats 0ms

/src/mpv5/pluginhandling/MP5Plugin.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 89 lines | 16 code | 12 blank | 61 comment | 0 complexity | f1f95eb3fef7c81b9ff0fdb0dedaf81b MD5 | raw file
 1/*
 2 *  This file is part of YaBS.
 3 *
 4 *      YaBS 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 3 of the License, or
 7 *      (at your option) any later version.
 8 *
 9 *      YaBS 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 YaBS.  If not, see <http://www.gnu.org/licenses/>.
16 */
17package mpv5.pluginhandling;
18
19import java.awt.Image;
20import mpv5.YabsView;
21import mpv5.ui.frames.MPView;
22
23/**
24 * This class is to be implemented on MP5 plugins
25 *  
26 */
27public interface MP5Plugin {
28
29    /**
30     * Initializes the plugin
31     * @param frame
32     * @return
33     */
34    public YabsPlugin load(MPView frame);
35
36    /**
37     * Unloads the plugin
38     */
39    public abstract void unload();
40
41    /**
42     *
43     * @return The name of the plugin
44     */
45    public abstract String getName();
46
47    /**
48     *
49     * @return The vendor of the plugin
50     */
51    public abstract String getVendor();
52
53    /**
54     *
55     * @return The uid of the plugin, should be randomly generated,
56     * <br/>to be unique for each instance of the plugin!
57     */
58    public abstract Long getUID();
59
60    /**
61     * Check whether this plugin is enabled
62     * @return True if the plugin is to be loaded
63     */
64    public abstract boolean isEnabled();
65
66    /**
67     * Check whether this plugin inherits <code>JPanel</code> and shall be displayed on the main tab pane
68     * @return True if the plugin is to be displayed on the main tab pane
69     */
70    public abstract boolean isComponent();
71
72    /**
73     * Check whether this plugin is a <code>Runnable<code/>
74     * @return TRUE if this is a {@link Runnable}
75     */
76    public abstract boolean isRunnable();
77
78    /**
79     * Inidcates whether the plugin has bee previously loaded
80     * @return TRUE if {@link MP5Plugin#load(MP5View)} has been called
81     */
82    public abstract boolean isLoaded();
83
84    /**
85     * If this returns null, a default icon is used to represent this plugin
86     * @return An Icon which graphically represents the plugin
87     */
88    public abstract Image getIcon();
89}