01: /*
02: * DynamicMenuProvider.java - API for dynamic plugin menus
03: * :tabSize=8:indentSize=8:noTabs=false:
04: * :folding=explicit:collapseFolds=1:
05: *
06: * Copyright (C) 2003 Slava Pestov
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public License
10: * as published by the Free Software Foundation; either version 2
11: * of the License, or any later version.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with this program; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21: */
22:
23: package org.gjt.sp.jedit.menu;
24:
25: import javax.swing.JMenu;
26:
27: /**
28: * Interface for a menu whose contents are determined at runtime.<p>
29: *
30: * See {@link org.gjt.sp.jedit.EditPlugin} for properties you need to define to
31: * have your plugin provide a dynamic menu.
32: *
33: * @since jEdit 4.2pre2
34: * @author Slava Pestov
35: * @version $Id: DynamicMenuProvider.java 4679 2003-05-02 23:14:17Z spestov $
36: */
37: public interface DynamicMenuProvider {
38: /**
39: * Returns true if the menu should be updated each time it is shown.
40: * Otherwise, it will only be updated when the menu is first created,
41: * and if the menu receives a {@link
42: * org.gjt.sp.jedit.msg.DynamicMenuChanged} message.
43: */
44: boolean updateEveryTime();
45:
46: /**
47: * Adds the menu items to the given menu.
48: * @param menu The menu
49: */
50: void update(JMenu menu);
51: }
|