1 | // Copyright 2004-2007 Jean-Francois Poilpret |
2 | // |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | // you may not use this file except in compliance with the License. |
5 | // You may obtain a copy of the License at |
6 | // |
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
8 | // |
9 | // Unless required by applicable law or agreed to in writing, software |
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | // See the License for the specific language governing permissions and |
13 | // limitations under the License. |
14 | |
15 | package net.sourceforge.hivegui.menu; |
16 | |
17 | import javax.swing.Action; |
18 | |
19 | import org.apache.hivemind.impl.BaseLocatable; |
20 | import org.apache.hivemind.util.ToStringBuilder; |
21 | |
22 | /** |
23 | * @author Jean-Francois Poilpret |
24 | */ |
25 | public class MenuItemContribution extends BaseLocatable |
26 | { |
27 | public void setId(String id) |
28 | { |
29 | _id = id; |
30 | } |
31 | public String getId() |
32 | { |
33 | return _id; |
34 | } |
35 | |
36 | public void setCommand(Action command) |
37 | { |
38 | _command = command; |
39 | } |
40 | public Action getCommand() |
41 | { |
42 | return _command; |
43 | } |
44 | |
45 | public void setHasSubMenus(boolean hasSubMenus) |
46 | { |
47 | _hasSubMenus = hasSubMenus; |
48 | } |
49 | public boolean getHasSubMenus() |
50 | { |
51 | return _hasSubMenus; |
52 | } |
53 | |
54 | @Override public String toString() |
55 | { |
56 | ToStringBuilder builder = new ToStringBuilder(this); |
57 | builder.append("id", _id); |
58 | builder.append("command", _command); |
59 | builder.append("hasSubMenus", _hasSubMenus); |
60 | return builder.toString(); |
61 | } |
62 | |
63 | private String _id; |
64 | private Action _command; |
65 | private boolean _hasSubMenus; |
66 | } |