Author: chatellier Date: 2009-10-26 14:56:18 +0000 (Mon, 26 Oct 2009) New Revision: 2689 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/CommitDialogUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateConfirmDialogUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateDialogUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSConfigUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSGenerateSshKeyUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSPassPhraseUI.jaxx Log: Add copyrigth and CDATA in jaxx scripts Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/CommitDialogUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/CommitDialogUI.jaxx 2009-10-26 14:55:36 UTC (rev 2688) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/CommitDialogUI.jaxx 2009-10-26 14:56:18 UTC (rev 2689) @@ -1,6 +1,24 @@ -<JDialog id="Update" modal="true" title='isisfish.vcs.commit'> - <!--width="400" height="300">--> - <script> +<!-- +/* *##% + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + --> +<JDialog modal="true" title='isisfish.vcs.commit'> + <script><![CDATA[ // FIXME a refaire // import org.nuiton.vcs.ui.FieldModelUtil.ModuleFile; @@ -25,7 +43,7 @@ protected void reSize(JTable table) { // implements me... } - + ]]> </script> <Table weightx="1"> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateConfirmDialogUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateConfirmDialogUI.jaxx 2009-10-26 14:55:36 UTC (rev 2688) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateConfirmDialogUI.jaxx 2009-10-26 14:56:18 UTC (rev 2689) @@ -1,5 +1,25 @@ +<!-- +/* *##% + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + --> + <JDialog modal="true" title='isisfish.vcs.updateconfirm'> - <script> + <script><![CDATA[ // FIXME a refaire @@ -27,6 +47,7 @@ public void doRefresh() { fr.ifremer.isisfish.ui.util.JaxxUtil.refresh(this,"checkAll.enabled","ok.enabled"); } + ]]> </script> <Table weightx="1"> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateDialogUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateDialogUI.jaxx 2009-10-26 14:55:36 UTC (rev 2688) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/UpdateDialogUI.jaxx 2009-10-26 14:56:18 UTC (rev 2689) @@ -1,5 +1,25 @@ +<!-- +/* *##% + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + --> + <JDialog modal="true" title='isisfish.vcs.update'> - <script> + <script><![CDATA[ // FIXME a refaire // import static org.nuiton.vcs.VCSState.*; @@ -30,6 +50,7 @@ // protected void reSize(VCSState state,JTable table) { // // } + ]]> </script> <Table weightx="1"> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSConfigUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSConfigUI.jaxx 2009-10-26 14:55:36 UTC (rev 2688) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSConfigUI.jaxx 2009-10-26 14:56:18 UTC (rev 2689) @@ -1,5 +1,25 @@ +<!-- +/* *##% + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + --> + <JDialog> - <script> + <script><![CDATA[ import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.HTMLDocument; import javax.swing.event.HyperlinkListener; @@ -7,6 +27,7 @@ import javax.swing.event.HyperlinkEvent; import java.io.PrintWriter; import java.io.StringWriter; + import java.net.URL; public boolean cancel; protected boolean invalidFirstName; @@ -23,6 +44,41 @@ private String oldFirstname; private String oldServerPrivateKeyFile; + init(); + + helpEditor.addHyperlinkListener(new HyperlinkListener() { + public void hyperlinkUpdate(HyperlinkEvent he) { + if (he.getEventType() == HyperlinkEvent.EventType.ACTIVATED && Desktop.isDesktopSupported()) { + + try { + URL u = he.getURL(); + Desktop.getDesktop().browse(u.toURI()); + } catch (Exception e) { + if (log.isWarnEnabled()) { + log.warn("Cannot open link (maybe defaut browser in not configured ?)"); + } + if (log.isDebugEnabled()) { + log.debug("Error while opening link", e); + } + } + } + } + }); + + protected void init() { + String REGISTER_KEY_URL = "https://labs.libre-entreprise.org/account/editsshkeys.php"; + String DOC_URL = "http://isis-fish.labs.libre-entreprise.org/isis-fish/v3/user/addSshKey.html"; + + StringBuilder builder = new StringBuilder(); + builder.append("<a href='").append(DOC_URL).append("'>"); + builder.append(_("isisfish.vcs.howto.save.key")).append("</a><br/>"); + builder.append("<a href='").append(REGISTER_KEY_URL).append("'>"); + builder.append(_("isisfish.vcs.save.key")).append("</a>"); + + helpEditor.setEditorKit(new HTMLEditorKit()); + helpEditor.setText(builder.toString()); + } + protected void saveOld() { this.oldFirstname=firstname.getText(); this.oldLastname=lasstname.getText(); @@ -49,9 +105,9 @@ } protected boolean check(boolean ssh) { - invalidFirstName=firstname.isVisible() && firstname.getText().isEmpty(); - invalidLastName=lasstname.isVisible() && lasstname.getText().isEmpty(); - invalidEmail=email.isVisible() && email.getText().isEmpty(); + invalidFirstName=firstname.isVisible() && firstname.getText().isEmpty(); + invalidLastName=lasstname.isVisible() && lasstname.getText().isEmpty(); + invalidEmail=email.isVisible() && email.getText().isEmpty(); if (ssh) { String file = serverPrivateKeyFile.getText(); invalidKey=file.isEmpty() || !new java.io.File(file).exists(); @@ -81,12 +137,13 @@ protected void setColor(boolean invalid, JComponent component) { component.setForeground(invalid ? Color.red: Color.black); } + ]]> </script> <Table> <row fill='horizontal'> <cell columns='2' weighty="1" fill='both'> <JScrollPane height="60"> - <JEditorPane id="doc" /> + <JEditorPane id="helpEditor" editable="false" /> </JScrollPane> </cell> </row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSGenerateSshKeyUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSGenerateSshKeyUI.jaxx 2009-10-26 14:55:36 UTC (rev 2688) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSGenerateSshKeyUI.jaxx 2009-10-26 14:56:18 UTC (rev 2689) @@ -1,3 +1,23 @@ +<!-- +/* *##% + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + --> + <JDialog title='isisfish.server.ssh.generateKey.title' modal='true'> <script><![CDATA[ import com.jcraft.jsch.JSch; Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSPassPhraseUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSPassPhraseUI.jaxx 2009-10-26 14:55:36 UTC (rev 2688) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/vcs/VCSPassPhraseUI.jaxx 2009-10-26 14:56:18 UTC (rev 2689) @@ -1,5 +1,25 @@ +<!-- +/* *##% + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + --> + <JDialog title='isisfish.vcs.ask.passphrase.title' modal='true'> - <script> + <script><![CDATA[ private boolean cancel; private static VCSPassPhraseUI instance; @@ -40,6 +60,7 @@ } + ]]> </script> <Table> <row fill='horizontal'>