From: David ‘Bombe’ Roden Date: Sat, 5 Apr 2008 02:49:32 +0000 (+0000) Subject: add toolbar X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9177fca9e2b057256ccad6402aa7cabd6f9cf21b;hp=a14c97cfa168670f1811be4e38484b709d840529;p=jSite2.git add toolbar git-svn-id: http://trooper/svn/projects/jSite/trunk@600 c3eda9e8-030b-0410-8277-bc7414b0a119 --- 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; } }