From 9177fca9e2b057256ccad6402aa7cabd6f9cf21b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 5 Apr 2008 02:49:32 +0000 Subject: [PATCH] add toolbar git-svn-id: http://trooper/svn/projects/jSite/trunk@600 c3eda9e8-030b-0410-8277-bc7414b0a119 --- src/net/pterodactylus/jsite/gui/MainWindow.java | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/net/pterodactylus/jsite/gui/MainWindow.java b/src/net/pterodactylus/jsite/gui/MainWindow.java index 0c46ad5..681cc32 100644 --- a/src/net/pterodactylus/jsite/gui/MainWindow.java +++ b/src/net/pterodactylus/jsite/gui/MainWindow.java @@ -20,11 +20,14 @@ package net.pterodactylus.jsite.gui; import java.awt.BorderLayout; +import java.awt.Container; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; +import javax.swing.JPanel; +import javax.swing.JToolBar; import net.pterodactylus.jsite.i18n.I18n; import net.pterodactylus.jsite.main.Version; @@ -44,6 +47,9 @@ public class MainWindow extends JFrame { /** The status bar. */ private StatusBar statusBar = new StatusBar(); + + /** The content pane. */ + private JPanel contentPane = new JPanel(); /** * Creates a new main window that redirects all actions to the given swing @@ -96,6 +102,15 @@ public class MainWindow extends JFrame { nodeMenu.add(swingInterface.getNodeDisconnectAction()); setJMenuBar(menuBar); + + JToolBar toolBar = new JToolBar(I18n.get("mainWindow.toolbar.name")); + toolBar.add(swingInterface.getManageNodesAction()); + toolBar.addSeparator(); + toolBar.add(swingInterface.getNodeConnectAction()); + toolBar.add(swingInterface.getNodeDisconnectAction()); + super.getContentPane().add(toolBar, BorderLayout.PAGE_START); + + super.getContentPane().add(contentPane, BorderLayout.CENTER); initComponents(); } @@ -103,7 +118,15 @@ public class MainWindow extends JFrame { * Initializes all components of this window. */ private void initComponents() { - getContentPane().add(statusBar, BorderLayout.PAGE_END); + super.getContentPane().add(statusBar, BorderLayout.PAGE_END); + } + + /** + * {@inheritDoc} + */ + @Override + public Container getContentPane() { + return contentPane; } } -- 2.7.4