From: David ‘Bombe’ Roden Date: Thu, 14 Jan 2010 13:14:33 +0000 (+0100) Subject: Update complete URI after keys or paths change. X-Git-Tag: 0.9~29 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=480acd6c333fdb27e934b1d1f71d87f2198da5cb;hp=8fbc65af048d4ad6f4c05a3e5a609ce6582b0e94;p=jSite.git Update complete URI after keys or paths change. --- diff --git a/src/de/todesbaum/jsite/gui/ProjectPage.java b/src/de/todesbaum/jsite/gui/ProjectPage.java index 770828d..eedb91a 100644 --- a/src/de/todesbaum/jsite/gui/ProjectPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectPage.java @@ -367,16 +367,30 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D * {@inheritDoc} */ @Override + @SuppressWarnings("synthetic-access") public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { super.insertString(fb, offset, string.replaceAll("/", ""), attr); + updateCompleteURI(); } /** * {@inheritDoc} */ @Override + @SuppressWarnings("synthetic-access") public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException { super.replace(fb, offset, length, text.replaceAll("/", ""), attrs); + updateCompleteURI(); + } + + /** + * {@inheritDoc} + */ + @Override + @SuppressWarnings("synthetic-access") + public void remove(FilterBypass fb, int offset, int length) throws BadLocationException { + super.remove(fb, offset, length); + updateCompleteURI(); } }); projectPathTextField.setEnabled(false); @@ -597,6 +611,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D if (!keyDialog.wasCancelled()) { selectedProject.setInsertURI(keyDialog.getPrivateKey()); selectedProject.setRequestURI(keyDialog.getPublicKey()); + updateCompleteURI(); } } } @@ -612,6 +627,18 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D if (selectedIndex > -1) { Project selectedProject = (Project) projectList.getSelectedValue(); selectedProject.setEdition(-1); + updateCompleteURI(); + } + } + + /** + * Updates the complete URI text field. + */ + private void updateCompleteURI() { + int selectedIndex = projectList.getSelectedIndex(); + if (selectedIndex > -1) { + Project selectedProject = (Project) projectList.getSelectedValue(); + projectCompleteUriTextField.setText(selectedProject.getFinalRequestURI(0)); } }