X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fplugin%2FSwingMenuPlugin.java;fp=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fplugin%2FSwingMenuPlugin.java;h=e27b78ac63b64c8404c226941150e41573084d8b;hb=9349577cdfdff682b2aabd6daa24fdc3a7449b58;hp=0000000000000000000000000000000000000000;hpb=30ba0a882f0c061176ba14dbf86d3d6fad096c02;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/gui/plugin/SwingMenuPlugin.java b/core/src/net/sf/openrocket/gui/plugin/SwingMenuPlugin.java new file mode 100644 index 00000000..e27b78ac --- /dev/null +++ b/core/src/net/sf/openrocket/gui/plugin/SwingMenuPlugin.java @@ -0,0 +1,40 @@ +package net.sf.openrocket.gui.plugin; + +import javax.swing.Action; + +import net.sf.openrocket.document.OpenRocketDocument; +import net.sf.openrocket.gui.main.BasicFrame; + +/** + * A plugin that provides a menu item to the Swing GUI menus. + * This may open a dialog window or perform some other action on + * the current document. + *

+ * During plugin discovery, the BasicFrame and OpenRocketDocument + * objects are passed to the plugin. + * + * @author Sampo Niskanen + */ +public interface SwingMenuPlugin { + + /** + * Return the menu position where the action is placed. + * The first string in the array indicates the menu to place + * the item in, the second is the sub-menu, the third is the + * sub-sub-menu etc. + *

+ * The strings are translated menu names. + * + * @return the menu position for the action + */ + public String[] getMenuPosition(); + + /** + * Return the Action that the menu item performs. This contains + * the menu item text and may contain an icon. + * + * @return the action to perform on the menu item. + */ + public Action getAction(BasicFrame frame, OpenRocketDocument document); + +}