2 * jSite - a tool for uploading websites into Freenet
3 * Copyright (C) 2006 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package de.todesbaum.jsite.gui;
22 import java.awt.BorderLayout;
23 import java.awt.Dimension;
24 import java.awt.FlowLayout;
25 import java.awt.GridBagConstraints;
26 import java.awt.GridBagLayout;
27 import java.awt.Insets;
28 import java.awt.Toolkit;
29 import java.awt.datatransfer.Clipboard;
30 import java.awt.datatransfer.ClipboardOwner;
31 import java.awt.datatransfer.StringSelection;
32 import java.awt.datatransfer.Transferable;
33 import java.awt.event.ActionEvent;
34 import java.awt.event.KeyEvent;
35 import java.io.IOException;
36 import java.text.MessageFormat;
38 import javax.swing.AbstractAction;
39 import javax.swing.Action;
40 import javax.swing.JButton;
41 import javax.swing.JComponent;
42 import javax.swing.JFileChooser;
43 import javax.swing.JLabel;
44 import javax.swing.JList;
45 import javax.swing.JOptionPane;
46 import javax.swing.JPanel;
47 import javax.swing.JScrollPane;
48 import javax.swing.JTextField;
49 import javax.swing.ListSelectionModel;
50 import javax.swing.ScrollPaneConstants;
51 import javax.swing.border.EmptyBorder;
52 import javax.swing.event.DocumentEvent;
53 import javax.swing.event.DocumentListener;
54 import javax.swing.event.ListSelectionEvent;
55 import javax.swing.event.ListSelectionListener;
56 import javax.swing.text.BadLocationException;
57 import javax.swing.text.Document;
59 import de.todesbaum.jsite.application.Freenet7Interface;
60 import de.todesbaum.jsite.application.Project;
61 import de.todesbaum.jsite.i18n.I18n;
62 import de.todesbaum.jsite.i18n.I18nContainer;
63 import de.todesbaum.util.swing.SortedListModel;
64 import de.todesbaum.util.swing.TLabel;
65 import de.todesbaum.util.swing.TWizard;
66 import de.todesbaum.util.swing.TWizardPage;
69 * @author David Roden <droden@gmail.com>
72 public class ProjectPage extends TWizardPage implements ListSelectionListener, DocumentListener, ClipboardOwner {
74 private Freenet7Interface freenetInterface;
76 protected Action projectLocalPathBrowseAction;
77 protected Action projectAddAction;
78 protected Action projectDeleteAction;
79 protected Action projectCloneAction;
80 protected Action projectCopyURIAction;
81 protected Action projectGenerateKeyAction;
83 private JFileChooser pathChooser;
84 private SortedListModel projectListModel;
85 private JScrollPane projectScrollPane;
86 private JList projectList;
87 private JTextField projectNameTextField;
88 private JTextField projectDescriptionTextField;
89 private JTextField projectLocalPathTextField;
90 private JTextField projectPublicKeyTextField;
91 private JTextField projectPrivateKeyTextField;
92 private JTextField projectPathTextField;
94 public ProjectPage(final TWizard wizard) {
96 setLayout(new BorderLayout(12, 12));
98 setHeading(I18n.getMessage("jsite.project.heading"));
99 setDescription(I18n.getMessage("jsite.project.description"));
101 I18nContainer.getInstance().registerRunnable(new Runnable() {
104 setHeading(I18n.getMessage("jsite.project.heading"));
105 setDescription(I18n.getMessage("jsite.project.description"));
110 protected void dialogInit() {
113 pathChooser = new JFileChooser();
114 projectListModel = new SortedListModel();
115 projectList = new JList(projectListModel);
116 projectList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
117 projectList.addListSelectionListener(this);
118 projectList.setPreferredSize(new Dimension(150, projectList.getPreferredSize().height));
120 add(projectScrollPane = new JScrollPane(projectList), BorderLayout.LINE_START);
121 add(createInformationPanel(), BorderLayout.CENTER);
128 public void pageAdded(TWizard wizard) {
129 super.pageAdded(wizard);
130 projectList.clearSelection();
131 this.wizard.setPreviousName(I18n.getMessage("jsite.menu.nodes.manage-nodes"));
132 this.wizard.setNextName(I18n.getMessage("jsite.wizard.next"));
133 this.wizard.setQuitName(I18n.getMessage("jsite.wizard.quit"));
134 this.wizard.setNextEnabled(false);
139 public void addListSelectionListener(ListSelectionListener listener) {
140 projectList.addListSelectionListener(listener);
145 public void removeListSelectionListener(ListSelectionListener listener) {
146 projectList.removeListSelectionListener(listener);
149 private void createActions() {
150 projectLocalPathBrowseAction = new AbstractAction(I18n.getMessage("jsite.project.action.browse")) {
152 public void actionPerformed(ActionEvent actionEvent) {
153 actionLocalPathBrowse();
156 projectLocalPathBrowseAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.browse.tooltip"));
157 projectLocalPathBrowseAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_B);
158 projectLocalPathBrowseAction.setEnabled(false);
160 projectAddAction = new AbstractAction(I18n.getMessage("jsite.project.action.add-project")) {
162 public void actionPerformed(ActionEvent actionEvent) {
166 projectAddAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.add-project.tooltip"));
167 projectAddAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_A);
169 projectDeleteAction = new AbstractAction(I18n.getMessage("jsite.project.action.delete-project")) {
171 public void actionPerformed(ActionEvent actionEvent) {
175 projectDeleteAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.delete-project.tooltip"));
176 projectDeleteAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_D);
177 projectDeleteAction.setEnabled(false);
179 projectCloneAction = new AbstractAction(I18n.getMessage("jsite.project.action.clone-project")) {
181 public void actionPerformed(ActionEvent actionEvent) {
185 projectCloneAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.clone-project.tooltip"));
186 projectCloneAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_L);
187 projectCloneAction.setEnabled(false);
189 projectCopyURIAction = new AbstractAction(I18n.getMessage("jsite.project.action.copy-uri")) {
191 public void actionPerformed(ActionEvent actionEvent) {
195 projectCopyURIAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.copy-uri.tooltip"));
196 projectCopyURIAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_U);
197 projectCopyURIAction.setEnabled(false);
199 projectGenerateKeyAction = new AbstractAction(I18n.getMessage("jsite.project.action.generate-new-key")) {
201 public void actionPerformed(ActionEvent actionEvent) {
202 actionGenerateNewKey();
205 projectGenerateKeyAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.generate-new-key.tooltip"));
206 projectGenerateKeyAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_G);
207 projectGenerateKeyAction.setEnabled(false);
209 I18nContainer.getInstance().registerRunnable(new Runnable() {
212 projectLocalPathBrowseAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.browse"));
213 projectLocalPathBrowseAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.browse.tooltip"));
214 projectAddAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.add-project"));
215 projectAddAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.add-project.tooltip"));
216 projectDeleteAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.delete-project"));
217 projectDeleteAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.delete-project.tooltip"));
218 projectCloneAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.clone-project"));
219 projectCloneAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.clone-project.tooltip"));
220 projectCopyURIAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.copy-uri"));
221 projectCopyURIAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.copy-uri.tooltip"));
222 projectGenerateKeyAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.generate-new-key"));
223 projectGenerateKeyAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.generate-new-key.tooltip"));
228 private JComponent createInformationPanel() {
229 JPanel informationPanel = new JPanel(new BorderLayout(12, 12));
231 JPanel informationTable = new JPanel(new GridBagLayout());
233 JPanel functionButtons = new JPanel(new FlowLayout(FlowLayout.LEADING, 12, 12));
234 functionButtons.setBorder(new EmptyBorder(-12, -12, -12, -12));
235 functionButtons.add(new JButton(projectAddAction));
236 functionButtons.add(new JButton(projectDeleteAction));
237 functionButtons.add(new JButton(projectCloneAction));
238 functionButtons.add(new JButton(projectCopyURIAction));
240 informationPanel.add(functionButtons, BorderLayout.PAGE_START);
241 informationPanel.add(informationTable, BorderLayout.CENTER);
243 final JLabel projectInformationLabel = new JLabel("<html><b>" + I18n.getMessage("jsite.project.project.information") + "</b></html>");
244 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));
246 projectNameTextField = new JTextField();
247 projectNameTextField.getDocument().putProperty("name", "project.name");
248 projectNameTextField.getDocument().addDocumentListener(this);
249 projectNameTextField.setEnabled(false);
251 final TLabel projectNameLabel = new TLabel(I18n.getMessage("jsite.project.project.name") + ":", KeyEvent.VK_N, projectNameTextField);
252 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));
253 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));
255 projectDescriptionTextField = new JTextField();
256 projectDescriptionTextField.getDocument().putProperty("name", "project.description");
257 projectDescriptionTextField.getDocument().addDocumentListener(this);
258 projectDescriptionTextField.setEnabled(false);
260 final TLabel projectDescriptionLabel = new TLabel(I18n.getMessage("jsite.project.project.description") + ":", KeyEvent.VK_D, projectDescriptionTextField);
261 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));
262 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));
264 projectLocalPathTextField = new JTextField();
265 projectLocalPathTextField.getDocument().putProperty("name", "project.localpath");
266 projectLocalPathTextField.getDocument().addDocumentListener(this);
267 projectLocalPathTextField.setEnabled(false);
269 final TLabel projectLocalPathLabel = new TLabel(I18n.getMessage("jsite.project.project.local-path") + ":", KeyEvent.VK_L, projectLocalPathTextField);
270 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));
271 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));
272 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));
274 final JLabel projectAddressLabel = new JLabel("<html><b>" + I18n.getMessage("jsite.project.project.address") + "</b></html>");
275 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));
277 projectPublicKeyTextField = new JTextField(27);
278 projectPublicKeyTextField.getDocument().putProperty("name", "project.publickey");
279 projectPublicKeyTextField.getDocument().addDocumentListener(this);
280 projectPublicKeyTextField.setEnabled(false);
282 final TLabel projectPublicKeyLabel = new TLabel(I18n.getMessage("jsite.project.project.public-key") + ":", KeyEvent.VK_U, projectPublicKeyTextField);
283 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));
284 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));
285 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));
287 projectPrivateKeyTextField = new JTextField(27);
288 projectPrivateKeyTextField.getDocument().putProperty("name", "project.privatekey");
289 projectPrivateKeyTextField.getDocument().addDocumentListener(this);
290 projectPrivateKeyTextField.setEnabled(false);
292 final TLabel projectPrivateKeyLabel = new TLabel(I18n.getMessage("jsite.project.project.private-key") + ":", KeyEvent.VK_R, projectPrivateKeyTextField);
293 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));
294 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));
296 projectPathTextField = new JTextField();
297 projectPathTextField.getDocument().putProperty("name", "project.path");
298 projectPathTextField.getDocument().addDocumentListener(this);
299 projectPathTextField.setEnabled(false);
301 final TLabel projectPathLabel = new TLabel(I18n.getMessage("jsite.project.project.path") + ":", KeyEvent.VK_P, projectPathTextField);
302 I18nContainer.getInstance().registerRunnable(new Runnable() {
305 projectInformationLabel.setText("<html><b>" + I18n.getMessage("jsite.project.project.information") + "</b></html>");
306 projectNameLabel.setText(I18n.getMessage("jsite.project.project.name") + ":");
307 projectDescriptionLabel.setText(I18n.getMessage("jsite.project.project.description") + ":");
308 projectLocalPathLabel.setText(I18n.getMessage("jsite.project.project.local-path") + ":");
309 projectAddressLabel.setText("<html><b>" + I18n.getMessage("jsite.project.project.address") + "</b></html>");
310 projectPublicKeyLabel.setText(I18n.getMessage("jsite.project.project.public-key") + ":");
311 projectPrivateKeyLabel.setText(I18n.getMessage("jsite.project.project.private-key") + ":");
312 projectPathLabel.setText(I18n.getMessage("jsite.project.project.path") + ":");
315 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));
316 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));
318 return informationPanel;
321 public void setProjects(Project[] projects) {
322 projectListModel.clear();
323 for (Project project: projects) {
324 projectListModel.add(project);
328 public Project[] getProjects() {
329 return (Project[]) projectListModel.toArray(new Project[projectListModel.size()]);
333 * @param freenetInterface
334 * The freenetInterface to set.
336 public void setFreenetInterface(Freenet7Interface freenetInterface) {
337 this.freenetInterface = freenetInterface;
340 public Project getSelectedProject() {
341 return (Project) projectList.getSelectedValue();
344 private void setTextField(DocumentEvent documentEvent) {
345 Document document = documentEvent.getDocument();
346 String propertyName = (String) document.getProperty("name");
347 Project project = (Project) projectList.getSelectedValue();
348 if (project == null) {
352 String text = document.getText(0, document.getLength()).trim();
353 if ("project.name".equals(propertyName)) {
354 project.setName(text);
355 projectList.repaint();
356 } else if ("project.description".equals(propertyName)) {
357 project.setDescription(text);
358 } else if ("project.localpath".equals(propertyName)) {
359 project.setLocalPath(text);
360 } else if ("project.privatekey".equals(propertyName)) {
361 project.setInsertURI(text);
362 } else if ("project.publickey".equals(propertyName)) {
363 project.setRequestURI(text);
364 } else if ("project.path".equals(propertyName)) {
365 project.setPath(text);
367 } catch (BadLocationException e) {
375 protected void actionLocalPathBrowse() {
376 Project project = (Project) projectList.getSelectedValue();
377 if (project == null) {
380 pathChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
381 if (pathChooser.showDialog(this, I18n.getMessage("jsite.project.action.browse.choose")) == JFileChooser.APPROVE_OPTION) {
382 projectLocalPathTextField.setText(pathChooser.getSelectedFile().getPath());
386 protected void actionAdd() {
387 String[] keyPair = null;
388 if (!freenetInterface.hasNode()) {
389 JOptionPane.showMessageDialog(this, I18n.getMessage("jsite.project-files.no-node-selected"), null, JOptionPane.ERROR_MESSAGE);
393 keyPair = freenetInterface.generateKeyPair();
394 } catch (IOException ioe1) {
395 JOptionPane.showMessageDialog(this, MessageFormat.format(I18n.getMessage("jsite.project.keygen.io-error"), ioe1.getMessage()), null, JOptionPane.ERROR_MESSAGE);
398 Project newProject = new Project();
399 newProject.setName(I18n.getMessage("jsite.project.new-project.name"));
400 newProject.setInsertURI(keyPair[0]);
401 newProject.setRequestURI(keyPair[1]);
402 newProject.setEdition(0);
403 projectListModel.add(newProject);
404 projectScrollPane.revalidate();
405 projectScrollPane.repaint();
406 projectList.setSelectedIndex(projectListModel.size() - 1);
409 protected void actionDelete() {
410 int selectedIndex = projectList.getSelectedIndex();
411 if (selectedIndex > -1) {
412 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) {
413 projectListModel.remove(selectedIndex);
414 projectList.clearSelection();
415 if (projectListModel.getSize() != 0) {
416 projectList.setSelectedIndex(Math.min(selectedIndex, projectListModel.getSize() - 1));
422 protected void actionClone() {
423 int selectedIndex = projectList.getSelectedIndex();
424 if (selectedIndex > -1) {
425 Project newProject = new Project((Project) projectList.getSelectedValue());
426 newProject.setName(MessageFormat.format(I18n.getMessage("jsite.project.action.clone-project.copy"), newProject.getName()));
427 projectListModel.add(newProject);
428 projectList.setSelectedIndex(projectListModel.indexOf(newProject));
432 protected void actionCopyURI() {
433 int selectedIndex = projectList.getSelectedIndex();
434 if (selectedIndex > -1) {
435 Project selectedProject = (Project) projectList.getSelectedValue();
436 Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
437 clipboard.setContents(new StringSelection(selectedProject.getFinalRequestURI(0)), this);
441 protected void actionGenerateNewKey() {
442 if (JOptionPane.showConfirmDialog(this, I18n.getMessage("jsite.project.warning.generate-new-key"), null, JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) {
445 int selectedIndex = projectList.getSelectedIndex();
446 if (selectedIndex > -1) {
447 Project selectedProject = (Project) projectList.getSelectedValue();
448 String[] keyPair = null;
450 keyPair = freenetInterface.generateKeyPair();
451 } catch (IOException ioe1) {
452 JOptionPane.showMessageDialog(this, MessageFormat.format(I18n.getMessage("jsite.project.keygen.io-error"), ioe1.getMessage()), null, JOptionPane.ERROR_MESSAGE);
455 selectedProject.setInsertURI(keyPair[0]);
456 selectedProject.setRequestURI(keyPair[1]);
457 projectPublicKeyTextField.setText(selectedProject.getRequestURI());
458 projectPrivateKeyTextField.setText(selectedProject.getInsertURI());
463 // INTERFACE ListSelectionListener
469 public void valueChanged(ListSelectionEvent listSelectionEvent) {
470 int selectedRow = projectList.getSelectedIndex();
471 Project selectedProject = (Project) projectList.getSelectedValue();
472 projectNameTextField.setEnabled(selectedRow > -1);
473 projectDescriptionTextField.setEnabled(selectedRow > -1);
474 projectLocalPathTextField.setEnabled(selectedRow > -1);
475 projectPublicKeyTextField.setEnabled(selectedRow > -1);
476 projectPrivateKeyTextField.setEnabled(selectedRow > -1);
477 projectPathTextField.setEnabled(selectedRow > -1);
478 projectLocalPathBrowseAction.setEnabled(selectedRow > -1);
479 projectDeleteAction.setEnabled(selectedRow > -1);
480 projectCloneAction.setEnabled(selectedRow > -1);
481 projectCopyURIAction.setEnabled(selectedRow > -1);
482 projectGenerateKeyAction.setEnabled(selectedRow > -1);
483 if (selectedRow > -1) {
484 projectNameTextField.setText(selectedProject.getName());
485 projectDescriptionTextField.setText(selectedProject.getDescription());
486 projectLocalPathTextField.setText(selectedProject.getLocalPath());
487 projectPublicKeyTextField.setText(selectedProject.getRequestURI());
488 projectPrivateKeyTextField.setText(selectedProject.getInsertURI());
489 projectPathTextField.setText(selectedProject.getPath());
491 projectNameTextField.setText("");
492 projectDescriptionTextField.setText("");
493 projectLocalPathTextField.setText("");
494 projectPublicKeyTextField.setText("");
495 projectPrivateKeyTextField.setText("");
496 projectPathTextField.setText("");
501 // INTERFACE ChangeListener
505 // INTERFACE DocumentListener
511 public void insertUpdate(DocumentEvent documentEvent) {
512 setTextField(documentEvent);
518 public void removeUpdate(DocumentEvent documentEvent) {
519 setTextField(documentEvent);
525 public void changedUpdate(DocumentEvent documentEvent) {
526 setTextField(documentEvent);
530 // INTERFACE ClipboardOwner
536 public void lostOwnership(Clipboard clipboard, Transferable contents) {