01: /*
02: * SQLeonardo :: java database frontend
03: * Copyright (C) 2004 nickyb@users.sourceforge.net
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * as published by the Free Software Foundation; either version 2
08: * of the License, or (at your option) any later version.
09: *
10: * This program is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU General Public License for more details.
14: *
15: * You should have received a copy of the GNU General Public License
16: * along with this program; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: *
19: */
20:
21: package nickyb.sqleonardo.environment.mdi;
22:
23: import javax.swing.JMenuItem;
24: import javax.swing.border.EmptyBorder;
25:
26: import nickyb.sqleonardo.common.gui.Toolbar;
27: import nickyb.sqleonardo.environment.ctrl.MetadataExplorer;
28:
29: public class ClientMetadataExplorer extends MDIClient {
30: public static final String DEFAULT_TITLE = "metadata explorer";
31:
32: private MetadataExplorer control;
33: private JMenuItem[] m_actions;
34:
35: ClientMetadataExplorer() {
36: super (DEFAULT_TITLE);
37:
38: setComponentCenter(control = new MetadataExplorer());
39: control.setBorder(new EmptyBorder(2, 2, 2, 2));
40:
41: initMenuActions();
42: }
43:
44: private void initMenuActions() {
45: m_actions = new JMenuItem[] {
46: MDIMenubar.createItem(control.getActionMap().get(
47: "choose-columns")),
48: null,
49: MDIMenubar.createItem(control.getActionMap().get(
50: "list-copy")),
51: MDIMenubar.createItem(control.getActionMap().get(
52: "list-export")),
53: null,
54: MDIMenubar.createItem(control.getActionMap().get(
55: "list-refresh")), };
56: }
57:
58: public final void dispose() {
59: control.unloadNavigator();
60: super .dispose();
61: }
62:
63: public final MetadataExplorer getControl() {
64: return control;
65: }
66:
67: public final String getName() {
68: return DEFAULT_TITLE;
69: }
70:
71: public JMenuItem[] getMenuActions() {
72: return m_actions;
73: }
74:
75: public Toolbar getSubToolbar() {
76: return null;
77: }
78:
79: protected void setPreferences() {
80: control.setPreferences();
81: }
82: }
|