01: package net.sourceforge.squirrel_sql.client.action;
02:
03: import java.awt.event.KeyEvent;
04:
05: /*
06: * Copyright (C) 2001 - 2006 Colin Bell
07: * colbell@users.sourceforge.net
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2.1 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library; if not, write to the Free Software
21: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22: */
23:
24: /**
25: * Describes the accelerator and mnemonic keys associated with an <TT>Action</TT>.
26: *
27: * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
28: */
29: public class ActionKeys {
30: private String _actionClassName;
31: private String _accelerator;
32: private int _mnemonic;
33:
34: public ActionKeys() {
35: super ();
36: _accelerator = "";
37: _mnemonic = KeyEvent.VK_UNDEFINED;
38: }
39:
40: /**
41: * @throws IllegalArgumentException
42: * Thrown if <TT>actionClassName == null</TT>.
43: */
44: public ActionKeys(String actionClassName, String accelerator,
45: int mnemonic) {
46: super ();
47: setActionClassName(actionClassName);
48: setAccelerator(accelerator);
49: setMnemonic(mnemonic);
50: }
51:
52: public String getActionClassName() {
53: return _actionClassName;
54: }
55:
56: public int getMnemonic() {
57: return _mnemonic;
58: }
59:
60: public String getAccelerator() {
61: return _accelerator;
62: }
63:
64: /**
65: * @throws IllegalArgumentException
66: * Thrown if <TT>actionClassName == null</TT>.
67: */
68: public void setActionClassName(String value) {
69: if (value == null) {
70: throw new IllegalArgumentException(
71: "ActionClassName == null");
72: }
73: _actionClassName = value;
74: }
75:
76: public void setAccelerator(String value) {
77: _accelerator = value != null ? value : "";
78: }
79:
80: public void setMnemonic(int value) {
81: _mnemonic = value;
82: }
83: }
|