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.border.EmptyBorder;
51 import javax.swing.event.DocumentEvent;
52 import javax.swing.event.DocumentListener;
53 import javax.swing.event.ListSelectionEvent;
54 import javax.swing.event.ListSelectionListener;
55 import javax.swing.text.BadLocationException;
56 import javax.swing.text.Document;
58 import de.todesbaum.jsite.application.Freenet7Interface;
59 import de.todesbaum.jsite.application.Project;
60 import de.todesbaum.jsite.i18n.I18n;
61 import de.todesbaum.jsite.i18n.I18nContainer;
62 import de.todesbaum.util.swing.SortedListModel;
63 import de.todesbaum.util.swing.TLabel;
64 import de.todesbaum.util.swing.TWizard;
65 import de.todesbaum.util.swing.TWizardPage;
68 * @author David Roden <droden@gmail.com>
71 public class ProjectPage extends TWizardPage implements ListSelectionListener, DocumentListener, ClipboardOwner {
73 private Freenet7Interface freenetInterface;
75 protected Action projectLocalPathBrowseAction;
76 protected Action projectAddAction;
77 protected Action projectDeleteAction;
78 protected Action projectCloneAction;
79 protected Action projectCopyURIAction;
80 protected Action projectGenerateKeyAction;
82 private JFileChooser pathChooser;
83 private SortedListModel projectListModel;
84 private JList projectList;
85 private JTextField projectNameTextField;
86 private JTextField projectDescriptionTextField;
87 private JTextField projectLocalPathTextField;
88 private JTextField projectPublicKeyTextField;
89 private JTextField projectPrivateKeyTextField;
90 private JTextField projectPathTextField;
92 public ProjectPage(final TWizard wizard) {
94 setLayout(new BorderLayout(12, 12));
96 setHeading(I18n.getMessage("jsite.project.heading"));
97 setDescription(I18n.getMessage("jsite.project.description"));
99 I18nContainer.getInstance().registerRunnable(new Runnable() {
102 setHeading(I18n.getMessage("jsite.project.heading"));
103 setDescription(I18n.getMessage("jsite.project.description"));
108 protected void dialogInit() {
111 pathChooser = new JFileChooser();
112 projectListModel = new SortedListModel();
113 projectList = new JList(projectListModel);
114 projectList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
115 projectList.addListSelectionListener(this);
116 projectList.setPreferredSize(new Dimension(150, projectList.getPreferredSize().height));
118 add(new JScrollPane(projectList), BorderLayout.LINE_START);
119 add(createInformationPanel(), BorderLayout.CENTER);
126 public void pageAdded(TWizard wizard) {
127 super.pageAdded(wizard);
128 projectList.clearSelection();
129 this.wizard.setPreviousName(I18n.getMessage("jsite.menu.nodes.manage-nodes"));
130 this.wizard.setNextName(I18n.getMessage("jsite.wizard.next"));
131 this.wizard.setQuitName(I18n.getMessage("jsite.wizard.quit"));
132 this.wizard.setNextEnabled(false);
137 public void addListSelectionListener(ListSelectionListener listener) {
138 projectList.addListSelectionListener(listener);
143 public void removeListSelectionListener(ListSelectionListener listener) {
144 projectList.removeListSelectionListener(listener);
147 private void createActions() {
148 projectLocalPathBrowseAction = new AbstractAction(I18n.getMessage("jsite.project.action.browse")) {
150 public void actionPerformed(ActionEvent actionEvent) {
151 actionLocalPathBrowse();
154 projectLocalPathBrowseAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.browse.tooltip"));
155 projectLocalPathBrowseAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_B);
156 projectLocalPathBrowseAction.setEnabled(false);
158 projectAddAction = new AbstractAction(I18n.getMessage("jsite.project.action.add-project")) {
160 public void actionPerformed(ActionEvent actionEvent) {
164 projectAddAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.add-project.tooltip"));
165 projectAddAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_A);
167 projectDeleteAction = new AbstractAction(I18n.getMessage("jsite.project.action.delete-project")) {
169 public void actionPerformed(ActionEvent actionEvent) {
173 projectDeleteAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.delete-project.tooltip"));
174 projectDeleteAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_D);
175 projectDeleteAction.setEnabled(false);
177 projectCloneAction = new AbstractAction(I18n.getMessage("jsite.project.action.clone-project")) {
179 public void actionPerformed(ActionEvent actionEvent) {
183 projectCloneAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.clone-project.tooltip"));
184 projectCloneAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_L);
185 projectCloneAction.setEnabled(false);
187 projectCopyURIAction = new AbstractAction(I18n.getMessage("jsite.project.action.copy-uri")) {
189 public void actionPerformed(ActionEvent actionEvent) {
193 projectCopyURIAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.copy-uri.tooltip"));
194 projectCopyURIAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_U);
195 projectCopyURIAction.setEnabled(false);
197 projectGenerateKeyAction = new AbstractAction(I18n.getMessage("jsite.project.action.generate-new-key")) {
199 public void actionPerformed(ActionEvent actionEvent) {
200 actionGenerateNewKey();
203 projectGenerateKeyAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.generate-new-key.tooltip"));
204 projectGenerateKeyAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_G);
205 projectGenerateKeyAction.setEnabled(false);
207 I18nContainer.getInstance().registerRunnable(new Runnable() {
210 projectLocalPathBrowseAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.browse"));
211 projectLocalPathBrowseAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.browse.tooltip"));
212 projectAddAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.add-project"));
213 projectAddAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.add-project.tooltip"));
214 projectDeleteAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.delete-project"));
215 projectDeleteAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.delete-project.tooltip"));
216 projectCloneAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.clone-project"));
217 projectCloneAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.clone-project.tooltip"));
218 projectCopyURIAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.copy-uri"));
219 projectCopyURIAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.copy-uri.tooltip"));
220 projectGenerateKeyAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.generate-new-key"));
221 projectGenerateKeyAction.putValue(Action.SHORT_DESCRIPTION, I18n.getMessage("jsite.project.action.generate-new-key.tooltip"));
226 private JComponent createInformationPanel() {
227 JPanel informationPanel = new JPanel(new BorderLayout(12, 12));
229 JPanel informationTable = new JPanel(new GridBagLayout());
231 JPanel functionButtons = new JPanel(new FlowLayout(FlowLayout.LEADING, 12, 12));
232 functionButtons.setBorder(new EmptyBorder(-12, -12, -12, -12));
233 functionButtons.add(new JButton(projectAddAction));
234 functionButtons.add(new JButton(projectDeleteAction));
235 functionButtons.add(new JButton(projectCloneAction));
236 functionButtons.add(new JButton(projectCopyURIAction));
238 informationPanel.add(functionButtons, BorderLayout.PAGE_START);
239 informationPanel.add(informationTable, BorderLayout.CENTER);
241 final JLabel projectInformationLabel = new JLabel("<html><b>" + I18n.getMessage("jsite.project.project.information") + "</b></html>");
242 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));
244 projectNameTextField = new JTextField();
245 projectNameTextField.getDocument().putProperty("name", "project.name");
246 projectNameTextField.getDocument().addDocumentListener(this);
247 projectNameTextField.setEnabled(false);
249 final TLabel projectNameLabel = new TLabel(I18n.getMessage("jsite.project.project.name") + ":", KeyEvent.VK_N, projectNameTextField);
250 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));
251 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));
253 projectDescriptionTextField = new JTextField();
254 projectDescriptionTextField.getDocument().putProperty("name", "project.description");
255 projectDescriptionTextField.getDocument().addDocumentListener(this);
256 projectDescriptionTextField.setEnabled(false);
258 final TLabel projectDescriptionLabel = new TLabel(I18n.getMessage("jsite.project.project.description") + ":", KeyEvent.VK_D, projectDescriptionTextField);
259 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));
260 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));
262 projectLocalPathTextField = new JTextField();
263 projectLocalPathTextField.getDocument().putProperty("name", "project.localpath");
264 projectLocalPathTextField.getDocument().addDocumentListener(this);
265 projectLocalPathTextField.setEnabled(false);
267 final TLabel projectLocalPathLabel = new TLabel(I18n.getMessage("jsite.project.project.local-path") + ":", KeyEvent.VK_L, projectLocalPathTextField);
268 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));
269 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));
270 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));
272 final JLabel projectAddressLabel = new JLabel("<html><b>" + I18n.getMessage("jsite.project.project.address") + "</b></html>");
273 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));
275 projectPublicKeyTextField = new JTextField(27);
276 projectPublicKeyTextField.getDocument().putProperty("name", "project.publickey");
277 projectPublicKeyTextField.getDocument().addDocumentListener(this);
278 projectPublicKeyTextField.setEnabled(false);
280 final TLabel projectPublicKeyLabel = new TLabel(I18n.getMessage("jsite.project.project.public-key") + ":", KeyEvent.VK_U, projectPublicKeyTextField);
281 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));
282 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));
283 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));
285 projectPrivateKeyTextField = new JTextField(27);
286 projectPrivateKeyTextField.getDocument().putProperty("name", "project.privatekey");
287 projectPrivateKeyTextField.getDocument().addDocumentListener(this);
288 projectPrivateKeyTextField.setEnabled(false);
290 final TLabel projectPrivateKeyLabel = new TLabel(I18n.getMessage("jsite.project.project.private-key") + ":", KeyEvent.VK_R, projectPrivateKeyTextField);
291 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));
292 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));
294 projectPathTextField = new JTextField();
295 projectPathTextField.getDocument().putProperty("name", "project.path");
296 projectPathTextField.getDocument().addDocumentListener(this);
297 projectPathTextField.setEnabled(false);
299 final TLabel projectPathLabel = new TLabel(I18n.getMessage("jsite.project.project.path") + ":", KeyEvent.VK_P, projectPathTextField);
300 I18nContainer.getInstance().registerRunnable(new Runnable() {
303 projectInformationLabel.setText("<html><b>" + I18n.getMessage("jsite.project.project.information") + "</b></html>");
304 projectNameLabel.setText(I18n.getMessage("jsite.project.project.name") + ":");
305 projectDescriptionLabel.setText(I18n.getMessage("jsite.project.project.description") + ":");
306 projectLocalPathLabel.setText(I18n.getMessage("jsite.project.project.local-path") + ":");
307 projectAddressLabel.setText("<html><b>" + I18n.getMessage("jsite.project.project.address") + "</b></html>");
308 projectPublicKeyLabel.setText(I18n.getMessage("jsite.project.project.public-key") + ":");
309 projectPrivateKeyLabel.setText(I18n.getMessage("jsite.project.project.private-key") + ":");
310 projectPathLabel.setText(I18n.getMessage("jsite.project.project.path") + ":");
313 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));
314 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));
316 return informationPanel;
319 public void setProjects(Project[] projects) {
320 projectListModel.clear();
321 for (Project project: projects) {
322 projectListModel.add(project);
326 public Project[] getProjects() {
327 return (Project[]) projectListModel.toArray(new Project[projectListModel.size()]);
331 * @param freenetInterface
332 * The freenetInterface to set.
334 public void setFreenetInterface(Freenet7Interface freenetInterface) {
335 this.freenetInterface = freenetInterface;
338 public Project getSelectedProject() {
339 return (Project) projectList.getSelectedValue();
342 private void setTextField(DocumentEvent documentEvent) {
343 Document document = documentEvent.getDocument();
344 String propertyName = (String) document.getProperty("name");
345 Project project = (Project) projectList.getSelectedValue();
346 if (project == null) {
350 String text = document.getText(0, document.getLength()).trim();
351 if ("project.name".equals(propertyName)) {
352 project.setName(text);
353 projectList.repaint();
354 } else if ("project.description".equals(propertyName)) {
355 project.setDescription(text);
356 } else if ("project.localpath".equals(propertyName)) {
357 project.setLocalPath(text);
358 } else if ("project.privatekey".equals(propertyName)) {
359 project.setInsertURI(text);
360 } else if ("project.publickey".equals(propertyName)) {
361 project.setRequestURI(text);
362 } else if ("project.path".equals(propertyName)) {
363 project.setPath(text);
365 } catch (BadLocationException e) {
373 protected void actionLocalPathBrowse() {
374 Project project = (Project) projectList.getSelectedValue();
375 if (project == null) {
378 pathChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
379 if (pathChooser.showDialog(this, I18n.getMessage("jsite.project.action.browse.choose")) == JFileChooser.APPROVE_OPTION) {
380 projectLocalPathTextField.setText(pathChooser.getSelectedFile().getPath());
384 protected void actionAdd() {
385 String[] keyPair = null;
386 if (!freenetInterface.hasNode()) {
387 JOptionPane.showMessageDialog(this, I18n.getMessage("jsite.project-files.no-node-selected"), null, JOptionPane.ERROR_MESSAGE);
391 keyPair = freenetInterface.generateKeyPair();
392 } catch (IOException ioe1) {
393 JOptionPane.showMessageDialog(this, MessageFormat.format(I18n.getMessage("jsite.project.keygen.io-error"), ioe1.getMessage()), null, JOptionPane.ERROR_MESSAGE);
396 Project newProject = new Project();
397 newProject.setName(I18n.getMessage("jsite.project.new-project.name"));
398 newProject.setInsertURI(keyPair[0]);
399 newProject.setRequestURI(keyPair[1]);
400 newProject.setEdition(1);
401 projectListModel.add(newProject);
402 projectList.setSelectedIndex(projectListModel.size() - 1);
405 protected void actionDelete() {
406 int selectedIndex = projectList.getSelectedIndex();
407 if (selectedIndex > -1) {
408 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) {
409 projectListModel.remove(selectedIndex);
410 projectList.clearSelection();
411 if (projectListModel.getSize() != 0) {
412 projectList.setSelectedIndex(Math.min(selectedIndex, projectListModel.getSize() - 1));
418 protected void actionClone() {
419 int selectedIndex = projectList.getSelectedIndex();
420 if (selectedIndex > -1) {
421 Project newProject = new Project((Project) projectList.getSelectedValue());
422 newProject.setName(MessageFormat.format(I18n.getMessage("jsite.project.action.clone-project.copy"), newProject.getName()));
423 projectListModel.add(newProject);
424 projectList.setSelectedIndex(projectListModel.indexOf(newProject));
428 protected void actionCopyURI() {
429 int selectedIndex = projectList.getSelectedIndex();
430 if (selectedIndex > -1) {
431 Project selectedProject = (Project) projectList.getSelectedValue();
432 Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
433 clipboard.setContents(new StringSelection(selectedProject.getFinalRequestURI(0)), this);
437 protected void actionGenerateNewKey() {
438 if (JOptionPane.showConfirmDialog(this, I18n.getMessage("jsite.project.warning.generate-new-key"), null, JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) {
441 int selectedIndex = projectList.getSelectedIndex();
442 if (selectedIndex > -1) {
443 Project selectedProject = (Project) projectList.getSelectedValue();
444 String[] keyPair = null;
446 keyPair = freenetInterface.generateKeyPair();
447 } catch (IOException ioe1) {
448 JOptionPane.showMessageDialog(this, MessageFormat.format(I18n.getMessage("jsite.project.keygen.io-error"), ioe1.getMessage()), null, JOptionPane.ERROR_MESSAGE);
451 selectedProject.setInsertURI(keyPair[0]);
452 selectedProject.setRequestURI(keyPair[1]);
453 projectPublicKeyTextField.setText(selectedProject.getRequestURI());
454 projectPrivateKeyTextField.setText(selectedProject.getInsertURI());
459 // INTERFACE ListSelectionListener
465 public void valueChanged(ListSelectionEvent listSelectionEvent) {
466 int selectedRow = projectList.getSelectedIndex();
467 Project selectedProject = (Project) projectList.getSelectedValue();
468 projectNameTextField.setEnabled(selectedRow > -1);
469 projectDescriptionTextField.setEnabled(selectedRow > -1);
470 projectLocalPathTextField.setEnabled(selectedRow > -1);
471 projectPublicKeyTextField.setEnabled(selectedRow > -1);
472 projectPrivateKeyTextField.setEnabled(selectedRow > -1);
473 projectPathTextField.setEnabled(selectedRow > -1);
474 projectLocalPathBrowseAction.setEnabled(selectedRow > -1);
475 projectDeleteAction.setEnabled(selectedRow > -1);
476 projectCloneAction.setEnabled(selectedRow > -1);
477 projectCopyURIAction.setEnabled(selectedRow > -1);
478 projectGenerateKeyAction.setEnabled(selectedRow > -1);
479 if (selectedRow > -1) {
480 projectNameTextField.setText(selectedProject.getName());
481 projectDescriptionTextField.setText(selectedProject.getDescription());
482 projectLocalPathTextField.setText(selectedProject.getLocalPath());
483 projectPublicKeyTextField.setText(selectedProject.getRequestURI());
484 projectPrivateKeyTextField.setText(selectedProject.getInsertURI());
485 projectPathTextField.setText(selectedProject.getPath());
487 projectNameTextField.setText("");
488 projectDescriptionTextField.setText("");
489 projectLocalPathTextField.setText("");
490 projectPublicKeyTextField.setText("");
491 projectPrivateKeyTextField.setText("");
492 projectPathTextField.setText("");
497 // INTERFACE ChangeListener
501 // INTERFACE DocumentListener
507 public void insertUpdate(DocumentEvent documentEvent) {
508 setTextField(documentEvent);
514 public void removeUpdate(DocumentEvent documentEvent) {
515 setTextField(documentEvent);
521 public void changedUpdate(DocumentEvent documentEvent) {
522 setTextField(documentEvent);
526 // INTERFACE ClipboardOwner
532 public void lostOwnership(Clipboard clipboard, Transferable contents) {