KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > sp > jedit > menu > DynamicMenuProvider


1 /*
2  * DynamicMenuProvider.java - API for dynamic plugin menus
3  * :tabSize=8:indentSize=8:noTabs=false:
4  * :folding=explicit:collapseFolds=1:
5  *
6  * Copyright (C) 2003 Slava Pestov
7  *
8  * This program is free software; you can redistribute it and/or
9  * 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 JavaDoc;
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     /**
40      * Returns true if the menu should be updated each time it is shown.
41      * Otherwise, it will only be updated when the menu is first created,
42      * and if the menu receives a {@link
43      * org.gjt.sp.jedit.msg.DynamicMenuChanged} message.
44      */

45     boolean updateEveryTime();
46
47     /**
48      * Adds the menu items to the given menu.
49      * @param menu The menu
50      */

51     void update(JMenu JavaDoc menu);
52 }
53
Popular Tags