Add web of trust interface to project page.
[jSite.git] / src / main / java / de / todesbaum / jsite / gui / ProjectPage.java
index 98ad847..0c508b5 100644 (file)
@@ -57,12 +57,12 @@ import javax.swing.text.BadLocationException;
 import javax.swing.text.Document;
 import javax.swing.text.DocumentFilter;
 
+import net.pterodactylus.util.swing.SortedListModel;
 import de.todesbaum.jsite.application.Freenet7Interface;
-import de.todesbaum.jsite.application.KeyDialog;
 import de.todesbaum.jsite.application.Project;
+import de.todesbaum.jsite.application.WebOfTrustInterface;
 import de.todesbaum.jsite.i18n.I18n;
 import de.todesbaum.jsite.i18n.I18nContainer;
-import de.todesbaum.util.swing.SortedListModel;
 import de.todesbaum.util.swing.TLabel;
 import de.todesbaum.util.swing.TWizard;
 import de.todesbaum.util.swing.TWizardPage;
@@ -77,6 +77,9 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        /** The freenet interface. */
        private Freenet7Interface freenetInterface;
 
+       /** The web of trust interface. */
+       private WebOfTrustInterface webOfTrustInterface;
+
        /** The “browse” action. */
        private Action projectLocalPathBrowseAction;
 
@@ -143,6 +146,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                I18nContainer.getInstance().registerRunnable(new Runnable() {
 
+                       @Override
                        public void run() {
                                setHeading(I18n.getMessage("jsite.project.heading"));
                                setDescription(I18n.getMessage("jsite.project.description"));
@@ -206,6 +210,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        private void createActions() {
                projectLocalPathBrowseAction = new AbstractAction(I18n.getMessage("jsite.project.action.browse")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionLocalPathBrowse();
@@ -217,6 +222,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                projectAddAction = new AbstractAction(I18n.getMessage("jsite.project.action.add-project")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionAdd();
@@ -227,6 +233,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                projectDeleteAction = new AbstractAction(I18n.getMessage("jsite.project.action.delete-project")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionDelete();
@@ -238,6 +245,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                projectCloneAction = new AbstractAction(I18n.getMessage("jsite.project.action.clone-project")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionClone();
@@ -249,6 +257,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                projectCopyURIAction = new AbstractAction(I18n.getMessage("jsite.project.action.copy-uri")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionCopyURI();
@@ -260,6 +269,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                projectManageKeysAction = new AbstractAction(I18n.getMessage("jsite.project.action.manage-keys")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionManageKeys();
@@ -271,6 +281,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                projectResetEditionAction = new AbstractAction(I18n.getMessage("jsite.project.action.reset-edition")) {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void actionPerformed(ActionEvent actionEvent) {
                                actionResetEdition();
@@ -282,6 +293,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                I18nContainer.getInstance().registerRunnable(new Runnable() {
 
+                       @Override
                        @SuppressWarnings("synthetic-access")
                        public void run() {
                                projectLocalPathBrowseAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.browse"));
@@ -407,6 +419,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
 
                I18nContainer.getInstance().registerRunnable(new Runnable() {
 
+                       @Override
                        public void run() {
                                projectInformationLabel.setText("<html><b>" + I18n.getMessage("jsite.project.project.information") + "</b></html>");
                                projectNameLabel.setText(I18n.getMessage("jsite.project.project.name") + ":");
@@ -454,6 +467,16 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        }
 
        /**
+        * Sets the web of trust interface to use.
+        *
+        * @param webOfTrustInterface
+        *            The web of trust interface to use
+        */
+       public void setWebOfTrustInterface(WebOfTrustInterface webOfTrustInterface) {
+               this.webOfTrustInterface = webOfTrustInterface;
+       }
+
+       /**
         * Returns the currently selected project.
         *
         * @return The currently selected project
@@ -653,6 +676,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        /**
         * {@inheritDoc}
         */
+       @Override
        public void valueChanged(ListSelectionEvent listSelectionEvent) {
                int selectedRow = projectList.getSelectedIndex();
                Project selectedProject = (Project) projectList.getSelectedValue();
@@ -692,6 +716,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        /**
         * {@inheritDoc}
         */
+       @Override
        public void insertUpdate(DocumentEvent documentEvent) {
                setTextField(documentEvent);
        }
@@ -699,6 +724,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        /**
         * {@inheritDoc}
         */
+       @Override
        public void removeUpdate(DocumentEvent documentEvent) {
                setTextField(documentEvent);
        }
@@ -706,6 +732,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        /**
         * {@inheritDoc}
         */
+       @Override
        public void changedUpdate(DocumentEvent documentEvent) {
                setTextField(documentEvent);
        }
@@ -717,6 +744,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
        /**
         * {@inheritDoc}
         */
+       @Override
        public void lostOwnership(Clipboard clipboard, Transferable contents) {
                /* ignore. */
        }