PageRenderTime 23ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  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. */
  17. package mpv5.pluginhandling;
  18. import java.awt.Image;
  19. import mpv5.YabsView;
  20. import mpv5.ui.frames.MPView;
  21. /**
  22. * This class is to be implemented on MP5 plugins
  23. *
  24. */
  25. public interface MP5Plugin {
  26. /**
  27. * Initializes the plugin
  28. * @param frame
  29. * @return
  30. */
  31. public YabsPlugin load(MPView frame);
  32. /**
  33. * Unloads the plugin
  34. */
  35. public abstract void unload();
  36. /**
  37. *
  38. * @return The name of the plugin
  39. */
  40. public abstract String getName();
  41. /**
  42. *
  43. * @return The vendor of the plugin
  44. */
  45. public abstract String getVendor();
  46. /**
  47. *
  48. * @return The uid of the plugin, should be randomly generated,
  49. * <br/>to be unique for each instance of the plugin!
  50. */
  51. public abstract Long getUID();
  52. /**
  53. * Check whether this plugin is enabled
  54. * @return True if the plugin is to be loaded
  55. */
  56. public abstract boolean isEnabled();
  57. /**
  58. * Check whether this plugin inherits <code>JPanel</code> and shall be displayed on the main tab pane
  59. * @return True if the plugin is to be displayed on the main tab pane
  60. */
  61. public abstract boolean isComponent();
  62. /**
  63. * Check whether this plugin is a <code>Runnable<code/>
  64. * @return TRUE if this is a {@link Runnable}
  65. */
  66. public abstract boolean isRunnable();
  67. /**
  68. * Inidcates whether the plugin has bee previously loaded
  69. * @return TRUE if {@link MP5Plugin#load(MP5View)} has been called
  70. */
  71. public abstract boolean isLoaded();
  72. /**
  73. * If this returns null, a default icon is used to represent this plugin
  74. * @return An Icon which graphically represents the plugin
  75. */
  76. public abstract Image getIcon();
  77. }