right-align the help menu
[jSite2.git] / src / net / pterodactylus / jsite / gui / MainWindow.java
index 30a9eea..1653e79 100644 (file)
@@ -36,6 +36,7 @@ import javax.swing.JToolBar;
 import javax.swing.SwingConstants;
 import javax.swing.border.EmptyBorder;
 
+import net.pterodactylus.jsite.core.Project;
 import net.pterodactylus.jsite.i18n.I18n;
 import net.pterodactylus.jsite.i18n.I18nable;
 import net.pterodactylus.jsite.i18n.gui.I18nAction;
@@ -46,7 +47,7 @@ import net.pterodactylus.util.swing.SwingUtils;
 
 /**
  * Defines the main window of the application.
- * 
+ *
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
  * @version $Id$
  */
@@ -73,10 +74,13 @@ public class MainWindow extends JFrame implements I18nable {
        /** The about menu. */
        private I18nMenu aboutMenu;
 
+       /** The tabbed project pane. */
+       private JTabbedPane projectPane;
+
        /**
         * Creates a new main window that redirects all actions to the given swing
         * interface.
-        * 
+        *
         * @param swingInterface
         *            The swing interface to receive all actions
         */
@@ -97,7 +101,7 @@ public class MainWindow extends JFrame implements I18nable {
 
        /**
         * Sets the text of the status bar.
-        * 
+        *
         * @param text
         *            The text of the status bar
         */
@@ -105,6 +109,23 @@ public class MainWindow extends JFrame implements I18nable {
                statusBar.setText(text);
        }
 
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public Container getContentPane() {
+               return contentPane;
+       }
+
+       /**
+        * Returns the currently selected project.
+        *
+        * @return The currently selected project
+        */
+       public Project getSelectedProject() {
+               return null;
+       }
+
        //
        // PRIVATE METHODS
        //
@@ -139,6 +160,10 @@ public class MainWindow extends JFrame implements I18nable {
                        languageMenu.add(languageAction);
                }
 
+               JPanel spacerPanel = new JPanel();
+               spacerPanel.setOpaque(false);
+               menuBar.add(spacerPanel);
+
                aboutMenu = new I18nMenu("mainWindow.menu.help");
                menuBar.add(aboutMenu);
 
@@ -186,11 +211,11 @@ public class MainWindow extends JFrame implements I18nable {
                getContentPane().add(upperPanel, BorderLayout.PAGE_START);
                contentPane.setBorder(new EmptyBorder(12, 12, 12, 12));
 
-               JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
-               upperPanel.add(tabbedPane, BorderLayout.CENTER);
+               projectPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
+               upperPanel.add(projectPane, BorderLayout.CENTER);
 
                Box projectOverviewPanel = new Box(BoxLayout.PAGE_AXIS);
-               tabbedPane.add(I18n.get("mainWindow.pane.overview.title"), projectOverviewPanel);
+               projectPane.add(I18n.get("mainWindow.pane.overview.title"), projectOverviewPanel);
                projectOverviewPanel.setBorder(new EmptyBorder(12, 12, 12, 12));
                projectOverviewPanel.add(Box.createVerticalGlue());
                JButton addProjectButton = new JButton(swingInterface.getAddProjectAction());
@@ -202,14 +227,6 @@ public class MainWindow extends JFrame implements I18nable {
 // getContentPane().add(lowerPanel, BorderLayout.CENTER);
        }
 
-       /**
-        * {@inheritDoc}
-        */
-       @Override
-       public Container getContentPane() {
-               return contentPane;
-       }
-
        //
        // INTERFACE I18nable
        //