~adrian-wilkins/ubuntu/quantal/freemind/fix-file-association

« back to all changes in this revision

Viewing changes to freemind/freemind/controller/StructuredMenuItemHolder.java

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-01-03 14:19:19 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100103141919-m5az7dkicy21hqop
Tags: 0.9.0~rc6+dfsg-1ubuntu1
* Merge from Debian unstable (LP: #182927), remaining changes:
  - debian/copyright: add license/copyright for
    freemind/freemind/main/ExampleFileFilter.java

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*FreeMind - A Program for creating and viewing Mindmaps
 
2
 *Copyright (C) 2000-2004  Joerg Mueller, Daniel Polansky, Christian Foltin and others.
 
3
 *
 
4
 *See COPYING for Details
 
5
 *
 
6
 *This program is free software; you can redistribute it and/or
 
7
 *modify it under the terms of the GNU General Public License
 
8
 *as published by the Free Software Foundation; either version 2
 
9
 *of the License, or (at your option) any later version.
 
10
 *
 
11
 *This program is distributed in the hope that it will be useful,
 
12
 *but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *GNU General Public License for more details.
 
15
 *
 
16
 *You should have received a copy of the GNU General Public License
 
17
 *along with this program; if not, write to the Free Software
 
18
 *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * Created on 15.07.2004
 
21
 */
 
22
/*$Id: StructuredMenuItemHolder.java,v 1.1.4.1.16.1 2008/01/13 20:55:34 christianfoltin Exp $*/
 
23
package freemind.controller;
 
24
 
 
25
import javax.swing.Action;
 
26
import javax.swing.JMenuItem;
 
27
 
 
28
 
 
29
public class StructuredMenuItemHolder {
 
30
                private JMenuItem menuItem;
 
31
                private Action action;
 
32
                private MenuItemEnabledListener   enabledListener;
 
33
                private MenuItemSelectedListener selectionListener;
 
34
                
 
35
        public StructuredMenuItemHolder() {
 
36
        }
 
37
                public Action getAction() {
 
38
                        return action;
 
39
                }
 
40
                public void setAction(Action action) {
 
41
                        this.action = action;
 
42
                        if (action instanceof MenuItemEnabledListener) {
 
43
                                MenuItemEnabledListener listener = (MenuItemEnabledListener) action;
 
44
                                setEnabledListener(listener);
 
45
                        }
 
46
                        if (action instanceof MenuItemSelectedListener) {
 
47
                                MenuItemSelectedListener listener = (MenuItemSelectedListener) action;
 
48
                                setSelectedListener(listener);
 
49
                        }
 
50
                }
 
51
                public MenuItemEnabledListener getEnabledListener() {
 
52
                        return enabledListener;
 
53
                }
 
54
                public void setEnabledListener(
 
55
                                MenuItemEnabledListener enabledListener) {
 
56
                        this.enabledListener = enabledListener;
 
57
                }
 
58
                public JMenuItem getMenuItem() {
 
59
                        return menuItem;
 
60
                }
 
61
                public void setMenuItem(JMenuItem menuItem) {
 
62
                        this.menuItem = menuItem;
 
63
                }
 
64
                public MenuItemSelectedListener getSelectionListener() {
 
65
                        return selectionListener;
 
66
                }
 
67
                public void setSelectedListener(
 
68
                                MenuItemSelectedListener selectionListener) {
 
69
                        this.selectionListener = selectionListener;
 
70
                }
 
71
}
 
 
b'\\ No newline at end of file'