add toolbar
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 5 Apr 2008 02:49:32 +0000 (02:49 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 5 Apr 2008 02:49:32 +0000 (02:49 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@600 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/jsite/gui/MainWindow.java

index 0c46ad5..681cc32 100644 (file)
 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;
        }
 
 }