X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FSwingInterface.java;h=d00ebe1a665e45bb98012927a2c4ce8ef4cc4770;hb=966d4ac902c693077f10ef4b1b7bc562559ca49e;hp=ecd8612ca2907daf69bb5a79a951314d42193246;hpb=78d4c9a68c63aa6c7a317e15385a0d51eeaee6b4;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index ecd8612..d00ebe1 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -34,12 +34,13 @@ import javax.swing.JOptionPane; import net.pterodactylus.jsite.core.Core; import net.pterodactylus.jsite.core.CoreListener; import net.pterodactylus.jsite.core.Node; +import net.pterodactylus.jsite.core.Project; import net.pterodactylus.jsite.i18n.I18n; import net.pterodactylus.jsite.i18n.gui.I18nAction; import net.pterodactylus.util.io.Closer; /** - * TODO + * The Swing user interface. * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ @@ -85,6 +86,12 @@ public class SwingInterface implements CoreListener { /** The “add project” action. */ private I18nAction addProjectAction; + /** The “clone project” action. */ + private I18nAction cloneProjectAction; + + /** The “delete project” action. */ + private I18nAction deleteProjectAction; + /** The “about” dialog. */ private AboutDialog aboutDialog; @@ -226,6 +233,24 @@ public class SwingInterface implements CoreListener { return addProjectAction; } + /** + * Returns the “clone project” action. + * + * @return The “clone project” action + */ + I18nAction getCloneProjectAction() { + return cloneProjectAction; + } + + /** + * Returns the “delete project” action. + * + * @return The “delete project” action + */ + I18nAction getDeleteProjectAction() { + return deleteProjectAction; + } + // // ACTIONS // @@ -252,7 +277,6 @@ public class SwingInterface implements CoreListener { /* initialize default stuff. */ beautify = false; /* now read config. */ - System.out.println("configDirectory: “" + configDirectory + "”"); File configFile = new File(configDirectory, "swing-interface.properties"); if (!configFile.exists() || !configFile.canRead() || !configFile.isFile()) { System.err.println("could not find “" + configFile.getAbsolutePath() + "”!"); @@ -399,6 +423,26 @@ public class SwingInterface implements CoreListener { addProject(); } }; + cloneProjectAction = new I18nAction("mainWindow.button.cloneProject") { + + /** + * {@inheritDoc} + */ + @SuppressWarnings("synthetic-access") + public void actionPerformed(ActionEvent actionEvent) { + cloneProject(); + } + }; + deleteProjectAction = new I18nAction("mainWindow.button.deleteProject") { + + /** + * {@inheritDoc} + */ + @SuppressWarnings("synthetic-access") + public void actionPerformed(ActionEvent actionEvent) { + deleteProject(); + } + }; } /** @@ -488,6 +532,21 @@ public class SwingInterface implements CoreListener { * Adds a project. */ private void addProject() { + Project project = new Project(); + project.setName("New Project"); + project.setDescription(""); + } + + /** + * Clones a project. + */ + private void cloneProject() { + } + + /** + * Deletes a project. + */ + private void deleteProject() { } //