01: /*=============================================================================
02: * Copyright Texas Instruments, Inc., 2001. All Rights Reserved.
03: *
04: * This program is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package ti.chimera;
20:
21: /**
22: * A tool-bar. A tool-bar can be created by a <code>Plugin</code> to give the
23: * user easy access to often used controls. This class is provided to simplify
24: * construction of a tool-bar.
25: * <p>
26: * NOTE: one of the problems with JToolBar is that when a toolbar is dragged
27: * out of it's home, it creates a toplevel window to live in, rather than a
28: * {@link Dialog}. This means that it isn't a child of the desktop-pane if
29: * the window-manager is in DESKTOP_MODE. If I can figure out how, I'd like
30: * to make it so subclass of this class create a Dialog to live in if they
31: * are dragged out of their parent, in which case I'll probably change the
32: * other APIs to force everyone to use this class...
33: *
34: * @author Rob Clark
35: * @version 0.1
36: */
37: public class ToolBar extends javax.swing.JToolBar {
38: /*=======================================================================*/
39: /**
40: * Class Constructor. Construct a <code>ToolBar</code> from a set of
41: * <code>javax.swing.Action</code>s.
42: *
43: * @param as the actions
44: */
45: public ToolBar(javax.swing.Action[] as) {
46: super ();
47:
48: for (int i = 0; i < as.length; i++) {
49: add(as[i]);
50: }
51: }
52: }
53:
54: /*
55: * Local Variables:
56: * tab-width: 2
57: * indent-tabs-mode: nil
58: * mode: java
59: * c-indentation-style: java
60: * c-basic-offset: 2
61: * eval: (c-set-offset 'substatement-open '0)
62: * eval: (c-set-offset 'case-label '+)
63: * eval: (c-set-offset 'inclass '+)
64: * eval: (c-set-offset 'inline-open '0)
65: * End:
66: */
|