Buix-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- 1440 discussions
r639 - trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:42:16 +0000 (Sun, 27 Apr 2008)
New Revision: 639
Modified:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx
Log:
renommage ConfigUI en ConnexionConfigUI
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx 2008-04-27 08:40:56 UTC (rev 638)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx 2008-04-27 08:42:16 UTC (rev 639)
@@ -3,7 +3,7 @@
<script>import static org.codelutin.vcs.ui.VCSUIFactory.*;</script>
<JToolBar>
<JButton id='showFirstLaunch' onActionPerformed="showUI(IDENTITY_UI)"/>
- <JButton id='showConfig' onActionPerformed="showUI(CONFIG_UI)" />
+ <JButton id='showConfig' onActionPerformed="showUI(CONNEXION_CONFIG_UI)" />
<JButton id='showSynch' onActionPerformed="showUI(SYNCH_UI)"/>
<Table fill='both' insets='0,0,0,0'>
<row>
1
0
r638 - trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:40:56 +0000 (Sun, 27 Apr 2008)
New Revision: 638
Modified:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx
Log:
renommage ConfigUI en ConnexionConfigUI
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-04-27 08:40:06 UTC (rev 637)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-04-27 08:40:56 UTC (rev 638)
@@ -1,4 +1,4 @@
-<ConfigUI modal='true' resizable='false'>
+<ConnexionConfigUI modal='true' resizable='false'>
<style source="config.css"/>
<script>
import static org.codelutin.vcs.type.VCSConnexionMode.*;
@@ -130,4 +130,4 @@
</row>
</Table>
-</ConfigUI>
+</ConnexionConfigUI>
1
0
r637 - in trunk/lutinvcs: tools/src/test/java/org/codelutin/vcs ui/common/src/main/java/org/codelutin/vcs/ui ui/common/src/main/java/org/codelutin/vcs/ui/action ui/common/src/main/java/org/codelutin/vcs/ui/handler
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:40:06 +0000 (Sun, 27 Apr 2008)
New Revision: 637
Modified:
trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java
Log:
renommage ConfigUI en ConnexionConfigUI
Modified: trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java
===================================================================
--- trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java 2008-04-27 08:39:32 UTC (rev 636)
+++ trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java 2008-04-27 08:40:06 UTC (rev 637)
@@ -54,7 +54,7 @@
log.info("show first launch ui "+firstModel.getIdentity());
return;
}
- if (uiDef == VCSUIFactory.CONFIG_UI) {
+ if (uiDef == VCSUIFactory.CONNEXION_CONFIG_UI) {
log.info("show config ui");
return;
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:39:32 UTC (rev 636)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:40:06 UTC (rev 637)
@@ -59,13 +59,13 @@
public static final DialogUIDef<DiffUIModel, DiffUI, DiffUIHandler> DIFF_UI;
public static final DialogUIDef<ChangelogUIModel, ChangelogUI, ChangelogUIHandler> CHANGELOG_UI;
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
- public static final DialogUIDef<ConnexionConfigUIModel, ConnexionConfigUI, ConnexionConfigUIHandler> CONFIG_UI;
+ public static final DialogUIDef<ConnexionConfigUIModel, ConnexionConfigUI, ConnexionConfigUIHandler> CONNEXION_CONFIG_UI;
public static final DialogUIDef<GenerateSshKeyUIModel, GenerateSshKeyUI, GenerateSshKeyUIHandler> GENERATE_SHH_KEY_UI;
public static final DialogUIDef<IdentityUIModel, IdentityUI, IdentityUIHandler> IDENTITY_UI;
public static final DialogUIDef<TestUIModel, TestUI, TestUIHandler> TEST_UI;
public static DialogUIDef[] defs() {
- return new DialogUIDef[]{SYNCH_UI, DIFF_UI, CHANGELOG_UI, CONFIG_UI, CONFIRM_UI, GENERATE_SHH_KEY_UI, IDENTITY_UI,TEST_UI};
+ return new DialogUIDef[]{SYNCH_UI, DIFF_UI, CHANGELOG_UI, CONNEXION_CONFIG_UI, CONFIRM_UI, GENERATE_SHH_KEY_UI, IDENTITY_UI,TEST_UI};
}
protected static VCSUIFactory instance;
@@ -132,7 +132,7 @@
n_("lutinvcs.action.show.confirmui"),
n_("lutinvcs.action.show.confirmui.tip"),
n_("lutinvcs.confirmui.title"));
- CONFIG_UI = newDef(ConnexionConfigUIHandler.class, ConnexionConfigUI.class, ConnexionConfigUIModel.class,
+ CONNEXION_CONFIG_UI = newDef(ConnexionConfigUIHandler.class, ConnexionConfigUI.class, ConnexionConfigUIModel.class,
n_("lutinvcs.action.show.configui"),
n_("lutinvcs.action.show.configui.tip"),
n_("lutinvcs.configui.title"));
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:39:32 UTC (rev 636)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:40:06 UTC (rev 637)
@@ -29,7 +29,7 @@
private static final long serialVersionUID = 1L;
public ShowConfigAction(org.codelutin.ui.DialogUI ui, boolean showText) {
- super(ui, VCSUIFactory.CONFIG_UI, showText);
+ super(ui, VCSUIFactory.CONNEXION_CONFIG_UI, showText);
}
@Override
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java 2008-04-27 08:39:32 UTC (rev 636)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java 2008-04-27 08:40:06 UTC (rev 637)
@@ -37,7 +37,7 @@
super.init();
// push icon and text in actions
initAction(VCSUIFactory.IDENTITY_UI, getUi().getShowFirstLaunch());
- initAction(VCSUIFactory.CONFIG_UI, getUi().getShowConfig());
+ initAction(VCSUIFactory.CONNEXION_CONFIG_UI, getUi().getShowConfig());
initAction(VCSUIFactory.SYNCH_UI, getUi().getShowSynch());
}
@@ -58,7 +58,7 @@
UIActionHelper.showIdentityUI(getModel().getIdentity(), getUi(), "bottom-left");
return;
}
- if (uiDef == VCSUIFactory.CONFIG_UI) {
+ if (uiDef == VCSUIFactory.CONNEXION_CONFIG_UI) {
UIActionHelper.showConfigUI(getModel().getConnexion().getConfig(), getUi(), "bottom-left");
return;
}
1
0
r636 - trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:39:32 +0000 (Sun, 27 Apr 2008)
New Revision: 636
Added:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx
Removed:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx
Modified:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java
Log:
renommage ConfigUI en ConnexionConfigUI
Deleted: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx 2008-04-27 08:39:02 UTC (rev 635)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx 2008-04-27 08:39:32 UTC (rev 636)
@@ -1,133 +0,0 @@
-<ConfigUI modal='true' resizable='false'>
- <style source="config.css"/>
- <script>
- import static org.codelutin.vcs.type.VCSConnexionMode.*;
- import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
- import org.codelutin.vcs.ui.action.*;
- </script>
-
- <java.awt.CardLayout id='connexionPanelLayout'>
- <Table id='anonymousPanel' insets='2,2,2,2'>
- <row>
- <cell columns="3">
- <JLabel text="lutinvcs.no.config" enabled='false'/>
- </cell>
- </row>
- </Table>
- <Table id='passwordPanel' insets='2,2,2,2'>
- <row fill='horizontal'>
- <cell>
- <JLabel id='loginLabel'/>
- </cell>
- <cell>
- <JTextField id='login' onKeyReleased="doCheck(Element.login)"/>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell>
- <JLabel id='passwordLabel' labelFor='{password}'/>
- </cell>
- <cell>
- <JPasswordField id='password' onKeyReleased="doCheck(Element.password)"/>
- </cell>
- </row>
- </Table>
- <Table id='sshPanel' opaque="false" insets='2,2,2,2'>
- <row fill='horizontal'>
- <cell>
- <JLabel id='sshLoginLabel'/>
- </cell>
- <cell>
- <JTextField id='sshLogin' onKeyReleased="doCheck(Element.sshLogin)"/>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell>
- <JLabel id='passphraseLabel'/>
- </cell>
- <cell>
- <JToolBar opaque='false' borderPainted='false' height="24">
- <JCheckBox id='noPassPhrase' onKeyReleased="doCheck(Element.nopassphrase)"/>
- <JPasswordField id='passphrase' onKeyReleased="doCheck(Element.passphrase)"
- enabled='{!noPassPhrase.isSelected()}'/>
- </JToolBar>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell>
- <JLabel id='privateKeyFileLabel'/>
- </cell>
- <cell>
- <JToolBar opaque='false' borderPainted='false' height="24">
- <JTextField id='privateKeyFile' onKeyReleased="doCheck(Element.privateKeyFile)"/>
- <JButton id='changePrivateKeyFile' icon='{createActionIcon("filechooser")}'
- onActionPerformed="changePrivateKeyFile()"/>
- </JToolBar>
- </cell>
- </row>
- </Table>
- </java.awt.CardLayout>
-
- <JToolBar id='top' height='26'>
- <JLabel text='lutinvcs.config.message'/>
- <Table fill='both' insets='0,0,0,0'>
- <row>
- <cell fill='both'/>
- </row>
- </Table>
- <JButton id='reset' onActionPerformed="reset()" icon='{createActionIcon("revert")}' borderPainted='false'/>
- <JButton id='testConnection' action='{newAction(TestConnexionAction.class)}' borderPainted='false'/>
- <JButton id='help' action='{newAction(HelpAction.class)}' borderPainted='false'/>
- </JToolBar>
-
- <JToolBar id='connexionHead' opaque='false' height='26'>
- <JLabel id='connexionModeLabel'/>
- <JRadioButton id='connexionModeAnonymous' onActionPerformed="changeAutheticationMode(ANONYMOUS)"/>
- <JRadioButton id='connexionModePassword' onActionPerformed="changeAutheticationMode(PASSWORD)"/>
- <JRadioButton id='connexionModeSsh' onActionPerformed="changeAutheticationMode(SSH)"/>
- <Table fill='both' insets='0,0,0,0'>
- <row>
- <cell fill='both'/>
- </row>
- </Table>
- <JButton id='generateKey' icon='{createActionIcon("generatekey")}' onActionPerformed="generateKey()"
- borderPainted='false'/>
- </JToolBar>
-
- <Table fill='both' insets="1,1,1,1">
- <row fill='horizontal'>
- <cell columns='2'>
- <JScrollPane columnHeaderView='{top}'>
- <JEditorPane id="doc"/>
- </JScrollPane>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell columns="2" fill='both'>
- <JToolBar id='rootHead' opaque='false' height='26'>
- <JComboBox id='rootsList' />
- <JButton id='editRoot' icon='{createActionIcon("editroot")}' borderPainted='false' onActionPerformed="editRoot()"/>
- <JButton id='addRoot' icon='{createActionIcon("addroot")}' borderPainted='false' onActionPerformed="addRoot()"/>
- <JButton id='deleteRoot' icon='{createActionIcon("deleteroot")}' borderPainted='false' onActionPerformed="deleteRoot()"/>
- <!--JSeparator orientation="vertical"/-->
- </JToolBar>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell columns="2" fill='both'>
- <JScrollPane columnHeaderView='{connexionHead}' styleClass='connexionScroll'>
- <JPanel id='connexionPanel' layout='{connexionPanelLayout}'/>
- </JScrollPane>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell weightx='1'>
- <JButton id='ok' onActionPerformed="save()"/>
- </cell>
- <cell weightx='1'>
- <JButton id='cancel' onActionPerformed="dispose()"/>
- </cell>
- </row>
- </Table>
-
-</ConfigUI>
Copied: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx (from rev 630, trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx)
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx (rev 0)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-04-27 08:39:32 UTC (rev 636)
@@ -0,0 +1,133 @@
+<ConfigUI modal='true' resizable='false'>
+ <style source="config.css"/>
+ <script>
+ import static org.codelutin.vcs.type.VCSConnexionMode.*;
+ import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
+ import org.codelutin.vcs.ui.action.*;
+ </script>
+
+ <java.awt.CardLayout id='connexionPanelLayout'>
+ <Table id='anonymousPanel' insets='2,2,2,2'>
+ <row>
+ <cell columns="3">
+ <JLabel text="lutinvcs.no.config" enabled='false'/>
+ </cell>
+ </row>
+ </Table>
+ <Table id='passwordPanel' insets='2,2,2,2'>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='loginLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='login' onKeyReleased="doCheck(Element.login)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='passwordLabel' labelFor='{password}'/>
+ </cell>
+ <cell>
+ <JPasswordField id='password' onKeyReleased="doCheck(Element.password)"/>
+ </cell>
+ </row>
+ </Table>
+ <Table id='sshPanel' opaque="false" insets='2,2,2,2'>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='sshLoginLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='sshLogin' onKeyReleased="doCheck(Element.sshLogin)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='passphraseLabel'/>
+ </cell>
+ <cell>
+ <JToolBar opaque='false' borderPainted='false' height="24">
+ <JCheckBox id='noPassPhrase' onKeyReleased="doCheck(Element.nopassphrase)"/>
+ <JPasswordField id='passphrase' onKeyReleased="doCheck(Element.passphrase)"
+ enabled='{!noPassPhrase.isSelected()}'/>
+ </JToolBar>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='privateKeyFileLabel'/>
+ </cell>
+ <cell>
+ <JToolBar opaque='false' borderPainted='false' height="24">
+ <JTextField id='privateKeyFile' onKeyReleased="doCheck(Element.privateKeyFile)"/>
+ <JButton id='changePrivateKeyFile' icon='{createActionIcon("filechooser")}'
+ onActionPerformed="changePrivateKeyFile()"/>
+ </JToolBar>
+ </cell>
+ </row>
+ </Table>
+ </java.awt.CardLayout>
+
+ <JToolBar id='top' height='26'>
+ <JLabel text='lutinvcs.config.message'/>
+ <Table fill='both' insets='0,0,0,0'>
+ <row>
+ <cell fill='both'/>
+ </row>
+ </Table>
+ <JButton id='reset' onActionPerformed="reset()" icon='{createActionIcon("revert")}' borderPainted='false'/>
+ <JButton id='testConnection' action='{newAction(TestConnexionAction.class)}' borderPainted='false'/>
+ <JButton id='help' action='{newAction(HelpAction.class)}' borderPainted='false'/>
+ </JToolBar>
+
+ <JToolBar id='connexionHead' opaque='false' height='26'>
+ <JLabel id='connexionModeLabel'/>
+ <JRadioButton id='connexionModeAnonymous' onActionPerformed="changeAutheticationMode(ANONYMOUS)"/>
+ <JRadioButton id='connexionModePassword' onActionPerformed="changeAutheticationMode(PASSWORD)"/>
+ <JRadioButton id='connexionModeSsh' onActionPerformed="changeAutheticationMode(SSH)"/>
+ <Table fill='both' insets='0,0,0,0'>
+ <row>
+ <cell fill='both'/>
+ </row>
+ </Table>
+ <JButton id='generateKey' icon='{createActionIcon("generatekey")}' onActionPerformed="generateKey()"
+ borderPainted='false'/>
+ </JToolBar>
+
+ <Table fill='both' insets="1,1,1,1">
+ <row fill='horizontal'>
+ <cell columns='2'>
+ <JScrollPane columnHeaderView='{top}'>
+ <JEditorPane id="doc"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell columns="2" fill='both'>
+ <JToolBar id='rootHead' opaque='false' height='26'>
+ <JComboBox id='rootsList' />
+ <JButton id='editRoot' icon='{createActionIcon("editroot")}' borderPainted='false' onActionPerformed="editRoot()"/>
+ <JButton id='addRoot' icon='{createActionIcon("addroot")}' borderPainted='false' onActionPerformed="addRoot()"/>
+ <JButton id='deleteRoot' icon='{createActionIcon("deleteroot")}' borderPainted='false' onActionPerformed="deleteRoot()"/>
+ <!--JSeparator orientation="vertical"/-->
+ </JToolBar>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell columns="2" fill='both'>
+ <JScrollPane columnHeaderView='{connexionHead}' styleClass='connexionScroll'>
+ <JPanel id='connexionPanel' layout='{connexionPanelLayout}'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell weightx='1'>
+ <JButton id='ok' onActionPerformed="save()"/>
+ </cell>
+ <cell weightx='1'>
+ <JButton id='cancel' onActionPerformed="dispose()"/>
+ </cell>
+ </row>
+ </Table>
+
+</ConfigUI>
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java 2008-04-27 08:39:02 UTC (rev 635)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java 2008-04-27 08:39:32 UTC (rev 636)
@@ -23,7 +23,7 @@
JaxxDiffUI.class,
JaxxChangelogUI.class,
JaxxConfirmUI.class,
- JaxxConfigUI.class,
+ JaxxConnexionConfigUI.class,
JaxxGenerateSshKeyUI.class,
JaxxIdentityUI.class,
JaxxTestUI.class);
1
0
r635 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . action handler
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:39:02 +0000 (Sun, 27 Apr 2008)
New Revision: 635
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java
Log:
renommage ConfigUI en ConnexionConfigUI
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-04-27 08:38:39 UTC (rev 634)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-04-27 08:39:02 UTC (rev 635)
@@ -18,7 +18,7 @@
import org.codelutin.ui.FormElement;
import org.codelutin.util.FileUtil;
import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.handler.ConnexionConfigUIHandler;
import org.codelutin.vcs.ui.util.ui.AbstractUI;
import javax.swing.AbstractButton;
@@ -34,7 +34,7 @@
import java.util.Arrays;
/** @author chemit */
-public abstract class ConnexionConfigUI extends AbstractUI<ConfigUIHandler> {
+public abstract class ConnexionConfigUI extends AbstractUI<ConnexionConfigUIHandler> {
public enum Element implements FormElement<ConnexionConfigUI> {
connexion,
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:38:39 UTC (rev 634)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:39:02 UTC (rev 635)
@@ -26,7 +26,7 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.ui.handler.ChangelogUIHandler;
-import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.handler.ConnexionConfigUIHandler;
import org.codelutin.vcs.ui.handler.ConfirmUIHandler;
import org.codelutin.vcs.ui.handler.DiffUIHandler;
import org.codelutin.vcs.ui.handler.IdentityUIHandler;
@@ -59,7 +59,7 @@
public static final DialogUIDef<DiffUIModel, DiffUI, DiffUIHandler> DIFF_UI;
public static final DialogUIDef<ChangelogUIModel, ChangelogUI, ChangelogUIHandler> CHANGELOG_UI;
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
- public static final DialogUIDef<ConnexionConfigUIModel, ConnexionConfigUI, ConfigUIHandler> CONFIG_UI;
+ public static final DialogUIDef<ConnexionConfigUIModel, ConnexionConfigUI, ConnexionConfigUIHandler> CONFIG_UI;
public static final DialogUIDef<GenerateSshKeyUIModel, GenerateSshKeyUI, GenerateSshKeyUIHandler> GENERATE_SHH_KEY_UI;
public static final DialogUIDef<IdentityUIModel, IdentityUI, IdentityUIHandler> IDENTITY_UI;
public static final DialogUIDef<TestUIModel, TestUI, TestUIHandler> TEST_UI;
@@ -132,7 +132,7 @@
n_("lutinvcs.action.show.confirmui"),
n_("lutinvcs.action.show.confirmui.tip"),
n_("lutinvcs.confirmui.title"));
- CONFIG_UI = newDef(ConfigUIHandler.class, ConnexionConfigUI.class, ConnexionConfigUIModel.class,
+ CONFIG_UI = newDef(ConnexionConfigUIHandler.class, ConnexionConfigUI.class, ConnexionConfigUIModel.class,
n_("lutinvcs.action.show.configui"),
n_("lutinvcs.action.show.configui.tip"),
n_("lutinvcs.configui.title"));
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:38:39 UTC (rev 634)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:39:02 UTC (rev 635)
@@ -17,14 +17,14 @@
import org.codelutin.ui.DialogUIHandler;
import org.codelutin.vcs.ui.ConnexionConfigUI;
import org.codelutin.vcs.ui.VCSUIFactory;
-import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.handler.ConnexionConfigUIHandler;
import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowConfigAction extends AbstractVCSShowUIAction<ConnexionConfigUIModel, ConnexionConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
+public class ShowConfigAction extends AbstractVCSShowUIAction<ConnexionConfigUIModel, ConnexionConfigUI, ConnexionConfigUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:38:39 UTC (rev 634)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:39:02 UTC (rev 635)
@@ -20,14 +20,14 @@
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.ui.ConnexionConfigUI;
-import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.handler.ConnexionConfigUIHandler;
import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.ERROR_MESSAGE;
import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
/** @author chemit */
-public class TestConnexionAction extends org.codelutin.ui.AbstractUIAction<org.codelutin.vcs.ui.handler.ConfigUIHandler> {
+public class TestConnexionAction extends org.codelutin.ui.AbstractUIAction<ConnexionConfigUIHandler> {
private static final long serialVersionUID = 1L;
@@ -41,7 +41,7 @@
public void actionPerformed(java.awt.event.ActionEvent e) {
checkInit();
- ConfigUIHandler uiHandler = getHandler();
+ ConnexionConfigUIHandler uiHandler = getHandler();
VCSConnexionConfig config = uiHandler.getConfig();
VCSConnexion connexion = VCSFactory.newConnexion(config);
ConnexionConfigUI ui = uiHandler.getUi();
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:38:39 UTC (rev 634)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:39:02 UTC (rev 635)
@@ -1,288 +0,0 @@
-/**
- * ##% Copyright (C) 2008 Code Lutin, Tony Chemit
- * 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.
- * ##%
- */
-package org.codelutin.vcs.ui.handler;
-
-import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.ConnexionConfigUI;
-import org.codelutin.vcs.ui.ConnexionConfigUI.Element;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.login;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.nopassphrase;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.passphrase;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.password;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.values;
-import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
-import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
-
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import javax.swing.text.JTextComponent;
-import java.awt.Color;
-import java.beans.PropertyChangeEvent;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/** @author chemit */
-public class ConfigUIHandler extends AbstractUIHandler<ConnexionConfigUIModel, ConnexionConfigUI> {
-
- protected List<Element> errors;
-
-
- public ConfigUIHandler(ConnexionConfigUI ui, VCSConnexionConfig config) {
- super(ui, new ConnexionConfigUIModel(), config);
- ui.setHandler(this);
- errors = new ArrayList<Element>();
- }
-
- public void init() {
- super.init();
- ConnexionConfigUI ui = getUi();
- JPanel connexionPanel = ui.getConnexionPanel();
- connexionPanel.add(ui.getAnonymousPanel(), VCSConnexionMode.ANONYMOUS.name());
- connexionPanel.add(ui.getPasswordPanel(), VCSConnexionMode.PASSWORD.name());
- connexionPanel.add(ui.getSshPanel(), VCSConnexionMode.SSH.name());
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
-
- if (ConnexionConfigUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
- // update ui with model values,
- populateUI((ConnexionConfigUIModel) evt.getNewValue());
- doCheck(null);
- return;
- }
- if (ConnexionConfigUIModel.MODE_PROPERTY_CHANGED.equals(action)) {
- updateUI((VCSConnexionMode) evt.getNewValue());
- doCheck(null);
- return;
- }
-
- if (ConnexionConfigUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
- Boolean newValue = (Boolean) evt.getNewValue();
- boolean modified = newValue != null && newValue;
- getUi().getReset().setEnabled(modified);
- getUi().getTestConnection().setEnabled(modified && isConfigValid());
- return;
- }
-
- if (ConnexionConfigUIModel.CONNEXION_STATE_PROPERTY_CHANGED.equals(action)) {
- Boolean newValue = (Boolean) evt.getNewValue();
- boolean validConnexion = newValue != null && newValue;
- getUi().getOk().setEnabled(validConnexion);
- getUi().getTestConnection().setEnabled(!validConnexion);
- return;
- }
- throw new IllegalStateException("unimplemented property changed : " + evt + " for " + this);
- }
-
- public synchronized List<Element> validateModel(Element element) {
- errors.clear();
- ConnexionConfigUI ui = getUi();
- if (element != null) {
- // compute modifed
- setModified(element, ui);
- }
- switch (getModel().getMode()) {
- case ANONYMOUS:
- // nothing to validate
- break;
- case PASSWORD:
- // login + password not empty
- checkData(ui.getLogin(), login);
- checkData(ui.getPassword().getPassword().length == 0, password);
- break;
- case SSH:
- // login + private key exists
- checkData(ui.getSshLogin(), sshLogin);
- String s = ui.getPrivateKeyFile().getText();
- File file = new File(s);
- checkData(s.isEmpty() || !file.exists(), privateKeyFile);
- if (ui.getElementValue(nopassphrase).equals("false")) {
- // check it there is a pass-phrase
- checkData(ui.getPassphrase().getPassword().length == 0, passphrase);
- } else {
- errors.remove(passphrase);
- }
- break;
- }
- return errors;
- }
-
- public void setModified(Element element, ConnexionConfigUI ui) {
- boolean modify = false;
- ConnexionConfigUIModel model = getModel();
-
- String value = ui.getElementValue(element);
-
- switch (element) {
- case connexion:
- modify = model.getMode() != model.getConfig().getMode();
- break;
- case login:
- modify = !model.getConfig().getUserName().equals(value);
- break;
- case sshLogin:
- modify = !model.getConfig().getUserName().equals(value);
- break;
- case nopassphrase:
- boolean b = ui.getNoPassPhrase().isSelected();
- modify = (model.getConfig().getPassphrase() != null && !model.getConfig().getPassphrase().isEmpty()) == b;
- if (!b) {
- model.removeModified(passphrase);
- } else {
- char[] password = ui.getPassphrase().getPassword();
- boolean modify2;
- if (model.getConfig().getPassphrase() == null || model.getConfig().getPassphrase().isEmpty()) {
- modify2 = password.length == 0;
- } else {
- modify2 = model.getConfig().getPassphrase().equals(Arrays.toString(password));
- }
- if (modify2) {
- model.addModified(passphrase);
- }
- }
- break;
- case password:
- modify = !model.getConfig().getPassphrase().equals(Arrays.toString(ui.getPassword().getPassword()));
- break;
- case privateKeyFile:
- modify = !model.getConfig().getKeyFile().getAbsolutePath().equals(value);
- break;
- case passphrase:
- modify = !model.getConfig().getPassphrase().equals(value);
- break;
- }
- if (modify) {
- model.addModified(element);
- // reset connexion state
- model.setConnexionState(null);
- } else if (model.getModifieds().contains(element)) {
- model.removeModified(element);
- // reset connexion state
- model.setConnexionState(null);
- }
- }
-
- public void doCheck(Element element) {
- List<Element> errors = validateModel(element);
- updateUI(errors);
- }
-
- public boolean isConfigValid() {
- return errors.isEmpty() && getModel().isConnexionState();
- }
-
- public void reset() {
- getModel().reset();
- }
-
- protected void populateUI(ConnexionConfigUIModel model) {
- ConnexionConfigUI ui = getUi();
- VCSConnexionConfig config = model.getConfig();
- switch (config.getMode()) {
- case ANONYMOUS:
- break;
- case PASSWORD:
- ui.getLogin().setText(config.getUserName());
- ui.getPassword().setText(config.getPassphrase() == null ? "" : config.getPassphrase());
- break;
- case SSH:
- ui.getSshLogin().setText(config.getUserName());
- ui.getNoPassPhrase().setSelected(config.isNoPassPhrase());
- ui.getPrivateKeyFile().setText(config.getKeyFile() == null ? "" : config.getKeyFile().getAbsolutePath());
- ui.getPassphrase().setText(config.getPassphrase() == null ? "" : config.getPassphrase());
- break;
- }
- ui.getTestConnection().setEnabled(true);
- }
-
- protected void updateUI(final VCSConnexionMode mode) {
- ConnexionConfigUI ui = getUi();
- //getModel().removeModified(sshLogin, nopassphrase, passphrase, privateKeyFile, login, password);
- switch (mode) {
- case ANONYMOUS:
- ui.getConnexionModeAnonymous().setSelected(true);
- break;
- case PASSWORD:
- ui.getConnexionModePassword().setSelected(true);
- setModified(login, ui);
- setModified(password, ui);
- break;
- case SSH:
- setModified(sshLogin, ui);
- setModified(nopassphrase, ui);
- setModified(passphrase, ui);
- setModified(privateKeyFile, ui);
- ui.getConnexionModeSsh().setSelected(true);
- break;
- }
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- getUi().getConnexionPanelLayout().show(getUi().getConnexionPanel(), mode.name());
- getUi().pack();
- }
- });
- }
-
- protected void updateUI(List<Element> errors) {
- ConnexionConfigUI ui = getUi();
- boolean valid = isConfigValid();
- ui.getOk().setEnabled(valid && getModel().isModified());
- //ui.getTestConnection().setEnabled(valid);
- ui.getGenerateKey().setEnabled(getModel().getMode() == VCSConnexionMode.SSH && !errors.contains(sshLogin) && !errors.contains(passphrase));
- for (Element element : values()) {
- setLabelColor(errors, element);
- }
- }
-
- protected void checkData(JTextComponent component, Element errorName) {
- if (component.getText().isEmpty()) {
- errors.add(errorName);
- }
- }
-
- protected void checkData(boolean notValid, Element errorName) {
- if (notValid) {
- errors.add(errorName);
- }
- }
-
- protected void setLabelColor(List<Element> errors, Element element) {
- JComponent component = getUi().getElementLabel(element);
- if (component != null && component.isVisible()) {
- component.setForeground(errors.contains(element) ? Color.red : Color.black);
- }
- }
-
- public void save() {
- if (!getModel().isModified()) {
- log.warn("nothing to save");
- }
- for (Element element : getModel().getModifieds()) {
- String value = getUi().getElementValue(element);
- getModel().save(element, value);
- log.info("save " + element);
- }
- }
-}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java (from rev 633, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-04-27 08:39:02 UTC (rev 635)
@@ -0,0 +1,288 @@
+/**
+ * ##% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * 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.
+ * ##%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.ui.ConnexionConfigUI;
+import org.codelutin.vcs.ui.ConnexionConfigUI.Element;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.login;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.nopassphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.passphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.password;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.values;
+import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
+
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.text.JTextComponent;
+import java.awt.Color;
+import java.beans.PropertyChangeEvent;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/** @author chemit */
+public class ConnexionConfigUIHandler extends AbstractUIHandler<ConnexionConfigUIModel, ConnexionConfigUI> {
+
+ protected List<Element> errors;
+
+
+ public ConnexionConfigUIHandler(ConnexionConfigUI ui, VCSConnexionConfig config) {
+ super(ui, new ConnexionConfigUIModel(), config);
+ ui.setHandler(this);
+ errors = new ArrayList<Element>();
+ }
+
+ public void init() {
+ super.init();
+ ConnexionConfigUI ui = getUi();
+ JPanel connexionPanel = ui.getConnexionPanel();
+ connexionPanel.add(ui.getAnonymousPanel(), VCSConnexionMode.ANONYMOUS.name());
+ connexionPanel.add(ui.getPasswordPanel(), VCSConnexionMode.PASSWORD.name());
+ connexionPanel.add(ui.getSshPanel(), VCSConnexionMode.SSH.name());
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (ConnexionConfigUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
+ // update ui with model values,
+ populateUI((ConnexionConfigUIModel) evt.getNewValue());
+ doCheck(null);
+ return;
+ }
+ if (ConnexionConfigUIModel.MODE_PROPERTY_CHANGED.equals(action)) {
+ updateUI((VCSConnexionMode) evt.getNewValue());
+ doCheck(null);
+ return;
+ }
+
+ if (ConnexionConfigUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
+ Boolean newValue = (Boolean) evt.getNewValue();
+ boolean modified = newValue != null && newValue;
+ getUi().getReset().setEnabled(modified);
+ getUi().getTestConnection().setEnabled(modified && isConfigValid());
+ return;
+ }
+
+ if (ConnexionConfigUIModel.CONNEXION_STATE_PROPERTY_CHANGED.equals(action)) {
+ Boolean newValue = (Boolean) evt.getNewValue();
+ boolean validConnexion = newValue != null && newValue;
+ getUi().getOk().setEnabled(validConnexion);
+ getUi().getTestConnection().setEnabled(!validConnexion);
+ return;
+ }
+ throw new IllegalStateException("unimplemented property changed : " + evt + " for " + this);
+ }
+
+ public synchronized List<Element> validateModel(Element element) {
+ errors.clear();
+ ConnexionConfigUI ui = getUi();
+ if (element != null) {
+ // compute modifed
+ setModified(element, ui);
+ }
+ switch (getModel().getMode()) {
+ case ANONYMOUS:
+ // nothing to validate
+ break;
+ case PASSWORD:
+ // login + password not empty
+ checkData(ui.getLogin(), login);
+ checkData(ui.getPassword().getPassword().length == 0, password);
+ break;
+ case SSH:
+ // login + private key exists
+ checkData(ui.getSshLogin(), sshLogin);
+ String s = ui.getPrivateKeyFile().getText();
+ File file = new File(s);
+ checkData(s.isEmpty() || !file.exists(), privateKeyFile);
+ if (ui.getElementValue(nopassphrase).equals("false")) {
+ // check it there is a pass-phrase
+ checkData(ui.getPassphrase().getPassword().length == 0, passphrase);
+ } else {
+ errors.remove(passphrase);
+ }
+ break;
+ }
+ return errors;
+ }
+
+ public void setModified(Element element, ConnexionConfigUI ui) {
+ boolean modify = false;
+ ConnexionConfigUIModel model = getModel();
+
+ String value = ui.getElementValue(element);
+
+ switch (element) {
+ case connexion:
+ modify = model.getMode() != model.getConfig().getMode();
+ break;
+ case login:
+ modify = !model.getConfig().getUserName().equals(value);
+ break;
+ case sshLogin:
+ modify = !model.getConfig().getUserName().equals(value);
+ break;
+ case nopassphrase:
+ boolean b = ui.getNoPassPhrase().isSelected();
+ modify = (model.getConfig().getPassphrase() != null && !model.getConfig().getPassphrase().isEmpty()) == b;
+ if (!b) {
+ model.removeModified(passphrase);
+ } else {
+ char[] password = ui.getPassphrase().getPassword();
+ boolean modify2;
+ if (model.getConfig().getPassphrase() == null || model.getConfig().getPassphrase().isEmpty()) {
+ modify2 = password.length == 0;
+ } else {
+ modify2 = model.getConfig().getPassphrase().equals(Arrays.toString(password));
+ }
+ if (modify2) {
+ model.addModified(passphrase);
+ }
+ }
+ break;
+ case password:
+ modify = !model.getConfig().getPassphrase().equals(Arrays.toString(ui.getPassword().getPassword()));
+ break;
+ case privateKeyFile:
+ modify = !model.getConfig().getKeyFile().getAbsolutePath().equals(value);
+ break;
+ case passphrase:
+ modify = !model.getConfig().getPassphrase().equals(value);
+ break;
+ }
+ if (modify) {
+ model.addModified(element);
+ // reset connexion state
+ model.setConnexionState(null);
+ } else if (model.getModifieds().contains(element)) {
+ model.removeModified(element);
+ // reset connexion state
+ model.setConnexionState(null);
+ }
+ }
+
+ public void doCheck(Element element) {
+ List<Element> errors = validateModel(element);
+ updateUI(errors);
+ }
+
+ public boolean isConfigValid() {
+ return errors.isEmpty() && getModel().isConnexionState();
+ }
+
+ public void reset() {
+ getModel().reset();
+ }
+
+ protected void populateUI(ConnexionConfigUIModel model) {
+ ConnexionConfigUI ui = getUi();
+ VCSConnexionConfig config = model.getConfig();
+ switch (config.getMode()) {
+ case ANONYMOUS:
+ break;
+ case PASSWORD:
+ ui.getLogin().setText(config.getUserName());
+ ui.getPassword().setText(config.getPassphrase() == null ? "" : config.getPassphrase());
+ break;
+ case SSH:
+ ui.getSshLogin().setText(config.getUserName());
+ ui.getNoPassPhrase().setSelected(config.isNoPassPhrase());
+ ui.getPrivateKeyFile().setText(config.getKeyFile() == null ? "" : config.getKeyFile().getAbsolutePath());
+ ui.getPassphrase().setText(config.getPassphrase() == null ? "" : config.getPassphrase());
+ break;
+ }
+ ui.getTestConnection().setEnabled(true);
+ }
+
+ protected void updateUI(final VCSConnexionMode mode) {
+ ConnexionConfigUI ui = getUi();
+ //getModel().removeModified(sshLogin, nopassphrase, passphrase, privateKeyFile, login, password);
+ switch (mode) {
+ case ANONYMOUS:
+ ui.getConnexionModeAnonymous().setSelected(true);
+ break;
+ case PASSWORD:
+ ui.getConnexionModePassword().setSelected(true);
+ setModified(login, ui);
+ setModified(password, ui);
+ break;
+ case SSH:
+ setModified(sshLogin, ui);
+ setModified(nopassphrase, ui);
+ setModified(passphrase, ui);
+ setModified(privateKeyFile, ui);
+ ui.getConnexionModeSsh().setSelected(true);
+ break;
+ }
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ getUi().getConnexionPanelLayout().show(getUi().getConnexionPanel(), mode.name());
+ getUi().pack();
+ }
+ });
+ }
+
+ protected void updateUI(List<Element> errors) {
+ ConnexionConfigUI ui = getUi();
+ boolean valid = isConfigValid();
+ ui.getOk().setEnabled(valid && getModel().isModified());
+ //ui.getTestConnection().setEnabled(valid);
+ ui.getGenerateKey().setEnabled(getModel().getMode() == VCSConnexionMode.SSH && !errors.contains(sshLogin) && !errors.contains(passphrase));
+ for (Element element : values()) {
+ setLabelColor(errors, element);
+ }
+ }
+
+ protected void checkData(JTextComponent component, Element errorName) {
+ if (component.getText().isEmpty()) {
+ errors.add(errorName);
+ }
+ }
+
+ protected void checkData(boolean notValid, Element errorName) {
+ if (notValid) {
+ errors.add(errorName);
+ }
+ }
+
+ protected void setLabelColor(List<Element> errors, Element element) {
+ JComponent component = getUi().getElementLabel(element);
+ if (component != null && component.isVisible()) {
+ component.setForeground(errors.contains(element) ? Color.red : Color.black);
+ }
+ }
+
+ public void save() {
+ if (!getModel().isModified()) {
+ log.warn("nothing to save");
+ }
+ for (Element element : getModel().getModifieds()) {
+ String value = getUi().getElementValue(element);
+ getModel().save(element, value);
+ log.info("save " + element);
+ }
+ }
+}
\ No newline at end of file
1
0
r634 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: action handler
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:38:39 +0000 (Sun, 27 Apr 2008)
New Revision: 634
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/GenerateSshKeyUIHandler.java
Log:
renommage ConfigUI en ConnexionConfigUI
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:38:28 UTC (rev 633)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:38:39 UTC (rev 634)
@@ -18,13 +18,13 @@
import org.codelutin.vcs.ui.ConnexionConfigUI;
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.ConfigUIHandler;
-import org.codelutin.vcs.ui.model.ConfigUIModel;
+import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowConfigAction extends AbstractVCSShowUIAction<ConfigUIModel, ConnexionConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
+public class ShowConfigAction extends AbstractVCSShowUIAction<ConnexionConfigUIModel, ConnexionConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/GenerateSshKeyUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/GenerateSshKeyUIHandler.java 2008-04-27 08:38:28 UTC (rev 633)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/GenerateSshKeyUIHandler.java 2008-04-27 08:38:39 UTC (rev 634)
@@ -23,7 +23,7 @@
import static org.codelutin.vcs.ui.GenerateSshKeyUI.Element.nopassphrase;
import static org.codelutin.vcs.ui.GenerateSshKeyUI.Element.passphrase;
import static org.codelutin.vcs.ui.GenerateSshKeyUI.Element.values;
-import org.codelutin.vcs.ui.model.ConfigUIModel;
+import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
import org.codelutin.vcs.ui.model.GenerateSshKeyUIModel;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
@@ -59,14 +59,14 @@
}
String action = evt.getPropertyName();
- if (ConfigUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
+ if (ConnexionConfigUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
// update ui with model values,
populateUI((GenerateSshKeyUIModel) evt.getNewValue());
doCheck(null);
return;
}
- if (ConfigUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
+ if (ConnexionConfigUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
Boolean newValue = (Boolean) evt.getNewValue();
getUi().getReset().setEnabled(newValue != null && newValue);
getUi().getGenerate().setEnabled(isConfigValid());
1
0
r633 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . handler model
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:38:28 +0000 (Sun, 27 Apr 2008)
New Revision: 633
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
Log:
renommage ConfigUI en ConnexionConfigUI
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:38:00 UTC (rev 632)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:38:28 UTC (rev 633)
@@ -34,7 +34,7 @@
import org.codelutin.vcs.ui.handler.SynchUIHandler;
import org.codelutin.vcs.ui.handler.TestUIHandler;
import org.codelutin.vcs.ui.model.ChangelogUIModel;
-import org.codelutin.vcs.ui.model.ConfigUIModel;
+import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
import org.codelutin.vcs.ui.model.IdentityUIModel;
@@ -59,7 +59,7 @@
public static final DialogUIDef<DiffUIModel, DiffUI, DiffUIHandler> DIFF_UI;
public static final DialogUIDef<ChangelogUIModel, ChangelogUI, ChangelogUIHandler> CHANGELOG_UI;
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
- public static final DialogUIDef<ConfigUIModel, ConnexionConfigUI, ConfigUIHandler> CONFIG_UI;
+ public static final DialogUIDef<ConnexionConfigUIModel, ConnexionConfigUI, ConfigUIHandler> CONFIG_UI;
public static final DialogUIDef<GenerateSshKeyUIModel, GenerateSshKeyUI, GenerateSshKeyUIHandler> GENERATE_SHH_KEY_UI;
public static final DialogUIDef<IdentityUIModel, IdentityUI, IdentityUIHandler> IDENTITY_UI;
public static final DialogUIDef<TestUIModel, TestUI, TestUIHandler> TEST_UI;
@@ -132,7 +132,7 @@
n_("lutinvcs.action.show.confirmui"),
n_("lutinvcs.action.show.confirmui.tip"),
n_("lutinvcs.confirmui.title"));
- CONFIG_UI = newDef(ConfigUIHandler.class, ConnexionConfigUI.class, ConfigUIModel.class,
+ CONFIG_UI = newDef(ConfigUIHandler.class, ConnexionConfigUI.class, ConnexionConfigUIModel.class,
n_("lutinvcs.action.show.configui"),
n_("lutinvcs.action.show.configui.tip"),
n_("lutinvcs.configui.title"));
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:38:00 UTC (rev 632)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:38:28 UTC (rev 633)
@@ -25,7 +25,7 @@
import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.values;
-import org.codelutin.vcs.ui.model.ConfigUIModel;
+import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import javax.swing.JComponent;
@@ -40,13 +40,13 @@
import java.util.List;
/** @author chemit */
-public class ConfigUIHandler extends AbstractUIHandler<ConfigUIModel, ConnexionConfigUI> {
+public class ConfigUIHandler extends AbstractUIHandler<ConnexionConfigUIModel, ConnexionConfigUI> {
protected List<Element> errors;
public ConfigUIHandler(ConnexionConfigUI ui, VCSConnexionConfig config) {
- super(ui, new ConfigUIModel(), config);
+ super(ui, new ConnexionConfigUIModel(), config);
ui.setHandler(this);
errors = new ArrayList<Element>();
}
@@ -66,19 +66,19 @@
}
String action = evt.getPropertyName();
- if (ConfigUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
+ if (ConnexionConfigUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
// update ui with model values,
- populateUI((ConfigUIModel) evt.getNewValue());
+ populateUI((ConnexionConfigUIModel) evt.getNewValue());
doCheck(null);
return;
}
- if (ConfigUIModel.MODE_PROPERTY_CHANGED.equals(action)) {
+ if (ConnexionConfigUIModel.MODE_PROPERTY_CHANGED.equals(action)) {
updateUI((VCSConnexionMode) evt.getNewValue());
doCheck(null);
return;
}
- if (ConfigUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
+ if (ConnexionConfigUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
Boolean newValue = (Boolean) evt.getNewValue();
boolean modified = newValue != null && newValue;
getUi().getReset().setEnabled(modified);
@@ -86,7 +86,7 @@
return;
}
- if (ConfigUIModel.CONNEXION_STATE_PROPERTY_CHANGED.equals(action)) {
+ if (ConnexionConfigUIModel.CONNEXION_STATE_PROPERTY_CHANGED.equals(action)) {
Boolean newValue = (Boolean) evt.getNewValue();
boolean validConnexion = newValue != null && newValue;
getUi().getOk().setEnabled(validConnexion);
@@ -131,7 +131,7 @@
public void setModified(Element element, ConnexionConfigUI ui) {
boolean modify = false;
- ConfigUIModel model = getModel();
+ ConnexionConfigUIModel model = getModel();
String value = ui.getElementValue(element);
@@ -197,7 +197,7 @@
getModel().reset();
}
- protected void populateUI(ConfigUIModel model) {
+ protected void populateUI(ConnexionConfigUIModel model) {
ConnexionConfigUI ui = getUi();
VCSConnexionConfig config = model.getConfig();
switch (config.getMode()) {
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:38:00 UTC (rev 632)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:38:28 UTC (rev 633)
@@ -1,182 +0,0 @@
-/**
- * ##% Copyright (C) 2008 Code Lutin, Tony Chemit
- * 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.
- * ##%
- */
-package org.codelutin.vcs.ui.model;
-
-import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.ConnexionConfigUI.Element;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.connexion;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.login;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.nopassphrase;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.passphrase;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.password;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
-import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
-import org.codelutin.vcs.ui.util.model.AbstractUIModel;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Model of a a confirmation of action on entries (single type of action possible)
- *
- * @author chemit
- */
-public class ConfigUIModel extends AbstractUIModel {
-
- public static final String CONFIG_PROPERTY_CHANGED = "config";
- public static final String CONNEXION_STATE_PROPERTY_CHANGED = "connexionState";
- public static final String MODE_PROPERTY_CHANGED = "mode";
- public static final String MODIFIED_PROPERTY_CHANGED = "modify";
-
- protected VCSConnexionMode mode;
- protected List<Element> modifieds;
- protected VCSConnexionConfig config;
- protected Boolean connexionState;
-
- public ConfigUIModel() {
- modifieds = new ArrayList<Element>();
- }
-
- public void populate(VCSConnexionConfig config) {
- this.config = config;
- setConnexionMode(config.getMode());
- setModified(false);
- firePropertyChange(CONFIG_PROPERTY_CHANGED, null, this);
- }
-
- public void reset() {
- checkConnexionInit();
- populate(config);
- }
-
- public void setConnexionMode(VCSConnexionMode mode) {
- VCSConnexionMode oldMode = this.mode;
- this.mode = mode;
- if (oldMode != null) {
- switch (oldMode) {
- case ANONYMOUS:
- // nothing to clean
- break;
- case PASSWORD:
- removeModified(login, password);
- break;
- case SSH:
- removeModified(sshLogin, passphrase, nopassphrase, privateKeyFile);
- break;
- }
- }
- if (mode == getConfig().getMode()) {
- removeModified(connexion);
- } else {
- addModified(connexion);
- }
- firePropertyChange(MODE_PROPERTY_CHANGED, oldMode, mode);
- setConnexionState(null);
- }
-
- public boolean isModified() {
- return !modifieds.isEmpty();
- }
-
- public List<Element> getModifieds() {
- return modifieds;
- }
-
- public Boolean isConnexionState() {
- return connexionState != null && connexionState;
- }
-
- public VCSConnexionConfig getConfig() throws IllegalStateException {
- checkConnexionInit();
- return config;
- }
-
- public VCSConnexionMode getMode() throws IllegalStateException {
- checkConnexionInit();
- return mode;
- }
-
- public void addModified(Element elementname) {
- if (!modifieds.contains(elementname)) {
- modifieds.add(elementname);
- }
- setModified(!modifieds.isEmpty());
- }
-
- public void removeModified(Element... elementnames) {
- for (Element elementname : elementnames) {
- if (modifieds.contains(elementname)) {
- modifieds.remove(elementname);
- }
- setModified(!modifieds.isEmpty());
- }
-
- }
-
- public void setModified(boolean modified) {
- if (!modified) {
- modifieds.clear();
- }
- firePropertyChange(MODIFIED_PROPERTY_CHANGED, null, modified);
- }
-
- public void save(Element element, String value) {
- checkConnexionInit();
- switch (element) {
- case connexion:
- config.setConnexionMode(mode);
- break;
- case login:
- if (mode != VCSConnexionMode.ANONYMOUS) {
- config.setUserName(value);
- }
- break;
- case nopassphrase:
- if (mode == VCSConnexionMode.SSH) {
- config.setNoPassPhrase(Boolean.valueOf(value));
- }
- break;
- case password:
- if (mode == VCSConnexionMode.PASSWORD) {
- config.setPassPhrase(value);
- }
- case passphrase:
- if (mode == VCSConnexionMode.SSH) {
- config.setPassPhrase(value);
- }
- break;
- case privateKeyFile:
- if (mode == VCSConnexionMode.SSH) {
- config.setKeyFile(new File(value));
- }
- break;
- }
- }
-
-
- protected void checkConnexionInit() throws IllegalStateException {
- if (config == null) {
- throw new IllegalStateException("no config found in model " + this);
- }
- }
-
- public void setConnexionState(Boolean connexionState) {
- Boolean oldConnexionState = this.connexionState;
- this.connexionState = connexionState;
- firePropertyChange(CONNEXION_STATE_PROPERTY_CHANGED, oldConnexionState, connexionState);
- }
-}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java (from rev 632, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java 2008-04-27 08:38:28 UTC (rev 633)
@@ -0,0 +1,182 @@
+/**
+ * ##% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * 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.
+ * ##%
+ */
+package org.codelutin.vcs.ui.model;
+
+import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.ui.ConnexionConfigUI.Element;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.connexion;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.login;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.nopassphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.passphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.password;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
+import org.codelutin.vcs.ui.util.model.AbstractUIModel;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model of a a confirmation of action on entries (single type of action possible)
+ *
+ * @author chemit
+ */
+public class ConnexionConfigUIModel extends AbstractUIModel {
+
+ public static final String CONFIG_PROPERTY_CHANGED = "config";
+ public static final String CONNEXION_STATE_PROPERTY_CHANGED = "connexionState";
+ public static final String MODE_PROPERTY_CHANGED = "mode";
+ public static final String MODIFIED_PROPERTY_CHANGED = "modify";
+
+ protected VCSConnexionMode mode;
+ protected List<Element> modifieds;
+ protected VCSConnexionConfig config;
+ protected Boolean connexionState;
+
+ public ConnexionConfigUIModel() {
+ modifieds = new ArrayList<Element>();
+ }
+
+ public void populate(VCSConnexionConfig config) {
+ this.config = config;
+ setConnexionMode(config.getMode());
+ setModified(false);
+ firePropertyChange(CONFIG_PROPERTY_CHANGED, null, this);
+ }
+
+ public void reset() {
+ checkConnexionInit();
+ populate(config);
+ }
+
+ public void setConnexionMode(VCSConnexionMode mode) {
+ VCSConnexionMode oldMode = this.mode;
+ this.mode = mode;
+ if (oldMode != null) {
+ switch (oldMode) {
+ case ANONYMOUS:
+ // nothing to clean
+ break;
+ case PASSWORD:
+ removeModified(login, password);
+ break;
+ case SSH:
+ removeModified(sshLogin, passphrase, nopassphrase, privateKeyFile);
+ break;
+ }
+ }
+ if (mode == getConfig().getMode()) {
+ removeModified(connexion);
+ } else {
+ addModified(connexion);
+ }
+ firePropertyChange(MODE_PROPERTY_CHANGED, oldMode, mode);
+ setConnexionState(null);
+ }
+
+ public boolean isModified() {
+ return !modifieds.isEmpty();
+ }
+
+ public List<Element> getModifieds() {
+ return modifieds;
+ }
+
+ public Boolean isConnexionState() {
+ return connexionState != null && connexionState;
+ }
+
+ public VCSConnexionConfig getConfig() throws IllegalStateException {
+ checkConnexionInit();
+ return config;
+ }
+
+ public VCSConnexionMode getMode() throws IllegalStateException {
+ checkConnexionInit();
+ return mode;
+ }
+
+ public void addModified(Element elementname) {
+ if (!modifieds.contains(elementname)) {
+ modifieds.add(elementname);
+ }
+ setModified(!modifieds.isEmpty());
+ }
+
+ public void removeModified(Element... elementnames) {
+ for (Element elementname : elementnames) {
+ if (modifieds.contains(elementname)) {
+ modifieds.remove(elementname);
+ }
+ setModified(!modifieds.isEmpty());
+ }
+
+ }
+
+ public void setModified(boolean modified) {
+ if (!modified) {
+ modifieds.clear();
+ }
+ firePropertyChange(MODIFIED_PROPERTY_CHANGED, null, modified);
+ }
+
+ public void save(Element element, String value) {
+ checkConnexionInit();
+ switch (element) {
+ case connexion:
+ config.setConnexionMode(mode);
+ break;
+ case login:
+ if (mode != VCSConnexionMode.ANONYMOUS) {
+ config.setUserName(value);
+ }
+ break;
+ case nopassphrase:
+ if (mode == VCSConnexionMode.SSH) {
+ config.setNoPassPhrase(Boolean.valueOf(value));
+ }
+ break;
+ case password:
+ if (mode == VCSConnexionMode.PASSWORD) {
+ config.setPassPhrase(value);
+ }
+ case passphrase:
+ if (mode == VCSConnexionMode.SSH) {
+ config.setPassPhrase(value);
+ }
+ break;
+ case privateKeyFile:
+ if (mode == VCSConnexionMode.SSH) {
+ config.setKeyFile(new File(value));
+ }
+ break;
+ }
+ }
+
+
+ protected void checkConnexionInit() throws IllegalStateException {
+ if (config == null) {
+ throw new IllegalStateException("no config found in model " + this);
+ }
+ }
+
+ public void setConnexionState(Boolean connexionState) {
+ Boolean oldConnexionState = this.connexionState;
+ this.connexionState = connexionState;
+ firePropertyChange(CONNEXION_STATE_PROPERTY_CHANGED, oldConnexionState, connexionState);
+ }
+}
\ No newline at end of file
1
0
r632 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . action handler model
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:38:00 +0000 (Sun, 27 Apr 2008)
New Revision: 632
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
Log:
renommage ConfigUI en ConnexionConfigUI
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java 2008-04-27 08:36:35 UTC (rev 631)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -1,199 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * 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.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import static org.codelutin.i18n.I18n._;
-import org.codelutin.ui.FormElement;
-import org.codelutin.util.FileUtil;
-import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.handler.ConfigUIHandler;
-import org.codelutin.vcs.ui.util.ui.AbstractUI;
-
-import javax.swing.AbstractButton;
-import javax.swing.ButtonGroup;
-import javax.swing.JCheckBox;
-import javax.swing.JComponent;
-import javax.swing.JEditorPane;
-import javax.swing.JLabel;
-import javax.swing.JPasswordField;
-import javax.swing.JRadioButton;
-import javax.swing.JTextField;
-import java.io.File;
-import java.util.Arrays;
-
-/** @author chemit */
-public abstract class ConfigConnexionUI extends AbstractUI<ConfigUIHandler> {
-
- public enum Element implements FormElement<ConfigConnexionUI> {
- connexion,
- login,
- sshLogin,
- password,
- passphrase,
- nopassphrase,
- privateKeyFile;
-
- public Object getValue(ConfigConnexionUI ui) {
- return ui.getElementValue(this);
- }
-
- public void setValue(ConfigConnexionUI ui, String value) {
- //TODO
- JComponent component = ui.getElement(this);
- }
-
- public JLabel getLabel(ConfigConnexionUI ui) {
- return ui.getElementLabel(this);
- }
- }
-
- public abstract ButtonGroup getConnexionMode();
-
- public abstract AbstractButton getChangePrivateKeyFile();
-
- public abstract AbstractButton getGenerateKey();
-
- public abstract AbstractButton getOk();
-
- public abstract AbstractButton getReset();
-
- public abstract AbstractButton getCancel();
-
- public abstract AbstractButton getTestConnection();
-
- public abstract AbstractButton getAddRoot();
-
- public abstract AbstractButton getDeleteRoot();
-
- public abstract AbstractButton getEditRoot();
-
- public String getElementValue(Element element) {
- JComponent o = getElement(element);
- if (o instanceof JPasswordField) {
- return Arrays.toString(((JPasswordField) o).getPassword());
- }
- if (o instanceof JTextField) {
- return ((JTextField) o).getText();
- }
- if (o instanceof JRadioButton) {
- return String.valueOf(((JRadioButton) o).isSelected());
- }
- if (o instanceof JCheckBox) {
- return String.valueOf(((JCheckBox) o).isSelected());
- }
- return "";
- }
-
- public JLabel getElementLabel(Element element) {
- return (JLabel) getObjectById(element.name() + "Label");
- }
-
- public JComponent getElement(Element element) {
- return (JComponent) getObjectById(element.name());
- }
-
-
- public abstract JEditorPane getDoc();
-
- public abstract JRadioButton getConnexionModeAnonymous();
-
- public abstract JRadioButton getConnexionModePassword();
-
- public abstract JRadioButton getConnexionModeSsh();
-
- public abstract JTextField getLogin();
-
- public abstract JTextField getSshLogin();
-
- public abstract JPasswordField getPassword();
-
- public abstract JPasswordField getPassphrase();
-
- public abstract JCheckBox getNoPassPhrase();
-
- public abstract JTextField getPrivateKeyFile();
-
- public abstract JLabel getLoginLabel();
-
- public abstract JLabel getSshLoginLabel();
-
- public abstract JLabel getPasswordLabel();
-
- public abstract JLabel getPassphraseLabel();
-
- public abstract JLabel getPrivateKeyFileLabel();
-
- public abstract javax.swing.JPanel getConnexionPanel();
-
- public abstract java.awt.CardLayout getConnexionPanelLayout();
-
- public abstract javax.swing.JPanel getAnonymousPanel();
-
- public abstract javax.swing.JPanel getPasswordPanel();
-
- public abstract javax.swing.JPanel getSshPanel();
-
- public abstract javax.swing.JComboBox getRootsList();
-
-
- public boolean isConfigValid() {
- return getHandler().isConfigValid();
- }
-
- protected void reset() {
- getHandler().reset();
- }
-
- protected void save() {
- getHandler().save();
- dispose();
- }
-
- protected void doCheck(Element element) {
- getHandler().doCheck(element);
- }
-
- protected void changeAutheticationMode(VCSConnexionMode mode) {
- getHandler().getModel().setConnexionMode(mode);
- doCheck(Element.connexion);
- }
-
- protected void changePrivateKeyFile() {
- //TODO add title in lutinutil :)
- File file = FileUtil.getFile(".*.pub$", _("lutinvcs.config.find.public.key"));
- if (file != null) {
- String path = file.getAbsolutePath();
- getPrivateKeyFile().setText(path.substring(0, path.length() - 4));
- doCheck(Element.privateKeyFile);
- }
- }
-
- protected void generateKey() {
- //TODO
- }
-
- protected void editRoot() {
- //TODO
- }
-
- protected void addRoot() {
- //TODO
- }
-
- protected void deleteRoot() {
- //TODO
- }
-
-}
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java (from rev 631, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -0,0 +1,199 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * 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.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import static org.codelutin.i18n.I18n._;
+import org.codelutin.ui.FormElement;
+import org.codelutin.util.FileUtil;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JPasswordField;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import java.io.File;
+import java.util.Arrays;
+
+/** @author chemit */
+public abstract class ConnexionConfigUI extends AbstractUI<ConfigUIHandler> {
+
+ public enum Element implements FormElement<ConnexionConfigUI> {
+ connexion,
+ login,
+ sshLogin,
+ password,
+ passphrase,
+ nopassphrase,
+ privateKeyFile;
+
+ public Object getValue(ConnexionConfigUI ui) {
+ return ui.getElementValue(this);
+ }
+
+ public void setValue(ConnexionConfigUI ui, String value) {
+ //TODO
+ JComponent component = ui.getElement(this);
+ }
+
+ public JLabel getLabel(ConnexionConfigUI ui) {
+ return ui.getElementLabel(this);
+ }
+ }
+
+ public abstract ButtonGroup getConnexionMode();
+
+ public abstract AbstractButton getChangePrivateKeyFile();
+
+ public abstract AbstractButton getGenerateKey();
+
+ public abstract AbstractButton getOk();
+
+ public abstract AbstractButton getReset();
+
+ public abstract AbstractButton getCancel();
+
+ public abstract AbstractButton getTestConnection();
+
+ public abstract AbstractButton getAddRoot();
+
+ public abstract AbstractButton getDeleteRoot();
+
+ public abstract AbstractButton getEditRoot();
+
+ public String getElementValue(Element element) {
+ JComponent o = getElement(element);
+ if (o instanceof JPasswordField) {
+ return Arrays.toString(((JPasswordField) o).getPassword());
+ }
+ if (o instanceof JTextField) {
+ return ((JTextField) o).getText();
+ }
+ if (o instanceof JRadioButton) {
+ return String.valueOf(((JRadioButton) o).isSelected());
+ }
+ if (o instanceof JCheckBox) {
+ return String.valueOf(((JCheckBox) o).isSelected());
+ }
+ return "";
+ }
+
+ public JLabel getElementLabel(Element element) {
+ return (JLabel) getObjectById(element.name() + "Label");
+ }
+
+ public JComponent getElement(Element element) {
+ return (JComponent) getObjectById(element.name());
+ }
+
+
+ public abstract JEditorPane getDoc();
+
+ public abstract JRadioButton getConnexionModeAnonymous();
+
+ public abstract JRadioButton getConnexionModePassword();
+
+ public abstract JRadioButton getConnexionModeSsh();
+
+ public abstract JTextField getLogin();
+
+ public abstract JTextField getSshLogin();
+
+ public abstract JPasswordField getPassword();
+
+ public abstract JPasswordField getPassphrase();
+
+ public abstract JCheckBox getNoPassPhrase();
+
+ public abstract JTextField getPrivateKeyFile();
+
+ public abstract JLabel getLoginLabel();
+
+ public abstract JLabel getSshLoginLabel();
+
+ public abstract JLabel getPasswordLabel();
+
+ public abstract JLabel getPassphraseLabel();
+
+ public abstract JLabel getPrivateKeyFileLabel();
+
+ public abstract javax.swing.JPanel getConnexionPanel();
+
+ public abstract java.awt.CardLayout getConnexionPanelLayout();
+
+ public abstract javax.swing.JPanel getAnonymousPanel();
+
+ public abstract javax.swing.JPanel getPasswordPanel();
+
+ public abstract javax.swing.JPanel getSshPanel();
+
+ public abstract javax.swing.JComboBox getRootsList();
+
+
+ public boolean isConfigValid() {
+ return getHandler().isConfigValid();
+ }
+
+ protected void reset() {
+ getHandler().reset();
+ }
+
+ protected void save() {
+ getHandler().save();
+ dispose();
+ }
+
+ protected void doCheck(Element element) {
+ getHandler().doCheck(element);
+ }
+
+ protected void changeAutheticationMode(VCSConnexionMode mode) {
+ getHandler().getModel().setConnexionMode(mode);
+ doCheck(Element.connexion);
+ }
+
+ protected void changePrivateKeyFile() {
+ //TODO add title in lutinutil :)
+ File file = FileUtil.getFile(".*.pub$", _("lutinvcs.config.find.public.key"));
+ if (file != null) {
+ String path = file.getAbsolutePath();
+ getPrivateKeyFile().setText(path.substring(0, path.length() - 4));
+ doCheck(Element.privateKeyFile);
+ }
+ }
+
+ protected void generateKey() {
+ //TODO
+ }
+
+ protected void editRoot() {
+ //TODO
+ }
+
+ protected void addRoot() {
+ //TODO
+ }
+
+ protected void deleteRoot() {
+ //TODO
+ }
+
+}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:36:35 UTC (rev 631)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -59,7 +59,7 @@
public static final DialogUIDef<DiffUIModel, DiffUI, DiffUIHandler> DIFF_UI;
public static final DialogUIDef<ChangelogUIModel, ChangelogUI, ChangelogUIHandler> CHANGELOG_UI;
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
- public static final DialogUIDef<ConfigUIModel, ConfigConnexionUI, ConfigUIHandler> CONFIG_UI;
+ public static final DialogUIDef<ConfigUIModel, ConnexionConfigUI, ConfigUIHandler> CONFIG_UI;
public static final DialogUIDef<GenerateSshKeyUIModel, GenerateSshKeyUI, GenerateSshKeyUIHandler> GENERATE_SHH_KEY_UI;
public static final DialogUIDef<IdentityUIModel, IdentityUI, IdentityUIHandler> IDENTITY_UI;
public static final DialogUIDef<TestUIModel, TestUI, TestUIHandler> TEST_UI;
@@ -132,7 +132,7 @@
n_("lutinvcs.action.show.confirmui"),
n_("lutinvcs.action.show.confirmui.tip"),
n_("lutinvcs.confirmui.title"));
- CONFIG_UI = newDef(ConfigUIHandler.class, ConfigConnexionUI.class, ConfigUIModel.class,
+ CONFIG_UI = newDef(ConfigUIHandler.class, ConnexionConfigUI.class, ConfigUIModel.class,
n_("lutinvcs.action.show.configui"),
n_("lutinvcs.action.show.configui.tip"),
n_("lutinvcs.configui.title"));
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:36:35 UTC (rev 631)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.action;
import org.codelutin.ui.DialogUIHandler;
-import org.codelutin.vcs.ui.ConfigConnexionUI;
+import org.codelutin.vcs.ui.ConnexionConfigUI;
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.ConfigUIHandler;
import org.codelutin.vcs.ui.model.ConfigUIModel;
@@ -24,7 +24,7 @@
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowConfigAction extends AbstractVCSShowUIAction<ConfigUIModel, ConfigConnexionUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
+public class ShowConfigAction extends AbstractVCSShowUIAction<ConfigUIModel, ConnexionConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
@@ -33,8 +33,8 @@
}
@Override
- protected ConfigConnexionUI initUI(ActionEvent e) {
- ConfigConnexionUI ui = super.initUI(e);
+ protected ConnexionConfigUI initUI(ActionEvent e) {
+ ConnexionConfigUI ui = super.initUI(e);
ui.getHandler().getModel().populate(getConfig());
ui.pack();
return ui;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:36:35 UTC (rev 631)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -19,7 +19,7 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.ui.ConfigConnexionUI;
+import org.codelutin.vcs.ui.ConnexionConfigUI;
import org.codelutin.vcs.ui.handler.ConfigUIHandler;
import javax.swing.JOptionPane;
@@ -32,7 +32,7 @@
private static final long serialVersionUID = 1L;
- public TestConnexionAction(ConfigConnexionUI ui) {
+ public TestConnexionAction(ConnexionConfigUI ui) {
super(null, org.codelutin.ui.UIHelper.createActionIcon("testconnexion"), ui);
putValue(SHORT_DESCRIPTION, org.codelutin.i18n.I18n._("lutinvcs.config.test.tip"));
//putValue(DISPLAYED_MNEMONIC_INDEX_KEY, 0);
@@ -44,7 +44,7 @@
ConfigUIHandler uiHandler = getHandler();
VCSConnexionConfig config = uiHandler.getConfig();
VCSConnexion connexion = VCSFactory.newConnexion(config);
- ConfigConnexionUI ui = uiHandler.getUi();
+ ConnexionConfigUI ui = uiHandler.getUi();
boolean result = false;
try {
connexion.testConnection();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:36:35 UTC (rev 631)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -16,15 +16,15 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.ConfigConnexionUI;
-import org.codelutin.vcs.ui.ConfigConnexionUI.Element;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.login;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.nopassphrase;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.passphrase;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.password;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.privateKeyFile;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.sshLogin;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.values;
+import org.codelutin.vcs.ui.ConnexionConfigUI;
+import org.codelutin.vcs.ui.ConnexionConfigUI.Element;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.login;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.nopassphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.passphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.password;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.values;
import org.codelutin.vcs.ui.model.ConfigUIModel;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
@@ -40,12 +40,12 @@
import java.util.List;
/** @author chemit */
-public class ConfigUIHandler extends AbstractUIHandler<ConfigUIModel, ConfigConnexionUI> {
+public class ConfigUIHandler extends AbstractUIHandler<ConfigUIModel, ConnexionConfigUI> {
protected List<Element> errors;
- public ConfigUIHandler(ConfigConnexionUI ui, VCSConnexionConfig config) {
+ public ConfigUIHandler(ConnexionConfigUI ui, VCSConnexionConfig config) {
super(ui, new ConfigUIModel(), config);
ui.setHandler(this);
errors = new ArrayList<Element>();
@@ -53,7 +53,7 @@
public void init() {
super.init();
- ConfigConnexionUI ui = getUi();
+ ConnexionConfigUI ui = getUi();
JPanel connexionPanel = ui.getConnexionPanel();
connexionPanel.add(ui.getAnonymousPanel(), VCSConnexionMode.ANONYMOUS.name());
connexionPanel.add(ui.getPasswordPanel(), VCSConnexionMode.PASSWORD.name());
@@ -98,7 +98,7 @@
public synchronized List<Element> validateModel(Element element) {
errors.clear();
- ConfigConnexionUI ui = getUi();
+ ConnexionConfigUI ui = getUi();
if (element != null) {
// compute modifed
setModified(element, ui);
@@ -129,7 +129,7 @@
return errors;
}
- public void setModified(Element element, ConfigConnexionUI ui) {
+ public void setModified(Element element, ConnexionConfigUI ui) {
boolean modify = false;
ConfigUIModel model = getModel();
@@ -198,7 +198,7 @@
}
protected void populateUI(ConfigUIModel model) {
- ConfigConnexionUI ui = getUi();
+ ConnexionConfigUI ui = getUi();
VCSConnexionConfig config = model.getConfig();
switch (config.getMode()) {
case ANONYMOUS:
@@ -218,7 +218,7 @@
}
protected void updateUI(final VCSConnexionMode mode) {
- ConfigConnexionUI ui = getUi();
+ ConnexionConfigUI ui = getUi();
//getModel().removeModified(sshLogin, nopassphrase, passphrase, privateKeyFile, login, password);
switch (mode) {
case ANONYMOUS:
@@ -246,7 +246,7 @@
}
protected void updateUI(List<Element> errors) {
- ConfigConnexionUI ui = getUi();
+ ConnexionConfigUI ui = getUi();
boolean valid = isConfigValid();
ui.getOk().setEnabled(valid && getModel().isModified());
//ui.getTestConnection().setEnabled(valid);
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:36:35 UTC (rev 631)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:38:00 UTC (rev 632)
@@ -16,14 +16,14 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.ConfigConnexionUI.Element;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.connexion;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.login;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.nopassphrase;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.passphrase;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.password;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.privateKeyFile;
-import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.sshLogin;
+import org.codelutin.vcs.ui.ConnexionConfigUI.Element;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.connexion;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.login;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.nopassphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.passphrase;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.password;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.privateKeyFile;
+import static org.codelutin.vcs.ui.ConnexionConfigUI.Element.sshLogin;
import org.codelutin.vcs.ui.util.model.AbstractUIModel;
import java.io.File;
1
0
r631 - in trunk/lutinvcs/ui: common/src/main/java/org/codelutin/vcs/ui common/src/main/java/org/codelutin/vcs/ui/action common/src/main/java/org/codelutin/vcs/ui/handler common/src/main/java/org/codelutin/vcs/ui/model jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:36:35 +0000 (Sun, 27 Apr 2008)
New Revision: 631
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxGenerateSshKeyUI.jaxx
Log:
renommage ConfigUI en ConfigConnexionUI
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java (from rev 630, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigConnexionUI.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -0,0 +1,199 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * 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.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import static org.codelutin.i18n.I18n._;
+import org.codelutin.ui.FormElement;
+import org.codelutin.util.FileUtil;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JPasswordField;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import java.io.File;
+import java.util.Arrays;
+
+/** @author chemit */
+public abstract class ConfigConnexionUI extends AbstractUI<ConfigUIHandler> {
+
+ public enum Element implements FormElement<ConfigConnexionUI> {
+ connexion,
+ login,
+ sshLogin,
+ password,
+ passphrase,
+ nopassphrase,
+ privateKeyFile;
+
+ public Object getValue(ConfigConnexionUI ui) {
+ return ui.getElementValue(this);
+ }
+
+ public void setValue(ConfigConnexionUI ui, String value) {
+ //TODO
+ JComponent component = ui.getElement(this);
+ }
+
+ public JLabel getLabel(ConfigConnexionUI ui) {
+ return ui.getElementLabel(this);
+ }
+ }
+
+ public abstract ButtonGroup getConnexionMode();
+
+ public abstract AbstractButton getChangePrivateKeyFile();
+
+ public abstract AbstractButton getGenerateKey();
+
+ public abstract AbstractButton getOk();
+
+ public abstract AbstractButton getReset();
+
+ public abstract AbstractButton getCancel();
+
+ public abstract AbstractButton getTestConnection();
+
+ public abstract AbstractButton getAddRoot();
+
+ public abstract AbstractButton getDeleteRoot();
+
+ public abstract AbstractButton getEditRoot();
+
+ public String getElementValue(Element element) {
+ JComponent o = getElement(element);
+ if (o instanceof JPasswordField) {
+ return Arrays.toString(((JPasswordField) o).getPassword());
+ }
+ if (o instanceof JTextField) {
+ return ((JTextField) o).getText();
+ }
+ if (o instanceof JRadioButton) {
+ return String.valueOf(((JRadioButton) o).isSelected());
+ }
+ if (o instanceof JCheckBox) {
+ return String.valueOf(((JCheckBox) o).isSelected());
+ }
+ return "";
+ }
+
+ public JLabel getElementLabel(Element element) {
+ return (JLabel) getObjectById(element.name() + "Label");
+ }
+
+ public JComponent getElement(Element element) {
+ return (JComponent) getObjectById(element.name());
+ }
+
+
+ public abstract JEditorPane getDoc();
+
+ public abstract JRadioButton getConnexionModeAnonymous();
+
+ public abstract JRadioButton getConnexionModePassword();
+
+ public abstract JRadioButton getConnexionModeSsh();
+
+ public abstract JTextField getLogin();
+
+ public abstract JTextField getSshLogin();
+
+ public abstract JPasswordField getPassword();
+
+ public abstract JPasswordField getPassphrase();
+
+ public abstract JCheckBox getNoPassPhrase();
+
+ public abstract JTextField getPrivateKeyFile();
+
+ public abstract JLabel getLoginLabel();
+
+ public abstract JLabel getSshLoginLabel();
+
+ public abstract JLabel getPasswordLabel();
+
+ public abstract JLabel getPassphraseLabel();
+
+ public abstract JLabel getPrivateKeyFileLabel();
+
+ public abstract javax.swing.JPanel getConnexionPanel();
+
+ public abstract java.awt.CardLayout getConnexionPanelLayout();
+
+ public abstract javax.swing.JPanel getAnonymousPanel();
+
+ public abstract javax.swing.JPanel getPasswordPanel();
+
+ public abstract javax.swing.JPanel getSshPanel();
+
+ public abstract javax.swing.JComboBox getRootsList();
+
+
+ public boolean isConfigValid() {
+ return getHandler().isConfigValid();
+ }
+
+ protected void reset() {
+ getHandler().reset();
+ }
+
+ protected void save() {
+ getHandler().save();
+ dispose();
+ }
+
+ protected void doCheck(Element element) {
+ getHandler().doCheck(element);
+ }
+
+ protected void changeAutheticationMode(VCSConnexionMode mode) {
+ getHandler().getModel().setConnexionMode(mode);
+ doCheck(Element.connexion);
+ }
+
+ protected void changePrivateKeyFile() {
+ //TODO add title in lutinutil :)
+ File file = FileUtil.getFile(".*.pub$", _("lutinvcs.config.find.public.key"));
+ if (file != null) {
+ String path = file.getAbsolutePath();
+ getPrivateKeyFile().setText(path.substring(0, path.length() - 4));
+ doCheck(Element.privateKeyFile);
+ }
+ }
+
+ protected void generateKey() {
+ //TODO
+ }
+
+ protected void editRoot() {
+ //TODO
+ }
+
+ protected void addRoot() {
+ //TODO
+ }
+
+ protected void deleteRoot() {
+ //TODO
+ }
+
+}
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -1,199 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * 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.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import static org.codelutin.i18n.I18n._;
-import org.codelutin.ui.FormElement;
-import org.codelutin.util.FileUtil;
-import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.handler.ConfigUIHandler;
-import org.codelutin.vcs.ui.util.ui.AbstractUI;
-
-import javax.swing.AbstractButton;
-import javax.swing.ButtonGroup;
-import javax.swing.JCheckBox;
-import javax.swing.JComponent;
-import javax.swing.JEditorPane;
-import javax.swing.JLabel;
-import javax.swing.JPasswordField;
-import javax.swing.JRadioButton;
-import javax.swing.JTextField;
-import java.io.File;
-import java.util.Arrays;
-
-/** @author chemit */
-public abstract class ConfigUI extends AbstractUI<ConfigUIHandler> {
-
- public enum Element implements FormElement<ConfigUI> {
- connexion,
- login,
- sshLogin,
- password,
- passphrase,
- nopassphrase,
- privateKeyFile;
-
- public Object getValue(ConfigUI ui) {
- return ui.getElementValue(this);
- }
-
- public void setValue(ConfigUI ui, String value) {
- //TODO
- JComponent component = ui.getElement(this);
- }
-
- public JLabel getLabel(ConfigUI ui) {
- return ui.getElementLabel(this);
- }
- }
-
- public abstract ButtonGroup getConnexionMode();
-
- public abstract AbstractButton getChangePrivateKeyFile();
-
- public abstract AbstractButton getGenerateKey();
-
- public abstract AbstractButton getOk();
-
- public abstract AbstractButton getReset();
-
- public abstract AbstractButton getCancel();
-
- public abstract AbstractButton getTestConnection();
-
- public abstract AbstractButton getAddRoot();
-
- public abstract AbstractButton getDeleteRoot();
-
- public abstract AbstractButton getEditRoot();
-
- public String getElementValue(Element element) {
- JComponent o = getElement(element);
- if (o instanceof JPasswordField) {
- return Arrays.toString(((JPasswordField) o).getPassword());
- }
- if (o instanceof JTextField) {
- return ((JTextField) o).getText();
- }
- if (o instanceof JRadioButton) {
- return String.valueOf(((JRadioButton) o).isSelected());
- }
- if (o instanceof JCheckBox) {
- return String.valueOf(((JCheckBox) o).isSelected());
- }
- return "";
- }
-
- public JLabel getElementLabel(Element element) {
- return (JLabel) getObjectById(element.name() + "Label");
- }
-
- public JComponent getElement(Element element) {
- return (JComponent) getObjectById(element.name());
- }
-
-
- public abstract JEditorPane getDoc();
-
- public abstract JRadioButton getConnexionModeAnonymous();
-
- public abstract JRadioButton getConnexionModePassword();
-
- public abstract JRadioButton getConnexionModeSsh();
-
- public abstract JTextField getLogin();
-
- public abstract JTextField getSshLogin();
-
- public abstract JPasswordField getPassword();
-
- public abstract JPasswordField getPassphrase();
-
- public abstract JCheckBox getNoPassPhrase();
-
- public abstract JTextField getPrivateKeyFile();
-
- public abstract JLabel getLoginLabel();
-
- public abstract JLabel getSshLoginLabel();
-
- public abstract JLabel getPasswordLabel();
-
- public abstract JLabel getPassphraseLabel();
-
- public abstract JLabel getPrivateKeyFileLabel();
-
- public abstract javax.swing.JPanel getConnexionPanel();
-
- public abstract java.awt.CardLayout getConnexionPanelLayout();
-
- public abstract javax.swing.JPanel getAnonymousPanel();
-
- public abstract javax.swing.JPanel getPasswordPanel();
-
- public abstract javax.swing.JPanel getSshPanel();
-
- public abstract javax.swing.JComboBox getRootsList();
-
-
- public boolean isConfigValid() {
- return getHandler().isConfigValid();
- }
-
- protected void reset() {
- getHandler().reset();
- }
-
- protected void save() {
- getHandler().save();
- dispose();
- }
-
- protected void doCheck(Element element) {
- getHandler().doCheck(element);
- }
-
- protected void changeAutheticationMode(VCSConnexionMode mode) {
- getHandler().getModel().setConnexionMode(mode);
- doCheck(Element.connexion);
- }
-
- protected void changePrivateKeyFile() {
- //TODO add title in lutinutil :)
- File file = FileUtil.getFile(".*.pub$", _("lutinvcs.config.find.public.key"));
- if (file != null) {
- String path = file.getAbsolutePath();
- getPrivateKeyFile().setText(path.substring(0, path.length() - 4));
- doCheck(Element.privateKeyFile);
- }
- }
-
- protected void generateKey() {
- //TODO
- }
-
- protected void editRoot() {
- //TODO
- }
-
- protected void addRoot() {
- //TODO
- }
-
- protected void deleteRoot() {
- //TODO
- }
-
-}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -59,7 +59,7 @@
public static final DialogUIDef<DiffUIModel, DiffUI, DiffUIHandler> DIFF_UI;
public static final DialogUIDef<ChangelogUIModel, ChangelogUI, ChangelogUIHandler> CHANGELOG_UI;
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
- public static final DialogUIDef<ConfigUIModel, ConfigUI, ConfigUIHandler> CONFIG_UI;
+ public static final DialogUIDef<ConfigUIModel, ConfigConnexionUI, ConfigUIHandler> CONFIG_UI;
public static final DialogUIDef<GenerateSshKeyUIModel, GenerateSshKeyUI, GenerateSshKeyUIHandler> GENERATE_SHH_KEY_UI;
public static final DialogUIDef<IdentityUIModel, IdentityUI, IdentityUIHandler> IDENTITY_UI;
public static final DialogUIDef<TestUIModel, TestUI, TestUIHandler> TEST_UI;
@@ -132,7 +132,7 @@
n_("lutinvcs.action.show.confirmui"),
n_("lutinvcs.action.show.confirmui.tip"),
n_("lutinvcs.confirmui.title"));
- CONFIG_UI = newDef(ConfigUIHandler.class, ConfigUI.class, ConfigUIModel.class,
+ CONFIG_UI = newDef(ConfigUIHandler.class, ConfigConnexionUI.class, ConfigUIModel.class,
n_("lutinvcs.action.show.configui"),
n_("lutinvcs.action.show.configui.tip"),
n_("lutinvcs.configui.title"));
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.action;
import org.codelutin.ui.DialogUIHandler;
-import org.codelutin.vcs.ui.ConfigUI;
+import org.codelutin.vcs.ui.ConfigConnexionUI;
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.ConfigUIHandler;
import org.codelutin.vcs.ui.model.ConfigUIModel;
@@ -24,7 +24,7 @@
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowConfigAction extends AbstractVCSShowUIAction<ConfigUIModel, ConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
+public class ShowConfigAction extends AbstractVCSShowUIAction<ConfigUIModel, ConfigConnexionUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
@@ -33,8 +33,8 @@
}
@Override
- protected ConfigUI initUI(ActionEvent e) {
- ConfigUI ui = super.initUI(e);
+ protected ConfigConnexionUI initUI(ActionEvent e) {
+ ConfigConnexionUI ui = super.initUI(e);
ui.getHandler().getModel().populate(getConfig());
ui.pack();
return ui;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -19,7 +19,7 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.ui.ConfigUI;
+import org.codelutin.vcs.ui.ConfigConnexionUI;
import org.codelutin.vcs.ui.handler.ConfigUIHandler;
import javax.swing.JOptionPane;
@@ -32,7 +32,7 @@
private static final long serialVersionUID = 1L;
- public TestConnexionAction(org.codelutin.vcs.ui.ConfigUI ui) {
+ public TestConnexionAction(ConfigConnexionUI ui) {
super(null, org.codelutin.ui.UIHelper.createActionIcon("testconnexion"), ui);
putValue(SHORT_DESCRIPTION, org.codelutin.i18n.I18n._("lutinvcs.config.test.tip"));
//putValue(DISPLAYED_MNEMONIC_INDEX_KEY, 0);
@@ -44,7 +44,7 @@
ConfigUIHandler uiHandler = getHandler();
VCSConnexionConfig config = uiHandler.getConfig();
VCSConnexion connexion = VCSFactory.newConnexion(config);
- ConfigUI ui = uiHandler.getUi();
+ ConfigConnexionUI ui = uiHandler.getUi();
boolean result = false;
try {
connexion.testConnection();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -16,15 +16,15 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.ConfigUI;
-import org.codelutin.vcs.ui.ConfigUI.Element;
-import static org.codelutin.vcs.ui.ConfigUI.Element.login;
-import static org.codelutin.vcs.ui.ConfigUI.Element.nopassphrase;
-import static org.codelutin.vcs.ui.ConfigUI.Element.passphrase;
-import static org.codelutin.vcs.ui.ConfigUI.Element.password;
-import static org.codelutin.vcs.ui.ConfigUI.Element.privateKeyFile;
-import static org.codelutin.vcs.ui.ConfigUI.Element.sshLogin;
-import static org.codelutin.vcs.ui.ConfigUI.Element.values;
+import org.codelutin.vcs.ui.ConfigConnexionUI;
+import org.codelutin.vcs.ui.ConfigConnexionUI.Element;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.login;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.nopassphrase;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.passphrase;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.password;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.privateKeyFile;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.sshLogin;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.values;
import org.codelutin.vcs.ui.model.ConfigUIModel;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
@@ -40,12 +40,12 @@
import java.util.List;
/** @author chemit */
-public class ConfigUIHandler extends AbstractUIHandler<ConfigUIModel, ConfigUI> {
+public class ConfigUIHandler extends AbstractUIHandler<ConfigUIModel, ConfigConnexionUI> {
protected List<Element> errors;
- public ConfigUIHandler(ConfigUI ui, VCSConnexionConfig config) {
+ public ConfigUIHandler(ConfigConnexionUI ui, VCSConnexionConfig config) {
super(ui, new ConfigUIModel(), config);
ui.setHandler(this);
errors = new ArrayList<Element>();
@@ -53,7 +53,7 @@
public void init() {
super.init();
- ConfigUI ui = getUi();
+ ConfigConnexionUI ui = getUi();
JPanel connexionPanel = ui.getConnexionPanel();
connexionPanel.add(ui.getAnonymousPanel(), VCSConnexionMode.ANONYMOUS.name());
connexionPanel.add(ui.getPasswordPanel(), VCSConnexionMode.PASSWORD.name());
@@ -98,7 +98,7 @@
public synchronized List<Element> validateModel(Element element) {
errors.clear();
- ConfigUI ui = getUi();
+ ConfigConnexionUI ui = getUi();
if (element != null) {
// compute modifed
setModified(element, ui);
@@ -129,7 +129,7 @@
return errors;
}
- public void setModified(Element element, ConfigUI ui) {
+ public void setModified(Element element, ConfigConnexionUI ui) {
boolean modify = false;
ConfigUIModel model = getModel();
@@ -198,7 +198,7 @@
}
protected void populateUI(ConfigUIModel model) {
- ConfigUI ui = getUi();
+ ConfigConnexionUI ui = getUi();
VCSConnexionConfig config = model.getConfig();
switch (config.getMode()) {
case ANONYMOUS:
@@ -218,7 +218,7 @@
}
protected void updateUI(final VCSConnexionMode mode) {
- ConfigUI ui = getUi();
+ ConfigConnexionUI ui = getUi();
//getModel().removeModified(sshLogin, nopassphrase, passphrase, privateKeyFile, login, password);
switch (mode) {
case ANONYMOUS:
@@ -246,7 +246,7 @@
}
protected void updateUI(List<Element> errors) {
- ConfigUI ui = getUi();
+ ConfigConnexionUI ui = getUi();
boolean valid = isConfigValid();
ui.getOk().setEnabled(valid && getModel().isModified());
//ui.getTestConnection().setEnabled(valid);
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:36:35 UTC (rev 631)
@@ -16,14 +16,14 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.ConfigUI.Element;
-import static org.codelutin.vcs.ui.ConfigUI.Element.connexion;
-import static org.codelutin.vcs.ui.ConfigUI.Element.login;
-import static org.codelutin.vcs.ui.ConfigUI.Element.nopassphrase;
-import static org.codelutin.vcs.ui.ConfigUI.Element.passphrase;
-import static org.codelutin.vcs.ui.ConfigUI.Element.password;
-import static org.codelutin.vcs.ui.ConfigUI.Element.privateKeyFile;
-import static org.codelutin.vcs.ui.ConfigUI.Element.sshLogin;
+import org.codelutin.vcs.ui.ConfigConnexionUI.Element;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.connexion;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.login;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.nopassphrase;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.passphrase;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.password;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.privateKeyFile;
+import static org.codelutin.vcs.ui.ConfigConnexionUI.Element.sshLogin;
import org.codelutin.vcs.ui.util.model.AbstractUIModel;
import java.io.File;
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxGenerateSshKeyUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxGenerateSshKeyUI.jaxx 2008-04-27 08:31:07 UTC (rev 630)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxGenerateSshKeyUI.jaxx 2008-04-27 08:36:35 UTC (rev 631)
@@ -1,5 +1,4 @@
<GenerateSshKeyUI modal="true">
- <!--ConfigUI title='lutinvcs.config.title' resizable='false'-->
<style source="config.css"/>
<script>
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
1
0
r630 - trunk/lutinvcs/ui/jaxx/src/main/resources/icons
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
by tchemit@users.labs.libre-entreprise.org 27 Apr '08
27 Apr '08
Author: tchemit
Date: 2008-04-27 08:31:07 +0000 (Sun, 27 Apr 2008)
New Revision: 630
Added:
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/COPY.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-addroot.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/connection_mode.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/modified.png
Log:
introduction ui Identity (pour les param?\195?\168tre perso de l'utilisateur (nom prenom email)
suppression de l'ui de config
debut de l'ui de configuration des VCSRoots
introduction ui de test
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/COPY.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/COPY.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-addroot.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-addroot.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/connection_mode.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/connection_mode.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/modified.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/modified.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0