X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FProjectPage.java;h=c319e94947a3298372413bcae146eba6ab9658e8;hb=593eba180ca6538a680810651f127fbcf0a620a3;hp=60dbd735d93179534073f6a612ea1627f32a3693;hpb=7762395bd7e8921d79e5a6e8b3c3b44e9689ec16;p=jSite.git diff --git a/src/de/todesbaum/jsite/gui/ProjectPage.java b/src/de/todesbaum/jsite/gui/ProjectPage.java index 60dbd73..c319e94 100644 --- a/src/de/todesbaum/jsite/gui/ProjectPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectPage.java @@ -1,6 +1,5 @@ /* - * jSite - a tool for uploading websites into Freenet - * Copyright (C) 2006 David Roden + * jSite - ProjectPage.java - Copyright © 2006–2012 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -144,6 +143,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")); @@ -162,9 +162,9 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectList = new JList(projectListModel); projectList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); projectList.addListSelectionListener(this); - projectList.setPreferredSize(new Dimension(150, projectList.getPreferredSize().height)); add(projectScrollPane = new JScrollPane(projectList), BorderLayout.LINE_START); + projectScrollPane.setPreferredSize(new Dimension(150, projectList.getPreferredSize().height)); add(createInformationPanel(), BorderLayout.CENTER); } @@ -207,6 +207,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(); @@ -218,6 +219,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(); @@ -228,6 +230,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(); @@ -239,6 +242,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(); @@ -250,6 +254,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(); @@ -261,6 +266,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(); @@ -272,6 +278,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(); @@ -283,6 +290,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")); @@ -408,6 +416,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D I18nContainer.getInstance().registerRunnable(new Runnable() { + @Override public void run() { projectInformationLabel.setText("" + I18n.getMessage("jsite.project.project.information") + ""); projectNameLabel.setText(I18n.getMessage("jsite.project.project.name") + ":"); @@ -609,8 +618,13 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D keyDialog.setPublicKey(selectedProject.getRequestURI()); keyDialog.setVisible(true); if (!keyDialog.wasCancelled()) { + String originalPublicKey = selectedProject.getRequestURI(); + String originalPrivateKey = selectedProject.getInsertURI(); selectedProject.setInsertURI(keyDialog.getPrivateKey()); selectedProject.setRequestURI(keyDialog.getPublicKey()); + if (!originalPublicKey.equals(selectedProject.getRequestURI()) || !originalPrivateKey.equals(selectedProject.getInsertURI())) { + selectedProject.setEdition(-1); + } updateCompleteURI(); } } @@ -649,6 +663,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(); @@ -688,6 +703,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D /** * {@inheritDoc} */ + @Override public void insertUpdate(DocumentEvent documentEvent) { setTextField(documentEvent); } @@ -695,6 +711,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D /** * {@inheritDoc} */ + @Override public void removeUpdate(DocumentEvent documentEvent) { setTextField(documentEvent); } @@ -702,6 +719,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D /** * {@inheritDoc} */ + @Override public void changedUpdate(DocumentEvent documentEvent) { setTextField(documentEvent); } @@ -713,6 +731,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D /** * {@inheritDoc} */ + @Override public void lostOwnership(Clipboard clipboard, Transferable contents) { /* ignore. */ }