PageRenderTime 263ms CodeModel.GetById 141ms app.highlight 3ms RepoModel.GetById 117ms app.codeStats 1ms

/src/mpv5/pluginhandling/YabsPlugin.java

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