X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FMainWindow.java;h=1653e79cfae98d06032913a1daa69e2052c7fab1;hb=ebf4d1a0fb0f7e00e5aff798270dd2124070886a;hp=30a9eeaae0917c82ebf2214187c8c6e341fed99b;hpb=c74ea301cd9c71a434685bb75de2b7a2bb2440e4;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/gui/MainWindow.java b/src/net/pterodactylus/jsite/gui/MainWindow.java index 30a9eea..1653e79 100644 --- a/src/net/pterodactylus/jsite/gui/MainWindow.java +++ b/src/net/pterodactylus/jsite/gui/MainWindow.java @@ -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 //