Jaxx-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
April 2008
- 1 participants
- 373 discussions
[Buix-commits] 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
[Buix-commits] 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
[Buix-commits] 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
[Buix-commits] 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
[Buix-commits] r629 - trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs
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:28:26 +0000 (Sun, 27 Apr 2008)
New Revision: 629
Modified:
trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java
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
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:28:17 UTC (rev 628)
+++ trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java 2008-04-27 08:28:26 UTC (rev 629)
@@ -16,12 +16,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.ui.DialogUIDef;
import org.codelutin.vcs.ui.UIActionHelper;
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.model.SynchUIModel;
+import org.codelutin.vcs.ui.model.TestUIModel;
import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
import java.io.File;
import java.io.IOException;
import java.util.List;
@@ -33,28 +35,62 @@
public static void main(String[] args) throws Exception {
+ final RepositoryGenerator generator = new RepositoryGenerator();
- RepositoryGenerator generator = new RepositoryGenerator();
+ final VCSConnexion connexion = initMockVCS(generator, 10, 5, 10, 1024);
- VCSConnexion connexion = initMockVCS(generator, 10, 5, 10, 1024);
+ connexion.open();
- VCSEntry[] entries = initModel(generator, connexion);
+ final TestUIModel firstModel = initModel(connexion);
+
+ firstModel.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getPropertyName().equals(TestUIModel.PREPARE_UI_PROPERTY_CHANGED)) {
+ DialogUIDef uiDef = (DialogUIDef) evt.getNewValue();
+ TestUIModel model = (TestUIModel) evt.getOldValue();
+ // show ui
+ if (uiDef == VCSUIFactory.IDENTITY_UI) {
+ log.info("show first launch ui "+firstModel.getIdentity());
+ return;
+ }
+ if (uiDef == VCSUIFactory.CONFIG_UI) {
+ log.info("show config ui");
+ return;
+ }
+ if (uiDef == VCSUIFactory.SYNCH_UI) {
+ log.info("show synch ui");
+ generator.generateStates(model.getEntries());
+ return;
+ }
+ return;
+ }
+ if (evt.getPropertyName().equals(TestUIModel.SHOW_UI_PROPERTY_CHANGED)) {
+
+ return;
+ }
+
+ throw new IllegalStateException("unknown property changed " + evt);
+ }
+ });
initUI(generator, connexion);
- UIActionHelper.showSynchUI(connexion.getConfig(), null, VCSEntryLocation.ALL, entries);
-
+ UIActionHelper.showTestUI(firstModel, null);
}
- protected static VCSEntry[] initModel(RepositoryGenerator generator, VCSConnexion connexion) throws VCSException {
+ protected static TestUIModel initModel(VCSConnexion connexion) throws VCSException {
- connexion.open();
-
SynchUIModel model = new SynchUIModel();
model.populate(connexion);
- generator.generateStates(model.getEntriesModel());
List<VCSEntry> entries = model.getEntriesModel().getEntries();
- return entries.toArray(new VCSEntry[entries.size()]);
+ VCSEntry[] entries1 = entries.toArray(new VCSEntry[entries.size()]);
+ //generator.generateStates(entries1);
+ MockIdentity src = new MockIdentity("email(a)dot.com", "firstname", "lastname");
+ TestUIModel _model = new TestUIModel();
+ _model.setConnexion(connexion);
+ _model.setEntries(entries1);
+ _model.setIdentity(src);
+ return _model;
}
public static VCSConnexion initMockVCS(final RepositoryGenerator generator, int i, int i1, int i2, int i3) throws IOException {
@@ -85,4 +121,46 @@
});
}
+
+ public static class MockIdentity implements java.io.Serializable {
+ protected String firstname;
+ protected String lastname;
+ protected String email;
+
+ private static final long serialVersionUID = 1L;
+
+ public MockIdentity(String email, String firstname, String lastname) {
+ this.email = email;
+ this.firstname = firstname;
+ this.lastname = lastname;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String toString() {
+ return super.toString()+", firstname:"+firstname+", lastname:"+lastname+", email:"+email;
+ }
+ }
}
\ No newline at end of file
1
0
[Buix-commits] r628 - in trunk/lutinvcs/ui/common/src/main: java/org/codelutin resources/i18n
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:28:17 +0000 (Sun, 27 Apr 2008)
New Revision: 628
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/ui/
Modified:
trunk/lutinvcs/ui/common/src/main/resources/i18n/common-en_GB.properties
trunk/lutinvcs/ui/common/src/main/resources/i18n/common-fr_FR.properties
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
Modified: trunk/lutinvcs/ui/common/src/main/resources/i18n/common-en_GB.properties
===================================================================
--- trunk/lutinvcs/ui/common/src/main/resources/i18n/common-en_GB.properties 2008-04-27 08:28:06 UTC (rev 627)
+++ trunk/lutinvcs/ui/common/src/main/resources/i18n/common-en_GB.properties 2008-04-27 08:28:17 UTC (rev 628)
@@ -21,8 +21,12 @@
lutinvcs.action.show.confirmui.tip=
lutinvcs.action.show.generatesshkeyui=
lutinvcs.action.show.generatesshkeyui.tip=
+lutinvcs.action.show.identityui=
+lutinvcs.action.show.identityui.tip=
lutinvcs.action.show.synchui=
lutinvcs.action.show.synchui.tip=
+lutinvcs.action.show.testui=
+lutinvcs.action.show.testui.tip=
lutinvcs.action.showmessages.tip=show previous commit messages
lutinvcs.action.showui.diffui=
lutinvcs.action.showui.diffui.tip=
@@ -37,9 +41,11 @@
lutinvcs.diffui.title=
lutinvcs.error.test=Connexion failed fro reason {0}
lutinvcs.file=File
+lutinvcs.firstlaunch.title=
lutinvcs.generatesshkeyui.title=
lutinvcs.module=Module
lutinvcs.status=Status
lutinvcs.success.test=Connexion was successfull established
lutinvcs.synchui.title=
lutinvcs.test.result=Connexion Result UI
+lutinvcs.testui.title=
Modified: trunk/lutinvcs/ui/common/src/main/resources/i18n/common-fr_FR.properties
===================================================================
--- trunk/lutinvcs/ui/common/src/main/resources/i18n/common-fr_FR.properties 2008-04-27 08:28:06 UTC (rev 627)
+++ trunk/lutinvcs/ui/common/src/main/resources/i18n/common-fr_FR.properties 2008-04-27 08:28:17 UTC (rev 628)
@@ -21,8 +21,12 @@
lutinvcs.action.show.confirmui.tip=Cliquer ic pour ouvrir la fen\u00EAtre de confirmation
lutinvcs.action.show.generatesshkeyui=G\u00E9n\u00E9rer la clef
lutinvcs.action.show.generatesshkeyui.tip=G\u00E9n\u00E9rer la paire de clefs ssh
+lutinvcs.action.show.identityui=Identit\u00E9
+lutinvcs.action.show.identityui.tip=Voir l'ui de saisie de l'identit\u00E9
lutinvcs.action.show.synchui=Synchroniser
lutinvcs.action.show.synchui.tip=Voir la fen\u00EAtre de synchronisation
+lutinvcs.action.show.testui=UI de test
+lutinvcs.action.show.testui.tip=Voir l'ui de test
lutinvcs.action.showmessages.tip=voir les messages de publication pr\u00E9c\u00E9dents
lutinvcs.action.showui.diffui=Voir les diff\u00E9rences
lutinvcs.action.showui.diffui.tip=Voir les diff\u00E9rences
@@ -37,9 +41,11 @@
lutinvcs.diffui.title=Diff UI
lutinvcs.error.test=La connexion n''a pas pu \u00EAtre \u00E9tablie pour la raison suivante \: {0}
lutinvcs.file=Fichier
+lutinvcs.firstlaunch.title=Identity UI
lutinvcs.generatesshkeyui.title=GenerateSshKey UI
lutinvcs.module=Module
lutinvcs.status=Status
lutinvcs.success.test=Connexion \u00E9tablie avec succ\u00E8s
lutinvcs.synchui.title=Synch UI
lutinvcs.test.result=Config Result UI
+lutinvcs.testui.title=TestUI
1
0
[Buix-commits] r627 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . action handler model util
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:28:06 +0000 (Sun, 27 Apr 2008)
New Revision: 627
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/IdentityUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/TestUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowIdentityUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowTestUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/IdentityUIHandler.java
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/model/IdentityUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/TestUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractVCSShowUIAction.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/UIActionHelper.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/ShowChangelogUIAction.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/ShowConfirmUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowDiffUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowSynchUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.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/common/src/main/java/org/codelutin/vcs/ui/util/AbstractShowUIAction.java
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
Modified: 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:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -37,9 +37,6 @@
public abstract class ConfigUI extends AbstractUI<ConfigUIHandler> {
public enum Element implements FormElement<ConfigUI> {
- firstname,
- lastname,
- email,
connexion,
login,
sshLogin,
@@ -76,6 +73,12 @@
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) {
@@ -104,12 +107,6 @@
public abstract JEditorPane getDoc();
- public abstract JTextField getFirstname();
-
- public abstract JTextField getLastname();
-
- public abstract JTextField getEmail();
-
public abstract JRadioButton getConnexionModeAnonymous();
public abstract JRadioButton getConnexionModePassword();
@@ -128,12 +125,6 @@
public abstract JTextField getPrivateKeyFile();
- public abstract JLabel getFirstnameLabel();
-
- public abstract JLabel getLastnameLabel();
-
- public abstract JLabel getEmailLabel();
-
public abstract JLabel getLoginLabel();
public abstract JLabel getSshLoginLabel();
@@ -154,8 +145,9 @@
public abstract javax.swing.JPanel getSshPanel();
- public abstract javax.swing.JScrollPane getIdentityScroll();
+ public abstract javax.swing.JComboBox getRootsList();
+
public boolean isConfigValid() {
return getHandler().isConfigValid();
}
@@ -176,7 +168,6 @@
protected void changeAutheticationMode(VCSConnexionMode mode) {
getHandler().getModel().setConnexionMode(mode);
doCheck(Element.connexion);
- //doCheck(Element.connexion);
}
protected void changePrivateKeyFile() {
@@ -193,4 +184,16 @@
//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/IdentityUI.java (from rev 615, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/IdentityUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/IdentityUI.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,112 @@
+/**
+ * # #% 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 org.codelutin.ui.DialogUI;
+import org.codelutin.ui.FormElement;
+import org.codelutin.vcs.ui.handler.IdentityUIHandler;
+
+import javax.swing.AbstractButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPasswordField;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import java.util.Arrays;
+
+/** @author chemit */
+public abstract class IdentityUI extends DialogUI<IdentityUIHandler> {
+
+ public enum Element implements FormElement<IdentityUI> {
+ firstname,
+ lastname,
+ email;
+
+ public Object getValue(IdentityUI ui) {
+ return ui.getElementValue(this);
+ }
+
+ public void setValue(IdentityUI ui, String value) {
+ //TODO
+ JComponent component = ui.getElement(this);
+ }
+
+ public JLabel getLabel(IdentityUI ui) {
+ return ui.getElementLabel(this);
+ }
+ }
+
+ public abstract AbstractButton getOk();
+
+ public abstract AbstractButton getReset();
+
+ public abstract AbstractButton getCancel();
+
+ 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 JTextField getFirstname();
+
+ public abstract JTextField getLastname();
+
+ public abstract JTextField getEmail();
+
+ public abstract JLabel getFirstnameLabel();
+
+ public abstract JLabel getLastnameLabel();
+
+ public abstract JLabel getEmailLabel();
+
+ 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);
+ }
+
+}
\ No newline at end of file
Added: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/TestUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/TestUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/TestUI.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,33 @@
+/**
+ * # #% 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 org.codelutin.ui.DialogUIDef;
+
+/** @author chemit */
+public abstract class TestUI extends org.codelutin.ui.DialogUI<org.codelutin.vcs.ui.handler.TestUIHandler> {
+
+ public abstract javax.swing.AbstractButton getShowFirstLaunch();
+
+ public abstract javax.swing.AbstractButton getShowConfig();
+
+ public abstract javax.swing.AbstractButton getShowSynch();
+
+ public void showUI(DialogUIDef uiDef) {
+ getHandler().getModel().setUIDef(uiDef);
+ }
+
+
+}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/UIActionHelper.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/UIActionHelper.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/UIActionHelper.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -15,6 +15,7 @@
package org.codelutin.vcs.ui;
import org.codelutin.ui.DialogUI;
+import org.codelutin.ui.ShowUIAction;
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
@@ -23,49 +24,74 @@
import org.codelutin.vcs.ui.action.ShowConfigAction;
import org.codelutin.vcs.ui.action.ShowConfirmUIAction;
import org.codelutin.vcs.ui.action.ShowDiffUIAction;
+import org.codelutin.vcs.ui.action.ShowIdentityUIAction;
import org.codelutin.vcs.ui.action.ShowSynchUIAction;
+import org.codelutin.vcs.ui.action.ShowTestUIAction;
+import org.codelutin.vcs.ui.model.TestUIModel;
import java.awt.event.ActionEvent;
/** @author chemit */
public class UIActionHelper {
- public static void showSynchUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSEntry[] entries) {
+ public static void showSynchUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSEntry[] entries, String position) {
ShowSynchUIAction action = new ShowSynchUIAction(ui, false);
action.setConfig(config);
action.setLocation(location);
action.setEntries(entries);
- action.actionPerformed(new ActionEvent(ui == null ? action : ui, 0, "" + action.getValue(javax.swing.AbstractAction.NAME)));
+ action.setPosition(position);
+ fireAction(ui, action);
}
- public static void showConfigUI(VCSConnexionConfig config, DialogUI<?> ui) {
+ public static void showConfigUI(VCSConnexionConfig config, DialogUI<?> ui, String position) {
ShowConfigAction action = new ShowConfigAction(ui, false);
action.setConfig(config);
- action.actionPerformed(new ActionEvent(ui == null ? action : ui, 0, "" + action.getValue(javax.swing.AbstractAction.NAME)));
+ action.setPosition(position);
+ fireAction(ui, action);
}
- public static void showConfirmUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSAction vcsAction, VCSEntry[] entries) {
+ public static void showConfirmUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSAction vcsAction, VCSEntry[] entries, String position) {
ShowConfirmUIAction action = new ShowConfirmUIAction(ui, false);
+ action.setPosition(position);
action.setAction(vcsAction);
action.setLocation(location);
action.setEntries(entries);
action.setConfig(config);
- action.actionPerformed(new ActionEvent(ui == null ? action : ui, 0, "" + action.getValue(javax.swing.AbstractAction.NAME)));
+ fireAction(ui, action);
}
- public static void showDiffUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSEntry[] entries) {
+ public static void showDiffUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSEntry[] entries, String position) {
ShowDiffUIAction action = new ShowDiffUIAction(ui, false);
+ action.setPosition(position);
action.setLocation(location);
action.setEntries(entries);
action.setConfig(config);
- action.actionPerformed(new ActionEvent(ui == null ? action : ui, 0, "" + action.getValue(javax.swing.AbstractAction.NAME)));
+ fireAction(ui, action);
}
- public static void showChangelogUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSEntry[] entries) {
+ public static void showChangelogUI(VCSConnexionConfig config, DialogUI ui, VCSEntryLocation location, VCSEntry[] entries, String position) {
ShowChangelogUIAction action = new ShowChangelogUIAction(ui, false);
+ action.setPosition(position);
action.setLocation(location);
action.setEntries(entries);
action.setConfig(config);
+ fireAction(ui, action);
+ }
+
+ public static void showIdentityUI(java.io.Serializable src, DialogUI<?> ui, String position) {
+ ShowIdentityUIAction action = new ShowIdentityUIAction(ui, false);
+ action.setSrc(src);
+ action.setPosition(position);
+ fireAction(ui, action);
+ }
+
+ public static void showTestUI(TestUIModel model, DialogUI<?> ui) {
+ ShowTestUIAction action = new ShowTestUIAction(ui, false);
+ action.setModel(model, true);
+ fireAction(ui, action);
+ }
+
+ protected static void fireAction(DialogUI<?> ui, ShowUIAction action) {
action.actionPerformed(new ActionEvent(ui == null ? action : ui, 0, "" + action.getValue(javax.swing.AbstractAction.NAME)));
}
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:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -29,14 +29,18 @@
import org.codelutin.vcs.ui.handler.ConfigUIHandler;
import org.codelutin.vcs.ui.handler.ConfirmUIHandler;
import org.codelutin.vcs.ui.handler.DiffUIHandler;
+import org.codelutin.vcs.ui.handler.IdentityUIHandler;
import org.codelutin.vcs.ui.handler.GenerateSshKeyUIHandler;
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.ConfirmUIModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
+import org.codelutin.vcs.ui.model.IdentityUIModel;
import org.codelutin.vcs.ui.model.GenerateSshKeyUIModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
+import org.codelutin.vcs.ui.model.TestUIModel;
import java.awt.event.WindowEvent;
@@ -57,9 +61,11 @@
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
public static final DialogUIDef<ConfigUIModel, ConfigUI, 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;
public static DialogUIDef[] defs() {
- return new DialogUIDef[]{SYNCH_UI,DIFF_UI,CHANGELOG_UI,CONFIG_UI,CONFIRM_UI,GENERATE_SHH_KEY_UI};
+ return new DialogUIDef[]{SYNCH_UI, DIFF_UI, CHANGELOG_UI, CONFIG_UI, CONFIRM_UI, GENERATE_SHH_KEY_UI, IDENTITY_UI,TEST_UI};
}
protected static VCSUIFactory instance;
@@ -134,5 +140,13 @@
n_("lutinvcs.action.show.generatesshkeyui"),
n_("lutinvcs.action.show.generatesshkeyui.tip"),
n_("lutinvcs.generatesshkeyui.title"));
+ IDENTITY_UI = newDef(IdentityUIHandler.class, IdentityUI.class, IdentityUIModel.class,
+ n_("lutinvcs.action.show.identityui"),
+ n_("lutinvcs.action.show.identityui.tip"),
+ n_("lutinvcs.firstlaunch.title"));
+ TEST_UI = newDef(TestUIHandler.class, TestUI.class, TestUIModel.class,
+ n_("lutinvcs.action.show.testui"),
+ n_("lutinvcs.action.show.testui.tip"),
+ n_("lutinvcs.testui.title"));
}
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowChangelogUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowChangelogUIAction.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowChangelogUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -22,12 +22,12 @@
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.ChangelogUIHandler;
import org.codelutin.vcs.ui.model.ChangelogUIModel;
-import org.codelutin.vcs.ui.util.AbstractShowUIAction;
+import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowChangelogUIAction extends AbstractShowUIAction<ChangelogUIModel, ChangelogUI, ChangelogUIHandler, DialogUIHandler<?, ?>> {
+public class ShowChangelogUIAction extends AbstractVCSShowUIAction<ChangelogUIModel, ChangelogUI, ChangelogUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
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:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -19,12 +19,12 @@
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.util.AbstractShowUIAction;
+import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowConfigAction extends AbstractShowUIAction<ConfigUIModel, ConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
+public class ShowConfigAction extends AbstractVCSShowUIAction<ConfigUIModel, ConfigUI, ConfigUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
@@ -36,7 +36,7 @@
protected ConfigUI initUI(ActionEvent e) {
ConfigUI ui = super.initUI(e);
ui.getHandler().getModel().populate(getConfig());
+ ui.pack();
return ui;
}
-
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfirmUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfirmUIAction.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfirmUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -23,12 +23,12 @@
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.ConfirmUIHandler;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
-import org.codelutin.vcs.ui.util.AbstractShowUIAction;
+import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowConfirmUIAction extends AbstractShowUIAction<ConfirmUIModel, ConfirmUI, ConfirmUIHandler, DialogUIHandler<?, ?>> {
+public class ShowConfirmUIAction extends AbstractVCSShowUIAction<ConfirmUIModel, ConfirmUI, ConfirmUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowDiffUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowDiffUIAction.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowDiffUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -22,12 +22,12 @@
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.DiffUIHandler;
import org.codelutin.vcs.ui.model.DiffUIModel;
-import org.codelutin.vcs.ui.util.AbstractShowUIAction;
+import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowDiffUIAction extends AbstractShowUIAction<DiffUIModel, DiffUI, DiffUIHandler, DialogUIHandler<?, ?>> {
+public class ShowDiffUIAction extends AbstractVCSShowUIAction<DiffUIModel, DiffUI, DiffUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowIdentityUIAction.java (from rev 613, 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/ShowIdentityUIAction.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowIdentityUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,62 @@
+/**
+ * # #% 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.action;
+
+import org.codelutin.ui.DialogUIHandler;
+import org.codelutin.ui.ShowUIAction;
+import org.codelutin.vcs.ui.IdentityUI;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import org.codelutin.vcs.ui.handler.IdentityUIHandler;
+import org.codelutin.vcs.ui.model.IdentityUIModel;
+
+import java.awt.event.ActionEvent;
+import java.io.Serializable;
+
+/** @author chemit */
+public class ShowIdentityUIAction extends ShowUIAction<IdentityUIModel, IdentityUI, IdentityUIHandler, DialogUIHandler<?, ?>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Serializable src;
+
+ public Serializable getSrc() {
+ return src;
+ }
+
+ public void setSrc(Serializable src) {
+ this.src = src;
+ }
+
+ public ShowIdentityUIAction(org.codelutin.ui.DialogUI ui, boolean showText) {
+ super(ui, VCSUIFactory.IDENTITY_UI, VCSUIFactory.getInstance(), showText);
+ }
+
+ @Override
+ protected IdentityUI initUI(ActionEvent e) {
+ IdentityUI ui = getFactory().getUI(uiDef);
+ ui.getHandler().getModel().populate(src);
+ ui.pack();
+ return ui;
+ }
+
+
+ @Override
+ protected void checkInit() throws IllegalStateException {
+ super.checkInit();
+ if (src == null) {
+ throw new IllegalStateException("no src object found for action " + this);
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowSynchUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowSynchUIAction.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowSynchUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -22,12 +22,12 @@
import org.codelutin.vcs.ui.VCSUIFactory;
import org.codelutin.vcs.ui.handler.SynchUIHandler;
import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.ui.util.AbstractShowUIAction;
+import org.codelutin.vcs.ui.util.AbstractVCSShowUIAction;
import java.awt.event.ActionEvent;
/** @author chemit */
-public class ShowSynchUIAction extends AbstractShowUIAction<SynchUIModel, SynchUI, SynchUIHandler, DialogUIHandler<?,?>> {
+public class ShowSynchUIAction extends AbstractVCSShowUIAction<SynchUIModel, SynchUI, SynchUIHandler, DialogUIHandler<?, ?>> {
private static final long serialVersionUID = 1L;
@@ -62,7 +62,7 @@
SynchUI ui = super.initUI(e);
ui.getHandler().getModel().populate(getLocation(), entries);
ui.getContentScroll().setEnabled(entries.length > 1);
- ((AbstractShowUIAction) ui.getConfig().getAction()).setConfig(ui.getHandler().getConfig());
+ ((AbstractVCSShowUIAction) ui.getConfig().getAction()).setConfig(ui.getHandler().getConfig());
return ui;
}
}
\ No newline at end of file
Added: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowTestUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowTestUIAction.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowTestUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,59 @@
+/**
+ * # #% 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.action;
+
+import org.codelutin.ui.DialogUIHandler;
+import org.codelutin.vcs.ui.TestUI;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import org.codelutin.vcs.ui.handler.TestUIHandler;
+import org.codelutin.vcs.ui.model.TestUIModel;
+import org.codelutin.vcs.ui.util.AbstractShowUIAction;
+
+import java.awt.event.ActionEvent;
+
+/** @author chemit */
+public class ShowTestUIAction extends AbstractShowUIAction<TestUIModel, TestUI, TestUIHandler, DialogUIHandler<?, ?>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected transient TestUIModel model;
+
+ protected boolean firstTime;
+
+ public ShowTestUIAction(org.codelutin.ui.DialogUI ui, boolean showText) {
+ super(ui, VCSUIFactory.TEST_UI, showText);
+ }
+
+ public void setModel(TestUIModel model, boolean firstTime) {
+ this.model = model;
+ this.firstTime = firstTime;
+ }
+
+ @Override
+ protected TestUI initUI(ActionEvent e) {
+ TestUI ui = super.initUI(e);
+ ui.getHandler().getModel().init(model, firstTime);
+ ui.pack();
+ return ui;
+ }
+
+ @Override
+ protected void checkInit() throws IllegalStateException {
+ super.checkInit();
+ if (model == null) {
+ throw new IllegalStateException("no model object found for action " + this);
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -60,14 +60,14 @@
// take all entries
entries = model.filter(VCSAction.CHANGELOG, model.getEntries());
}
- UIActionHelper.showChangelogUI(config, ui, location, entries.toArray(new VCSEntry[entries.size()]));
+ UIActionHelper.showChangelogUI(config, ui, location, entries.toArray(new VCSEntry[entries.size()]),null);
return;
case DIFF:
if (!useSelection) {
// take all entries
entries = model.filter(VCSAction.DIFF, model.getEntries());
}
- UIActionHelper.showDiffUI(config, ui, location, entries.toArray(new VCSEntry[entries.size()]));
+ UIActionHelper.showDiffUI(config, ui, location, entries.toArray(new VCSEntry[entries.size()]),null);
return;
case REFRESH:
handler.doRefresh(model, entries, handler.getSelectionModel());
@@ -79,7 +79,7 @@
case DELETE:
case REVERT:
case UPDATE:
- UIActionHelper.showConfirmUI(config, ui, location, action, entries.toArray(new VCSEntry[entries.size()]));
+ UIActionHelper.showConfirmUI(config, ui, location, action, entries.toArray(new VCSEntry[entries.size()]),null);
return;
}
throw new IllegalStateException("could not perform action for action " + action + " (" + this + ')');
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:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TestConnexionAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -33,7 +33,7 @@
private static final long serialVersionUID = 1L;
public TestConnexionAction(org.codelutin.vcs.ui.ConfigUI ui) {
- super(null, org.codelutin.ui.UIHelper.createActionIcon("test"), 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);
//putValue(MNEMONIC_KEY, (int) (action.getLibelle()).charAt(0));
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:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -18,7 +18,13 @@
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.*;
+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.model.ConfigUIModel;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
@@ -51,8 +57,7 @@
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());
- //getUi().pack();
+ connexionPanel.add(ui.getSshPanel(), VCSConnexionMode.SSH.name());
}
public void propertyChange(PropertyChangeEvent evt) {
@@ -98,13 +103,6 @@
// compute modifed
setModified(element, ui);
}
- // validate firstname + lastname + email (only if required)
- if (getModel().isShowIdentity()) {
- checkData(ui.getFirstname(), firstname);
- checkData(ui.getLastname(), lastname);
- checkData(ui.getEmail(), email);
- }
-
switch (getModel().getMode()) {
case ANONYMOUS:
// nothing to validate
@@ -141,15 +139,6 @@
case connexion:
modify = model.getMode() != model.getConfig().getMode();
break;
- case email:
- modify = !model.getEmail().equals(value);
- break;
- case firstname:
- modify = !model.getFirstname().equals(value);
- break;
- case lastname:
- modify = !model.getLasttname().equals(value);
- break;
case login:
modify = !model.getConfig().getUserName().equals(value);
break;
@@ -225,13 +214,6 @@
ui.getPassphrase().setText(config.getPassphrase() == null ? "" : config.getPassphrase());
break;
}
- boolean showIdenty = model.isShowIdentity();
- ui.getIdentityScroll().setVisible(showIdenty);
- if (showIdenty) {
- getUi().getFirstname().setText(model.getFirstname());
- getUi().getLastname().setText(model.getLasttname());
- getUi().getEmail().setText(model.getEmail());
- }
ui.getTestConnection().setEnabled(true);
}
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/IdentityUIHandler.java (from rev 615, 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/IdentityUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/IdentityUIHandler.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,163 @@
+/**
+ * ##% 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.ui.DialogUIHandler;
+import org.codelutin.vcs.ui.IdentityUI;
+import static org.codelutin.vcs.ui.IdentityUI.Element;
+import static org.codelutin.vcs.ui.IdentityUI.Element.email;
+import static org.codelutin.vcs.ui.IdentityUI.Element.firstname;
+import static org.codelutin.vcs.ui.IdentityUI.Element.lastname;
+import static org.codelutin.vcs.ui.IdentityUI.Element.values;
+import org.codelutin.vcs.ui.model.IdentityUIModel;
+
+import javax.swing.JComponent;
+import javax.swing.text.JTextComponent;
+import java.awt.Color;
+import java.beans.PropertyChangeEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public class IdentityUIHandler extends DialogUIHandler<IdentityUIModel, IdentityUI> {
+
+ protected List<Element> errors;
+
+
+ public IdentityUIHandler(IdentityUI ui) {
+ super(ui, new IdentityUIModel());
+ ui.setHandler(this);
+ errors = new ArrayList<Element>();
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (IdentityUIModel.CONFIG_PROPERTY_CHANGED.equals(action)) {
+ // update ui with model values,
+ populateUI((IdentityUIModel) evt.getNewValue());
+ doCheck(null);
+ return;
+ }
+
+ if (IdentityUIModel.MODIFIED_PROPERTY_CHANGED.equals(action)) {
+ Boolean newValue = (Boolean) evt.getNewValue();
+ boolean modified = newValue != null && newValue;
+ getUi().getReset().setEnabled(modified);
+ return;
+ }
+ throw new IllegalStateException("unimplemented property changed : " + evt + " for " + this);
+ }
+
+ public synchronized List<Element> validateModel(Element element) {
+ errors.clear();
+ IdentityUI ui = getUi();
+ if (element != null) {
+ // compute modifed
+ setModified(element, ui);
+ }
+ checkData(ui.getFirstname(), firstname);
+ checkData(ui.getLastname(), lastname);
+ checkData(ui.getEmail(), email);
+
+ return errors;
+ }
+
+ public void setModified(Element element, IdentityUI ui) {
+ boolean modify = false;
+ IdentityUIModel model = getModel();
+
+ String value = ui.getElementValue(element);
+
+ switch (element) {
+ case email:
+ modify = !model.getEmail().equals(value);
+ break;
+ case firstname:
+ modify = !model.getFirstname().equals(value);
+ break;
+ case lastname:
+ modify = !model.getLastname().equals(value);
+ break;
+ }
+ if (modify) {
+ model.addModified(element);
+ } else if (model.getModifieds().contains(element)) {
+ model.removeModified(element);
+ }
+ }
+
+ public void doCheck(Element element) {
+ List<Element> errors = validateModel(element);
+ updateUI(errors);
+ }
+
+ public boolean isConfigValid() {
+ return errors.isEmpty();
+ }
+
+ public void reset() {
+ getModel().reset();
+ }
+
+ protected void populateUI(IdentityUIModel model) {
+ IdentityUI ui = getUi();
+ ui.getFirstname().setText(model.getFirstname());
+ ui.getLastname().setText(model.getLastname());
+ ui.getEmail().setText(model.getEmail());
+ }
+
+ protected void updateUI(List<Element> errors) {
+ IdentityUI ui = getUi();
+ boolean valid = isConfigValid();
+ ui.getOk().setEnabled(valid && getModel().isModified());
+ 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
Added: 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 (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,74 @@
+/**
+ * ##% 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.ui.DialogUIDef;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.TestUI;
+import org.codelutin.vcs.ui.UIActionHelper;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import org.codelutin.vcs.ui.model.TestUIModel;
+
+import javax.swing.AbstractButton;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class TestUIHandler extends org.codelutin.ui.DialogUIHandler<TestUIModel, TestUI> {
+
+ public TestUIHandler(TestUI ui) {
+ super(ui, new TestUIModel());
+ ui.setHandler(this);
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ // push icon and text in actions
+ initAction(VCSUIFactory.IDENTITY_UI, getUi().getShowFirstLaunch());
+ initAction(VCSUIFactory.CONFIG_UI, getUi().getShowConfig());
+ initAction(VCSUIFactory.SYNCH_UI, getUi().getShowSynch());
+ }
+
+ protected void initAction(DialogUIDef uiDef, AbstractButton button) {
+ button.setText(uiDef.getShowActionLibelle());
+ button.setToolTipText(uiDef.getShowActionTip());
+ button.setIcon(uiDef.getShowUIActionIcon());
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getPropertyName().equals(TestUIModel.PREPARE_UI_PROPERTY_CHANGED)) {
+ return;
+ }
+ if (evt.getPropertyName().equals(TestUIModel.SHOW_UI_PROPERTY_CHANGED)) {
+ DialogUIDef uiDef = (DialogUIDef) evt.getNewValue();
+ // show ui
+ if (uiDef == VCSUIFactory.IDENTITY_UI) {
+ UIActionHelper.showIdentityUI(getModel().getIdentity(), getUi(), "bottom-left");
+ return;
+ }
+ if (uiDef == VCSUIFactory.CONFIG_UI) {
+ UIActionHelper.showConfigUI(getModel().getConnexion().getConfig(), getUi(), "bottom-left");
+ return;
+ }
+ if (uiDef == VCSUIFactory.SYNCH_UI) {
+ UIActionHelper.showSynchUI(getModel().getConnexion().getConfig(), getUi(), VCSEntryLocation.ALL, getModel().getEntries(), "bottom-left");
+ return;
+ }
+ return;
+ }
+
+ throw new IllegalStateException("unknown property changed " + evt);
+ }
+}
\ No newline at end of file
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:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -38,49 +38,29 @@
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 IDENTITY_PROPERTY_CHANGED = "identity";
-
public static final String MODIFIED_PROPERTY_CHANGED = "modify";
- private boolean showIdentity;
-
- private String firstname;
- private String lasttname;
- private String email;
- private VCSConnexionMode mode;
-
+ protected VCSConnexionMode mode;
protected List<Element> modifieds;
protected VCSConnexionConfig config;
-
protected Boolean connexionState;
public ConfigUIModel() {
modifieds = new ArrayList<Element>();
}
- public void populate(VCSConnexionConfig config, boolean showIdentify, String firstname, String lastname, String email) {
+ public void populate(VCSConnexionConfig config) {
this.config = config;
- this.firstname = firstname;
- this.lasttname = lastname;
- this.email = email;
- this.showIdentity = showIdentify;
setConnexionMode(config.getMode());
setModified(false);
firePropertyChange(CONFIG_PROPERTY_CHANGED, null, this);
}
- public void populate(VCSConnexionConfig config) {
- populate(config, false, null, null, null);
- }
-
public void reset() {
checkConnexionInit();
- populate(config, showIdentity, firstname, lasttname, email);
+ populate(config);
}
public void setConnexionMode(VCSConnexionMode mode) {
@@ -108,22 +88,6 @@
setConnexionState(null);
}
- public String getEmail() {
- return email;
- }
-
- public String getFirstname() {
- return firstname;
- }
-
- public String getLasttname() {
- return lasttname;
- }
-
- public boolean isShowIdentity() {
- return showIdentity;
- }
-
public boolean isModified() {
return !modifieds.isEmpty();
}
@@ -149,7 +113,7 @@
public void addModified(Element elementname) {
if (!modifieds.contains(elementname)) {
modifieds.add(elementname);
- }
+ }
setModified(!modifieds.isEmpty());
}
@@ -176,12 +140,6 @@
case connexion:
config.setConnexionMode(mode);
break;
- case email:
- break;
- case firstname:
- break;
- case lastname:
- break;
case login:
if (mode != VCSConnexionMode.ANONYMOUS) {
config.setUserName(value);
@@ -218,7 +176,7 @@
public void setConnexionState(Boolean connexionState) {
Boolean oldConnexionState = this.connexionState;
- this.connexionState = 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/IdentityUIModel.java (from rev 615, 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/IdentityUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/IdentityUIModel.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,142 @@
+/**
+ * ##% 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.apache.commons.beanutils.BeanUtils;
+import org.codelutin.ui.DialogUIModel;
+import org.codelutin.vcs.ui.IdentityUI.Element;
+
+import java.lang.reflect.InvocationTargetException;
+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 IdentityUIModel extends DialogUIModel {
+
+ public static final String CONFIG_PROPERTY_CHANGED = "config";
+ public static final String MODIFIED_PROPERTY_CHANGED = "modify";
+
+ protected Object src;
+ protected String firstname;
+ protected String lastname;
+ protected String email;
+
+ protected List<Element> modifieds;
+
+ public IdentityUIModel() {
+ modifieds = new ArrayList<Element>();
+ }
+
+ public void populate(Object src) {
+ this.src = src;
+
+ for (Element o : Element.values()) {
+ try {
+ String value = BeanUtils.getProperty(src, o.name());
+ BeanUtils.setProperty(this, o.name(), value);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ } catch (InvocationTargetException e) {
+ throw new IllegalStateException(e);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ setModified(false);
+ firePropertyChange(CONFIG_PROPERTY_CHANGED, null, this);
+ }
+
+ public void reset() {
+ populate(src);
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public boolean isModified() {
+ return !modifieds.isEmpty();
+ }
+
+ public List<Element> getModifieds() {
+ return modifieds;
+ }
+
+ 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) {
+ switch (element) {
+ case email:
+ case firstname:
+ case lastname:
+ try {
+ BeanUtils.setProperty(src, element.name(), value);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ } catch (InvocationTargetException e) {
+ throw new IllegalStateException(e);
+ }
+ break;
+ }
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/TestUIModel.java (from rev 609, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ChangelogUIModel.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/TestUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/TestUIModel.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,81 @@
+/**
+ * ##% 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.ui.DialogUIDef;
+import org.codelutin.vcs.VCSConnexion;
+import org.codelutin.vcs.VCSEntry;
+
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class TestUIModel extends org.codelutin.ui.DialogUIModel {
+
+ public static final String PREPARE_UI_PROPERTY_CHANGED = "prepareui";
+ public static final String SHOW_UI_PROPERTY_CHANGED = "showui";
+
+ protected VCSConnexion connexion;
+ protected Serializable identity;
+ private VCSEntry[] entries;
+
+ public void setUIDef(DialogUIDef uiDef) {
+ // prepare model
+ firePropertyChange(PREPARE_UI_PROPERTY_CHANGED, this, uiDef);
+
+ // display model
+ firePropertyChange(SHOW_UI_PROPERTY_CHANGED, this, uiDef);
+ }
+
+ public VCSConnexion getConnexion() {
+ return connexion;
+ }
+
+ public Serializable getIdentity() {
+ return identity;
+ }
+
+ public VCSEntry[] getEntries() {
+ return entries;
+ }
+
+ public void setConnexion(VCSConnexion connexion) {
+ this.connexion = connexion;
+ }
+
+ public void setEntries(VCSEntry[] entries) {
+ this.entries = entries;
+ }
+
+ public void setIdentity(Serializable identity) {
+ this.identity = identity;
+ }
+
+ public void init(TestUIModel model, boolean firstTime) {
+ connexion = model.getConnexion();
+ entries = model.getEntries();
+ identity = model.getIdentity();
+ if (firstTime) {
+ // propagate incoming model listeners to ui model
+ for (PropertyChangeListener listener : model.getPropertyChangeListeners()) {
+ addPropertyChangeListener(listener);
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractShowUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractShowUIAction.java 2008-04-27 08:27:31 UTC (rev 626)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractShowUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -19,7 +19,6 @@
import org.codelutin.ui.DialogUIHandler;
import org.codelutin.ui.DialogUIModel;
import org.codelutin.ui.ShowUIAction;
-import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.ui.VCSUIFactory;
import java.awt.event.ActionEvent;
@@ -27,31 +26,14 @@
/** @author chemit */
public abstract class AbstractShowUIAction<M extends DialogUIModel, U extends DialogUI<H>, H extends DialogUIHandler<M, U>, HH extends DialogUIHandler<?, ?>> extends ShowUIAction<M, U, H, HH> {
- protected transient VCSConnexionConfig config;
-
private static final long serialVersionUID = 1L;
public <UU extends DialogUI<HH>> AbstractShowUIAction(UU ui, DialogUIDef<M, U, H> uiDef, boolean showText) {
super(ui, uiDef, VCSUIFactory.getInstance(), showText);
}
- public VCSConnexionConfig getConfig() {
- return config;
- }
-
- public void setConfig(VCSConnexionConfig config) {
- this.config = config;
- }
-
protected U initUI(ActionEvent e) {
- return getFactory().getUI(uiDef, config);
+ return getFactory().getUI(uiDef);
}
- @Override
- protected void checkInit() throws IllegalStateException {
- super.checkInit();
- if (config == null) {
- throw new IllegalStateException("no config found in " + this);
- }
- }
}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractVCSShowUIAction.java (from rev 615, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractShowUIAction.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractVCSShowUIAction.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractVCSShowUIAction.java 2008-04-27 08:28:06 UTC (rev 627)
@@ -0,0 +1,57 @@
+/**
+ * # #% 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.util;
+
+import org.codelutin.ui.DialogUI;
+import org.codelutin.ui.DialogUIDef;
+import org.codelutin.ui.DialogUIHandler;
+import org.codelutin.ui.DialogUIModel;
+import org.codelutin.ui.ShowUIAction;
+import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.ui.VCSUIFactory;
+
+import java.awt.event.ActionEvent;
+
+/** @author chemit */
+public abstract class AbstractVCSShowUIAction<M extends DialogUIModel, U extends DialogUI<H>, H extends DialogUIHandler<M, U>, HH extends DialogUIHandler<?, ?>> extends ShowUIAction<M, U, H, HH> {
+
+ protected transient VCSConnexionConfig config;
+
+ private static final long serialVersionUID = 1L;
+
+ public <UU extends DialogUI<HH>> AbstractVCSShowUIAction(UU ui, DialogUIDef<M, U, H> uiDef, boolean showText) {
+ super(ui, uiDef, VCSUIFactory.getInstance(), showText);
+ }
+
+ public VCSConnexionConfig getConfig() {
+ return config;
+ }
+
+ public void setConfig(VCSConnexionConfig config) {
+ this.config = config;
+ }
+
+ protected U initUI(ActionEvent e) {
+ return getFactory().getUI(uiDef, config);
+ }
+
+ @Override
+ protected void checkInit() throws IllegalStateException {
+ super.checkInit();
+ if (config == null) {
+ throw new IllegalStateException("no config found in " + this);
+ }
+ }
+}
\ No newline at end of file
1
0
[Buix-commits] r626 - in trunk/lutinvcs/ui/jaxx/src/main/resources: i18n 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:27:31 +0000 (Sun, 27 Apr 2008)
New Revision: 626
Added:
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-deleteroot.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-editroot.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-identityui.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootui.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-testui.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-testconnexion.png
Modified:
trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-en_GB.properties
trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-fr_FR.properties
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
Modified: trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-en_GB.properties
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-en_GB.properties 2008-04-27 08:27:04 UTC (rev 625)
+++ trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-en_GB.properties 2008-04-27 08:27:31 UTC (rev 626)
@@ -6,7 +6,6 @@
lutinvcs.config.email=
lutinvcs.config.firstname=
lutinvcs.config.generate=Generate
-lutinvcs.config.identiy=
lutinvcs.config.lastname=
lutinvcs.config.message=
lutinvcs.config.pass=
@@ -22,5 +21,6 @@
lutinvcs.config.server.ssh.publicKeyFile=
lutinvcs.config.ssh=
lutinvcs.generateSshKey.message=Generate
+lutinvcs.identity.message=
lutinvcs.no.config=
lutinvcs.reset=
Modified: trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-fr_FR.properties
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-fr_FR.properties 2008-04-27 08:27:04 UTC (rev 625)
+++ trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-fr_FR.properties 2008-04-27 08:27:31 UTC (rev 626)
@@ -6,7 +6,6 @@
lutinvcs.config.email=Courriel
lutinvcs.config.firstname=Pr\u00E9nom
lutinvcs.config.generate=G\u00E9n\u00E9rer
-lutinvcs.config.identiy=Identit\u00E9
lutinvcs.config.lastname=Nom
lutinvcs.config.message=Configuration de la connexion
lutinvcs.config.pass=password
@@ -22,5 +21,6 @@
lutinvcs.config.server.ssh.publicKeyFile=clef publique
lutinvcs.config.ssh=ssh
lutinvcs.generateSshKey.message=G\u00E9n\u00E9rer
-lutinvcs.no.config=< Pas de configuration >
+lutinvcs.identity.message=Configuration de votre identit\u00E9
+lutinvcs.no.config=<Pas de configuration>
lutinvcs.reset=R\u00E9initialiser
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-deleteroot.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-deleteroot.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-editroot.png (from rev 609, trunk/lutinvcs/ui/jaxx/src/main/resources/icons/server.png)
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-editroot.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-identityui.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-identityui.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootui.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootui.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-testui.png (from rev 609, trunk/lutinvcs/ui/jaxx/src/main/resources/icons/actionSelect.png)
===================================================================
(Binary files differ)
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-testconnexion.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-testconnexion.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
[Buix-commits] r625 - 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:27:04 +0000 (Sun, 27 Apr 2008)
New Revision: 625
Added:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxIdentityUI.jaxx
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/test.css
Modified:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css
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
Modified: 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:25:42 UTC (rev 624)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx 2008-04-27 08:27:04 UTC (rev 625)
@@ -68,17 +68,19 @@
</Table>
</java.awt.CardLayout>
- <JToolBar id='top'>
+ <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='30'>
+ <JToolBar id='connexionHead' opaque='false' height='26'>
<JLabel id='connexionModeLabel'/>
<JRadioButton id='connexionModeAnonymous' onActionPerformed="changeAutheticationMode(ANONYMOUS)"/>
<JRadioButton id='connexionModePassword' onActionPerformed="changeAutheticationMode(PASSWORD)"/>
@@ -90,13 +92,8 @@
</Table>
<JButton id='generateKey' icon='{createActionIcon("generatekey")}' onActionPerformed="generateKey()"
borderPainted='false'/>
- <JButton id='reset' onActionPerformed="reset()" icon='{createActionIcon("revert")}' borderPainted='false'/>
- <JButton id='testConnection' action='{newAction(TestConnexionAction.class)}' borderPainted='false'/>
</JToolBar>
-
- <JToolBar id='identityHead' opaque='false'>
- <JLabel id='identityLabel'/>
- </JToolBar>
+
<Table fill='both' insets="1,1,1,1">
<row fill='horizontal'>
<cell columns='2'>
@@ -107,34 +104,13 @@
</row>
<row fill='horizontal'>
<cell columns="2" fill='both'>
- <JScrollPane columnHeaderView='{identityHead}' styleClass='connexionScroll' id='identityScroll'>
- <Table id="identityContent">
- <row fill='horizontal'>
- <cell>
- <JLabel id='firstnameLabel'/>
- </cell>
- <cell>
- <JTextField id='firstname' onKeyReleased="doCheck(Element.firstname)"/>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell>
- <JLabel id='lastnameLabel'/>
- </cell>
- <cell>
- <JTextField id='lastname' onKeyReleased="doCheck(Element.lastname)"/>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell>
- <JLabel id='emailLabel'/>
- </cell>
- <cell>
- <JTextField id='email' onKeyReleased="doCheck(Element.email)"/>
- </cell>
- </row>
- </Table>
- </JScrollPane>
+ <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'>
Copied: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxIdentityUI.jaxx (from rev 613, trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx)
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxIdentityUI.jaxx (rev 0)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxIdentityUI.jaxx 2008-04-27 08:27:04 UTC (rev 625)
@@ -0,0 +1,56 @@
+<IdentityUI modal='true' resizable='false'>
+ <style source="config.css"/>
+ <JToolBar id='identityHead' opaque='false'>
+ <JLabel text='lutinvcs.identity.message'/>
+ <Table fill='both' insets='0,0,0,0'>
+ <row>
+ <cell fill='both'/>
+ </row>
+ </Table>
+ <JButton id='reset' icon='{org.codelutin.ui.UIHelper.createActionIcon("revert")}' onActionPerformed="reset()" borderPainted='false'/>
+ <JButton id='help' action='{newAction(org.codelutin.vcs.ui.action.HelpAction.class)}' borderPainted='false'/>
+ </JToolBar>
+ <Table fill='both' insets="1,1,1,1">
+ <row fill='horizontal'>
+ <cell columns="2" fill='both'>
+ <JScrollPane columnHeaderView='{identityHead}' styleClass='connexionScroll'>
+ <Table>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='firstnameLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='firstname' onKeyReleased="doCheck(Element.firstname)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='lastnameLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='lastname' onKeyReleased="doCheck(Element.lastname)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='emailLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='email' onKeyReleased="doCheck(Element.email)"/>
+ </cell>
+ </row>
+ </Table>
+ </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>
+
+</IdentityUI>
Added: 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 (rev 0)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx 2008-04-27 08:27:04 UTC (rev 625)
@@ -0,0 +1,15 @@
+<TestUI resizable='false'>
+ <style source="test.css"/>
+ <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='showSynch' onActionPerformed="showUI(SYNCH_UI)"/>
+ <Table fill='both' insets='0,0,0,0'>
+ <row>
+ <cell fill='both'/>
+ </row>
+ </Table>
+ <JButton id='help' action='{newAction(org.codelutin.vcs.ui.action.HelpAction.class)}'/>
+ </JToolBar>
+</TestUI>
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:25:42 UTC (rev 624)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java 2008-04-27 08:27:04 UTC (rev 625)
@@ -24,6 +24,8 @@
JaxxChangelogUI.class,
JaxxConfirmUI.class,
JaxxConfigUI.class,
- JaxxGenerateSshKeyUI.class);
+ JaxxGenerateSshKeyUI.class,
+ JaxxIdentityUI.class,
+ JaxxTestUI.class);
}
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css 2008-04-27 08:25:42 UTC (rev 624)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css 2008-04-27 08:27:04 UTC (rev 625)
@@ -31,7 +31,9 @@
#emailLabel {
text: "lutinvcs.config.email";
}
-
+#rootLabel{
+ text: "lutinvcs.config.choose.root";
+}
#connexionModeLabel {
text: "lutinvcs.config.server.authenticationMethod";
}
Copied: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/test.css (from rev 613, trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css)
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/test.css (rev 0)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/test.css 2008-04-27 08:27:04 UTC (rev 625)
@@ -0,0 +1,11 @@
+JToolBar {
+ floatable: false;
+ focusable: false;
+ margin: 0;
+}
+
+JButton {
+ margin: 0; /*font-size:10;*/
+ borderPainted: false;
+ opaque: false;
+}
1
0
[Buix-commits] r624 - trunk/lutinui/src/main/java/org/codelutin/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:25:42 +0000 (Sun, 27 Apr 2008)
New Revision: 624
Added:
trunk/lutinui/src/main/java/org/codelutin/ui/FormElement.java
Log:
debut d'un element de formulaire d'ui
Added: trunk/lutinui/src/main/java/org/codelutin/ui/FormElement.java
===================================================================
--- trunk/lutinui/src/main/java/org/codelutin/ui/FormElement.java (rev 0)
+++ trunk/lutinui/src/main/java/org/codelutin/ui/FormElement.java 2008-04-27 08:25:42 UTC (rev 624)
@@ -0,0 +1,29 @@
+/**
+ * # #% 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.ui;
+
+/** @author chemit */
+public interface FormElement<U extends DialogUI> {
+
+ String name();
+
+ int ordinal();
+
+ Object getValue(U ui);
+
+ void setValue(U ui, String value);
+
+ javax.swing.JLabel getLabel(U ui);
+}
1
0