X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FProjectPage.java;h=4e3724fafaee6fd7e32bedb5c829977946ca3177;hb=49f714c1da2673dd280bcf4c5ef087d88607b3de;hp=086493ca19e2a9981e270446c4fdfa5cf104137f;hpb=bfa8ea22740bd472403c67eb383e3fd25b8f93c8;p=jSite.git diff --git a/src/de/todesbaum/jsite/gui/ProjectPage.java b/src/de/todesbaum/jsite/gui/ProjectPage.java index 086493c..4e3724f 100644 --- a/src/de/todesbaum/jsite/gui/ProjectPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectPage.java @@ -52,51 +52,105 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import javax.swing.text.AbstractDocument; +import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.Document; +import javax.swing.text.DocumentFilter; import de.todesbaum.jsite.application.Freenet7Interface; import de.todesbaum.jsite.application.Project; 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; /** - * @author David Roden <droden@gmail.com> - * @version $Id$ + * Wizard page that lets the user manage his projects and start inserts. + * + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ public class ProjectPage extends TWizardPage implements ListSelectionListener, DocumentListener, ClipboardOwner { + /** The freenet interface. */ private Freenet7Interface freenetInterface; + /** The “browse” action. */ private Action projectLocalPathBrowseAction; + + /** The “add project” action. */ private Action projectAddAction; + + /** The “delete project” action. */ private Action projectDeleteAction; + + /** The “clone project” action. */ private Action projectCloneAction; + + /** The “copy URI” action. */ private Action projectCopyURIAction; + + /** The “generate key” action. */ private Action projectGenerateKeyAction; + /** The file chooser. */ private JFileChooser pathChooser; + + /** The project list model. */ private SortedListModel projectListModel; + + /** The project list scroll pane. */ + private JScrollPane projectScrollPane; + + /** The project list. */ private JList projectList; + + /** The project name textfield. */ private JTextField projectNameTextField; + + /** The project description textfield. */ private JTextField projectDescriptionTextField; + + /** The local path textfield. */ private JTextField projectLocalPathTextField; + + /** The public key textfield. */ private JTextField projectPublicKeyTextField; + + /** The private key textfield. */ private JTextField projectPrivateKeyTextField; + + /** The project path textfield. */ private JTextField projectPathTextField; - public ProjectPage() { - super(); + /** + * Creates a new project page. + * + * @param wizard + * The wizard this page belongs to + */ + public ProjectPage(final TWizard wizard) { + super(wizard); setLayout(new BorderLayout(12, 12)); dialogInit(); setHeading(I18n.getMessage("jsite.project.heading")); setDescription(I18n.getMessage("jsite.project.description")); + + I18nContainer.getInstance().registerRunnable(new Runnable() { + + public void run() { + setHeading(I18n.getMessage("jsite.project.heading")); + setDescription(I18n.getMessage("jsite.project.description")); + } + }); } - protected void dialogInit() { + /** + * Initializes the page. + */ + private void dialogInit() { createActions(); pathChooser = new JFileChooser(); @@ -106,7 +160,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectList.addListSelectionListener(this); projectList.setPreferredSize(new Dimension(150, projectList.getPreferredSize().height)); - add(new JScrollPane(projectList), BorderLayout.LINE_START); + add(projectScrollPane = new JScrollPane(projectList), BorderLayout.LINE_START); add(createInformationPanel(), BorderLayout.CENTER); } @@ -117,24 +171,39 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D public void pageAdded(TWizard wizard) { super.pageAdded(wizard); projectList.clearSelection(); - wizard.setNextEnabled(false); + this.wizard.setPreviousName(I18n.getMessage("jsite.menu.nodes.manage-nodes")); + this.wizard.setNextName(I18n.getMessage("jsite.wizard.next")); + this.wizard.setQuitName(I18n.getMessage("jsite.wizard.quit")); + this.wizard.setNextEnabled(false); } /** + * Adds the given listener to the list of listeners. + * + * @param listener + * The listener to add */ public void addListSelectionListener(ListSelectionListener listener) { projectList.addListSelectionListener(listener); } /** + * Removes the given listener from the list of listeners. + * + * @param listener + * The listener to remove */ public void removeListSelectionListener(ListSelectionListener listener) { projectList.removeListSelectionListener(listener); } + /** + * Creates all actions. + */ private void createActions() { projectLocalPathBrowseAction = new AbstractAction(I18n.getMessage("jsite.project.action.browse")) { + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { actionLocalPathBrowse(); } @@ -145,6 +214,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectAddAction = new AbstractAction(I18n.getMessage("jsite.project.action.add-project")) { + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { actionAdd(); } @@ -154,6 +224,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectDeleteAction = new AbstractAction(I18n.getMessage("jsite.project.action.delete-project")) { + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { actionDelete(); } @@ -164,6 +235,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectCloneAction = new AbstractAction(I18n.getMessage("jsite.project.action.clone-project")) { + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { actionClone(); } @@ -171,8 +243,10 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectCloneAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.clone-project.tooltip")); projectCloneAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_L); projectCloneAction.setEnabled(false); - + projectCopyURIAction = new AbstractAction(I18n.getMessage("jsite.project.action.copy-uri")) { + + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { actionCopyURI(); } @@ -180,8 +254,10 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectCopyURIAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.copy-uri.tooltip")); projectCopyURIAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_U); projectCopyURIAction.setEnabled(false); - + projectGenerateKeyAction = new AbstractAction(I18n.getMessage("jsite.project.action.generate-new-key")) { + + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { actionGenerateNewKey(); } @@ -189,8 +265,33 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectGenerateKeyAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.generate-new-key.tooltip")); projectGenerateKeyAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_G); projectGenerateKeyAction.setEnabled(false); + + I18nContainer.getInstance().registerRunnable(new Runnable() { + + @SuppressWarnings("synthetic-access") + public void run() { + projectLocalPathBrowseAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.browse")); + projectLocalPathBrowseAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.browse.tooltip")); + projectAddAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.add-project")); + projectAddAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.add-project.tooltip")); + projectDeleteAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.delete-project")); + projectDeleteAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.delete-project.tooltip")); + projectCloneAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.clone-project")); + projectCloneAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.clone-project.tooltip")); + projectCopyURIAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.copy-uri")); + projectCopyURIAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.copy-uri.tooltip")); + projectGenerateKeyAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.generate-new-key")); + projectGenerateKeyAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.generate-new-key.tooltip")); + pathChooser.setApproveButtonText(I18n.getMessage("jsite.project.action.browse.choose")); + } + }); } + /** + * Creates the information panel. + * + * @return The information panel + */ private JComponent createInformationPanel() { JPanel informationPanel = new JPanel(new BorderLayout(12, 12)); @@ -206,14 +307,16 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D informationPanel.add(functionButtons, BorderLayout.PAGE_START); informationPanel.add(informationTable, BorderLayout.CENTER); - informationTable.add(new JLabel("" + I18n.getMessage("jsite.project.project.information") + ""), new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); + final JLabel projectInformationLabel = new JLabel("" + I18n.getMessage("jsite.project.project.information") + ""); + informationTable.add(projectInformationLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); projectNameTextField = new JTextField(); projectNameTextField.getDocument().putProperty("name", "project.name"); projectNameTextField.getDocument().addDocumentListener(this); projectNameTextField.setEnabled(false); - informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.name") + ":", KeyEvent.VK_N, projectNameTextField), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); + final TLabel projectNameLabel = new TLabel(I18n.getMessage("jsite.project.project.name") + ":", KeyEvent.VK_N, projectNameTextField); + informationTable.add(projectNameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); informationTable.add(projectNameTextField, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); projectDescriptionTextField = new JTextField(); @@ -221,7 +324,8 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectDescriptionTextField.getDocument().addDocumentListener(this); projectDescriptionTextField.setEnabled(false); - informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.description") + ":", KeyEvent.VK_D, projectDescriptionTextField), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); + final TLabel projectDescriptionLabel = new TLabel(I18n.getMessage("jsite.project.project.description") + ":", KeyEvent.VK_D, projectDescriptionTextField); + informationTable.add(projectDescriptionLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); informationTable.add(projectDescriptionTextField, new GridBagConstraints(1, 2, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); projectLocalPathTextField = new JTextField(); @@ -229,18 +333,21 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectLocalPathTextField.getDocument().addDocumentListener(this); projectLocalPathTextField.setEnabled(false); - informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.local-path") + ":", KeyEvent.VK_L, projectLocalPathTextField), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); + final TLabel projectLocalPathLabel = new TLabel(I18n.getMessage("jsite.project.project.local-path") + ":", KeyEvent.VK_L, projectLocalPathTextField); + informationTable.add(projectLocalPathLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); informationTable.add(projectLocalPathTextField, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); informationTable.add(new JButton(projectLocalPathBrowseAction), new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); - informationTable.add(new JLabel("" + I18n.getMessage("jsite.project.project.address") + ""), new GridBagConstraints(0, 4, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0)); + final JLabel projectAddressLabel = new JLabel("" + I18n.getMessage("jsite.project.project.address") + ""); + informationTable.add(projectAddressLabel, new GridBagConstraints(0, 4, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0)); projectPublicKeyTextField = new JTextField(27); projectPublicKeyTextField.getDocument().putProperty("name", "project.publickey"); projectPublicKeyTextField.getDocument().addDocumentListener(this); projectPublicKeyTextField.setEnabled(false); - informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.public-key") + ":", KeyEvent.VK_U, projectPublicKeyTextField), new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); + final TLabel projectPublicKeyLabel = new TLabel(I18n.getMessage("jsite.project.project.public-key") + ":", KeyEvent.VK_U, projectPublicKeyTextField); + informationTable.add(projectPublicKeyLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); informationTable.add(projectPublicKeyTextField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); informationTable.add(new JButton(projectGenerateKeyAction), new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); @@ -249,43 +356,101 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectPrivateKeyTextField.getDocument().addDocumentListener(this); projectPrivateKeyTextField.setEnabled(false); - informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.private-key") + ":", KeyEvent.VK_R, projectPrivateKeyTextField), new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); + final TLabel projectPrivateKeyLabel = new TLabel(I18n.getMessage("jsite.project.project.private-key") + ":", KeyEvent.VK_R, projectPrivateKeyTextField); + informationTable.add(projectPrivateKeyLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); informationTable.add(projectPrivateKeyTextField, new GridBagConstraints(1, 6, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); projectPathTextField = new JTextField(); projectPathTextField.getDocument().putProperty("name", "project.path"); projectPathTextField.getDocument().addDocumentListener(this); + ((AbstractDocument) projectPathTextField.getDocument()).setDocumentFilter(new DocumentFilter() { + + /** + * {@inheritDoc} + */ + @Override + public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { + super.insertString(fb, offset, string.replaceAll("/", ""), attr); + } + + /** + * {@inheritDoc} + */ + @Override + public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException { + super.replace(fb, offset, length, text.replaceAll("/", ""), attrs); + } + }); projectPathTextField.setEnabled(false); - informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.path") + ":", KeyEvent.VK_P, projectPathTextField), new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); + final TLabel projectPathLabel = new TLabel(I18n.getMessage("jsite.project.project.path") + ":", KeyEvent.VK_P, projectPathTextField); + I18nContainer.getInstance().registerRunnable(new Runnable() { + + public void run() { + projectInformationLabel.setText("" + I18n.getMessage("jsite.project.project.information") + ""); + projectNameLabel.setText(I18n.getMessage("jsite.project.project.name") + ":"); + projectDescriptionLabel.setText(I18n.getMessage("jsite.project.project.description") + ":"); + projectLocalPathLabel.setText(I18n.getMessage("jsite.project.project.local-path") + ":"); + projectAddressLabel.setText("" + I18n.getMessage("jsite.project.project.address") + ""); + projectPublicKeyLabel.setText(I18n.getMessage("jsite.project.project.public-key") + ":"); + projectPrivateKeyLabel.setText(I18n.getMessage("jsite.project.project.private-key") + ":"); + projectPathLabel.setText(I18n.getMessage("jsite.project.project.path") + ":"); + } + }); + informationTable.add(projectPathLabel, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); informationTable.add(projectPathTextField, new GridBagConstraints(1, 7, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); return informationPanel; } + /** + * Sets the project list. + * + * @param projects + * The list of projects + */ public void setProjects(Project[] projects) { projectListModel.clear(); - for (Project project: projects) { + for (Project project : projects) { projectListModel.add(project); } } + /** + * Returns the list of projects. + * + * @return The list of projects + */ public Project[] getProjects() { return (Project[]) projectListModel.toArray(new Project[projectListModel.size()]); } /** + * Sets the freenet interface to use. + * * @param freenetInterface - * The freenetInterface to set. + * The freenetInterface to use */ public void setFreenetInterface(Freenet7Interface freenetInterface) { this.freenetInterface = freenetInterface; } + /** + * Returns the currently selected project. + * + * @return The currently selected project + */ public Project getSelectedProject() { return (Project) projectList.getSelectedValue(); } + /** + * Updates the currently selected project with changed information from a + * textfield. + * + * @param documentEvent + * The document event to process + */ private void setTextField(DocumentEvent documentEvent) { Document document = documentEvent.getDocument(); String propertyName = (String) document.getProperty("name"); @@ -310,6 +475,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D project.setPath(text); } } catch (BadLocationException e) { + /* ignore. */ } } @@ -317,7 +483,10 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D // ACTIONS // - protected void actionLocalPathBrowse() { + /** + * Lets the user choose a local path for a project. + */ + private void actionLocalPathBrowse() { Project project = (Project) projectList.getSelectedValue(); if (project == null) { return; @@ -328,7 +497,10 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D } } - protected void actionAdd() { + /** + * Adds a new project. + */ + private void actionAdd() { String[] keyPair = null; if (!freenetInterface.hasNode()) { JOptionPane.showMessageDialog(this, I18n.getMessage("jsite.project-files.no-node-selected"), null, JOptionPane.ERROR_MESSAGE); @@ -344,12 +516,18 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D newProject.setName(I18n.getMessage("jsite.project.new-project.name")); newProject.setInsertURI(keyPair[0]); newProject.setRequestURI(keyPair[1]); - newProject.setEdition(1); + newProject.setEdition(-1); + newProject.setPath(""); projectListModel.add(newProject); - projectList.setSelectedIndex(projectListModel.size() - 1); + projectScrollPane.revalidate(); + projectScrollPane.repaint(); + projectList.setSelectedIndex(projectListModel.indexOf(newProject)); } - protected void actionDelete() { + /** + * Deletes the currently selected project. + */ + private void actionDelete() { int selectedIndex = projectList.getSelectedIndex(); if (selectedIndex > -1) { if (JOptionPane.showConfirmDialog(this, MessageFormat.format(I18n.getMessage("jsite.project.action.delete-project.confirm"), ((Project) projectList.getSelectedValue()).getName()), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.OK_OPTION) { @@ -362,7 +540,10 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D } } - protected void actionClone() { + /** + * Clones the currently selected project. + */ + private void actionClone() { int selectedIndex = projectList.getSelectedIndex(); if (selectedIndex > -1) { Project newProject = new Project((Project) projectList.getSelectedValue()); @@ -371,8 +552,12 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D projectList.setSelectedIndex(projectListModel.indexOf(newProject)); } } - - protected void actionCopyURI() { + + /** + * Copies the request URI of the currently selected project to the + * clipboard. + */ + private void actionCopyURI() { int selectedIndex = projectList.getSelectedIndex(); if (selectedIndex > -1) { Project selectedProject = (Project) projectList.getSelectedValue(); @@ -380,8 +565,11 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D clipboard.setContents(new StringSelection(selectedProject.getFinalRequestURI(0)), this); } } - - protected void actionGenerateNewKey() { + + /** + * Generates a new key for the currently selected project. + */ + private void actionGenerateNewKey() { if (JOptionPane.showConfirmDialog(this, I18n.getMessage("jsite.project.warning.generate-new-key"), null, JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) { return; } @@ -468,7 +656,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D public void changedUpdate(DocumentEvent documentEvent) { setTextField(documentEvent); } - + // // INTERFACE ClipboardOwner // @@ -477,6 +665,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D * {@inheritDoc} */ public void lostOwnership(Clipboard clipboard, Transferable contents) { + /* ignore. */ } }