01: /*
02: * TableIndexPanel.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.dbobjects;
13:
14: import java.awt.BorderLayout;
15: import javax.swing.JPanel;
16: import javax.swing.event.TableModelEvent;
17: import javax.swing.event.TableModelListener;
18: import javax.swing.table.TableModel;
19: import workbench.gui.actions.ReloadAction;
20: import workbench.gui.components.WbScrollPane;
21: import workbench.gui.components.WbTable;
22: import workbench.gui.components.WbToolbar;
23: import workbench.interfaces.Reloadable;
24:
25: /**
26: * @author support@sql-workbench.net
27: */
28: public class TableIndexPanel extends JPanel {
29: private ReloadAction reloadIndex;
30:
31: public TableIndexPanel(WbTable indexTable, Reloadable reloader) {
32: this .setLayout(new BorderLayout());
33: WbScrollPane p = new WbScrollPane(indexTable);
34: this .add(p, BorderLayout.CENTER);
35: if (reloader != null) {
36: reloadIndex = new ReloadAction(reloader);
37: reloadIndex.setEnabled(true);
38: WbToolbar toolbar = new WbToolbar();
39: toolbar.add(reloadIndex);
40: this.add(toolbar, BorderLayout.NORTH);
41: }
42: }
43:
44: }
|