Buix-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
May 2008
- 1 participants
- 36 discussions
r682 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . util/ui
by tchemit@users.labs.libre-entreprise.org 26 May '08
by tchemit@users.labs.libre-entreprise.org 26 May '08
26 May '08
Author: tchemit
Date: 2008-05-26 09:43:05 +0000 (Mon, 26 May 2008)
New Revision: 682
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java
Log:
VCSThreadListener must be add when ui is activated (for synchUI),
now in common class AbstractTabUI
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java 2008-05-26 07:43:57 UTC (rev 681)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java 2008-05-26 09:43:05 UTC (rev 682)
@@ -19,7 +19,6 @@
import javax.swing.AbstractButton;
import javax.swing.JPopupMenu;
-import java.awt.event.WindowEvent;
/** @author chemit */
public abstract class SynchUI extends AbstractTabUI<SynchUIHandler> {
@@ -54,19 +53,24 @@
public abstract JPopupMenu getPopup();
- @Override
+ /*@Override
public void windowOpened(WindowEvent e) {
- if (getHandler().isUseThreadListener()) {
- // add action manager listener
- getHandler().getActionManager().addVCSActionThreadEventListener(getHandler());
- }
+ addVCSActionThreadEventListener();
}
@Override
public void windowClosed(WindowEvent e) {
- if (getHandler().isUseThreadListener()) {
- // remove action manager listener
- getHandler().getActionManager().removeVCSActionThreadEventListener(getHandler());
- }
+ removeVCSActionThreadEventListener();
}
+
+ @Override
+ public synchronized void windowActivated(WindowEvent e) {
+ addVCSActionThreadEventListener();
+ super.windowActivated(e);
+ }
+
+ @Override
+ public synchronized void windowDeactivated(WindowEvent e) {
+ removeVCSActionThreadEventListener();
+ } */
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java 2008-05-26 07:43:57 UTC (rev 681)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java 2008-05-26 09:43:05 UTC (rev 682)
@@ -17,7 +17,6 @@
import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
import javax.swing.AbstractButton;
-import java.awt.event.WindowEvent;
/** @author chemit */
public abstract class AbstractTabOneFileUI<H extends AbstractTabOneFileUIHandler<?, ?>> extends AbstractTabUI<H> {
@@ -26,24 +25,4 @@
public abstract AbstractButton getPreviousFile();
- protected boolean hasListener;
-
- @Override
- public synchronized void windowActivated(WindowEvent e) {
- if (!hasListener && getHandler().isUseThreadListener()) {
- // add action manager listener
- getHandler().getActionManager().addVCSActionThreadEventListener(getHandler());
- hasListener = true;
- }
- super.windowActivated(e);
- }
-
- @Override
- public synchronized void windowDeactivated(WindowEvent e) {
- if (!isVisible() && getHandler().isUseThreadListener() && hasListener) {
- // remove action manager listener
- getHandler().getActionManager().removeVCSActionThreadEventListener(getHandler());
- hasListener = false;
- }
- }
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java 2008-05-26 07:43:57 UTC (rev 681)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java 2008-05-26 09:43:05 UTC (rev 682)
@@ -19,10 +19,13 @@
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
+import java.awt.event.WindowEvent;
/** @author chemit */
public abstract class AbstractTabUI<H extends AbstractTabUIHandler<?, ?>> extends AbstractBasicUI<H> {
+ protected boolean hasListener;
+
public abstract ButtonGroup getTabs();
public abstract AbstractButton getAllTab();
@@ -72,4 +75,33 @@
throw new IllegalStateException("no button found for " + modelName);
}
+ @Override
+ public synchronized void windowActivated(WindowEvent e) {
+ addVCSActionThreadEventListener();
+ super.windowActivated(e);
+ }
+
+ @Override
+ public synchronized void windowDeactivated(WindowEvent e) {
+ removeVCSActionThreadEventListener();
+ super.windowDeactivated(e);
+ }
+
+ public void addVCSActionThreadEventListener() {
+ if (!hasListener && getHandler().isUseThreadListener()) {
+ // add action manager listener
+ getHandler().getActionManager().addVCSActionThreadEventListener(getHandler());
+ hasListener = true;
+ }
+ }
+
+ public void removeVCSActionThreadEventListener() {
+ // remove listener only if no more visible and has a preivous listener registered
+ if (!isVisible() && hasListener && getHandler().isUseThreadListener()) {
+ // remove action manager listener
+ getHandler().getActionManager().removeVCSActionThreadEventListener(getHandler());
+ hasListener = false;
+ }
+ }
+
}
1
0
r681 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . handler
by tchemit@users.labs.libre-entreprise.org 26 May '08
by tchemit@users.labs.libre-entreprise.org 26 May '08
26 May '08
Author: tchemit
Date: 2008-05-26 07:43:57 +0000 (Mon, 26 May 2008)
New Revision: 681
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
Log:
improve rootConfig modification state
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-26 07:43:24 UTC (rev 680)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-26 07:43:57 UTC (rev 681)
@@ -139,9 +139,12 @@
}
private void afterRootChanged() {
+ String rootName = (String) getRootConfig().getSelectedItem();
getHandler().getModel().setRoots(VCSConfigFactory.getInstance().getRoots());
VCSConnexionConfig current = getHandler().getModel().getCurrent();
VCSRootConfig root = current.getRootConfig();
+ boolean wasModified = getHandler().getModel().getModifieds().contains(VCSConnexionConfigProperty.rootConfig);
+
if (root!=null) {
// check root always exists
if (!VCSConfigFactory.containsRoot(root.getRootName())) {
@@ -153,7 +156,12 @@
} else {
getHandler().populateRoots(false);
}
-
- doCheck(VCSConnexionConfigProperty.rootConfig);
+ if (rootName!=null) {
+ getRootConfig().setSelectedItem(rootName);
+ }
+ if (!wasModified) {
+ getHandler().getModel().removeModified(VCSConnexionConfigProperty.rootConfig);
+ }
+ //doCheck(VCSConnexionConfigProperty.rootConfig);
}
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-26 07:43:24 UTC (rev 680)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-26 07:43:57 UTC (rev 681)
@@ -162,6 +162,7 @@
}
ui.getTestConnection().setEnabled(true);
getUi().getRootsModel().setSelectedItem(config.getRootConfig().getRootName());
+ getModel().removeModified(VCSConnexionConfigProperty.rootConfig);
}
public void populateRoots(boolean addEmpty) {
1
0
r680 - trunk/lutinui/src/main/java/org/codelutin/ui/config
by tchemit@users.labs.libre-entreprise.org 26 May '08
by tchemit@users.labs.libre-entreprise.org 26 May '08
26 May '08
Author: tchemit
Date: 2008-05-26 07:43:24 +0000 (Mon, 26 May 2008)
New Revision: 680
Modified:
trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java
Log:
log
Modified: trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java
===================================================================
--- trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java 2008-05-25 15:41:34 UTC (rev 679)
+++ trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java 2008-05-26 07:43:24 UTC (rev 680)
@@ -103,7 +103,6 @@
return unvalids;
}
-
public boolean isModified() {
return !modifieds.isEmpty();
}
@@ -139,6 +138,7 @@
public void addModified(E key) {
if (!modifieds.contains(key)) {
modifieds.add(key);
+ log.debug(key);
}
setModified(!modifieds.isEmpty());
}
1
0
r679 - 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 25 May '08
by tchemit@users.labs.libre-entreprise.org 25 May '08
25 May '08
Author: tchemit
Date: 2008-05-25 15:41:34 +0000 (Sun, 25 May 2008)
New Revision: 679
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx
Log:
add RootConfig managment part II
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-25 15:41:34 UTC (rev 679)
@@ -19,6 +19,7 @@
import org.codelutin.util.FileUtil;
import org.codelutin.vcs.VCSConfigFactory;
import org.codelutin.vcs.VCSRootConfig;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.ui.handler.ConnexionConfigUIHandler;
@@ -51,7 +52,7 @@
public abstract AbstractButton getAddRoot();
- public abstract AbstractButton getDeleteRoot();
+ //public abstract AbstractButton getDeleteRoot();
public abstract AbstractButton getEditRoot();
@@ -91,7 +92,7 @@
public abstract JPanel getSshPanel();
- public abstract JComboBox getRootsList();
+ public abstract JComboBox getRootConfig();
protected void changeAutheticationMode(VCSConnexionMode mode) {
getHandler().getModel().setConnexionMode(mode);
@@ -123,19 +124,36 @@
}
protected void editRoot() {
- String rootName = (String) getRootsList().getSelectedItem();
+ String rootName = (String) getRootConfig().getSelectedItem();
VCSRootConfig config = VCSConfigFactory.getRoot(rootName);
UIActionHelper.showRootConfigUI(config, this, "bottom-left");
+ log.info("after edit root ");
+ afterRootChanged();
}
protected void addRoot() {
VCSRootConfig config = VCSConfigFactory.newRoot();
UIActionHelper.showRootConfigUI(config, this, "bottom-left");
- log.info("TODO " + this);
-
+ log.info("after add root ");
+ afterRootChanged();
}
- protected void deleteRoot() {
+ private void afterRootChanged() {
+ getHandler().getModel().setRoots(VCSConfigFactory.getInstance().getRoots());
+ VCSConnexionConfig current = getHandler().getModel().getCurrent();
+ VCSRootConfig root = current.getRootConfig();
+ if (root!=null) {
+ // check root always exists
+ if (!VCSConfigFactory.containsRoot(root.getRootName())) {
+ current.setRootConfig(null);
+ getHandler().populateRoots(true);
+ } else {
+ getHandler().populateRoots(false);
+ }
+ } else {
+ getHandler().populateRoots(false);
+ }
+
+ doCheck(VCSConnexionConfigProperty.rootConfig);
}
-
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java 2008-05-25 15:41:34 UTC (rev 679)
@@ -48,15 +48,26 @@
public abstract JComboBox getRootsList();
+ private Boolean noSelect;
+
+ public void setNoSelect(Boolean noSelect) {
+ this.noSelect = noSelect;
+ }
+
protected void addRoot() {
+ noSelect=true;
VCSRootConfig config = VCSConfigFactory.newRoot();
- getHandler().getModel().populate(config);
+ getHandler().getModel().populate(config);
+ noSelect=null;
}
protected void cloneRoot() {
+ noSelect=true;
String rootName = (String) getRootsList().getSelectedItem();
VCSRootConfig config =VCSConfigFactory.cloneRoot(rootName);
+
getHandler().getModel().populate(config);
+ noSelect=null;
}
protected void deleteRoot() {
@@ -65,4 +76,12 @@
getHandler().getModel().populate(null);
}
+ protected void selectRoot() {
+ String rootName = (String) getRootsList().getSelectedItem();
+ if (noSelect==null && rootName!=null && !rootName.trim().isEmpty() && VCSConfigFactory.containsRoot(rootName.trim())) {
+ VCSRootConfig config =VCSConfigFactory.getRoot(rootName);
+ getHandler().getModel().populate(config);
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java 2008-05-25 15:41:34 UTC (rev 679)
@@ -46,7 +46,9 @@
@Override
protected RootConfigUI initUI(ActionEvent e) {
RootConfigUI ui = super.initUI(e);
+ ui.setNoSelect(true);
ui.getHandler().getModel().populate(src);
+ ui.setNoSelect(null);
ui.pack();
return ui;
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-25 15:41:34 UTC (rev 679)
@@ -17,6 +17,7 @@
import org.codelutin.ui.config.DialogConfigUIHandler;
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSRootConfig;
+import org.codelutin.vcs.VCSConfigFactory;
import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import static org.codelutin.vcs.type.VCSConnexionConfigProperty.connexionMode;
import static org.codelutin.vcs.type.VCSConnexionConfigProperty.login;
@@ -130,17 +131,10 @@
}
@Override
- protected void populateUI() {
- // add roots
- DefaultComboBoxModel comboBoxModel = getUi().getRootsModel();
- comboBoxModel.removeAllElements();
- if (getModel().getSrc() == null) {
- // first root is an empty one
- comboBoxModel.addElement(" ");
- }
- for (VCSRootConfig type : getModel().getRoots()) {
- comboBoxModel.addElement(type.getRootName());
- }
+ public void populateUI() {
+
+ populateRoots(false);
+
super.populateUI();
ConnexionConfigUI ui = getUi();
@@ -170,7 +164,20 @@
getUi().getRootsModel().setSelectedItem(config.getRootConfig().getRootName());
}
+ public void populateRoots(boolean addEmpty) {
+ // add roots
+ DefaultComboBoxModel comboBoxModel = getUi().getRootsModel();
+ comboBoxModel.removeAllElements();
+ if (getModel().getSrc() == null || addEmpty) {
+ // first root is an empty one
+ comboBoxModel.addElement(" ");
+ }
+ for (VCSRootConfig type : getModel().getRoots()) {
+ comboBoxModel.addElement(type.getRootName());
+ }
+ }
+
@Override
protected boolean prepareSave() {
boolean b = super.prepareSave();
@@ -180,6 +187,11 @@
if (modifieds.contains(connexionMode)) {
current.setConnexionMode(getModel().getMode());
}
+ if (modifieds.contains(VCSConnexionConfigProperty.rootConfig)) {
+ String value = (String) getUi().getElementValue(VCSConnexionConfigProperty.rootConfig);
+ VCSRootConfig root = VCSConfigFactory.getRoot(value);
+ current.setRootConfig(root);
+ }
if (modifieds.contains(sshNoPassphrase)) {
boolean o = getModel().isNoSshPassPhrase();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java 2008-05-25 15:41:34 UTC (rev 679)
@@ -15,9 +15,9 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.ui.config.DialogConfigUIModel;
-import org.codelutin.vcs.VCSRootConfig;
import org.codelutin.vcs.VCSConfigFactory;
import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.VCSRootConfig;
import org.codelutin.vcs.type.VCSRootConfigProperty;
import org.codelutin.vcs.util.SimpleVCSRootConfig;
@@ -33,7 +33,7 @@
protected List<VCSRootConfig> roots;
protected List<String> types;
-
+
public RootConfigUIModel() {
super(VCSRootConfigProperty.class);
}
@@ -76,7 +76,10 @@
break;
case port:
- if (result) {
+ if (!result) {
+ // port is optional
+ result = true;
+ } else {
// must be an valid positive integer
try {
int port = Integer.valueOf(value + "");
@@ -95,4 +98,23 @@
}
return result;
}
+
+ @Override
+ public void save() {
+ if (src == null) {
+ // this is a new root config
+ src = newConfig();
+ } else {
+ if (modifieds.contains(VCSRootConfigProperty.rootName)) {
+ log.info("rootName changed " + current.getRootName());
+ }
+ }
+ current.copyTo(src, modifieds);
+ modifieds.clear();
+ if (!VCSConfigFactory.containsRoot(current.getRootName())) {
+ VCSConfigFactory.addRoot((VCSRootConfig) src);
+ setRoots(VCSConfigFactory.getInstance().getRoots());
+ }
+ super.save();
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-05-25 15:41:34 UTC (rev 679)
@@ -103,7 +103,7 @@
</Table>
<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()"/>
+ <!--JButton id='deleteRoot' icon='{createActionIcon("deleteroot")}' borderPainted='false' onActionPerformed="deleteRoot()"/-->
</JToolBar>
<Table fill='both' insets="1,1,1,1">
@@ -120,7 +120,7 @@
<Table insets="2,2,2,2" fill='horizontal'>
<row fill='horizontal'>
<cell><JLabel id='rootConfigLabel'/></cell>
- <cell><JComboBox id='rootsList' model="{rootsModel}"/></cell>
+ <cell><JComboBox id='rootConfig' model="{rootsModel}" onActionPerformed="doCheck(VCSConnexionConfigProperty.rootConfig)"/></cell>
</row>
<row fill='horizontal'>
<cell><JLabel id='modulePathLabel'/></cell>
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx 2008-05-25 15:41:01 UTC (rev 678)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx 2008-05-25 15:41:34 UTC (rev 679)
@@ -23,12 +23,9 @@
<JScrollPane columnHeaderView='{head}' styleClass='rootconfigScroll'>
<Table fill='horizontal'>
<row fill='horizontal'>
- <cell>
- <JLabel id='rootConfigLabel'/>
+ <cell columns="2" fill="horizontal">
+ <JComboBox id='rootsList' model="{rootsModel}" onActionPerformed="selectRoot()"/>
</cell>
- <cell>
- <JComboBox id='rootsList' model="{rootsModel}"/>
- </cell>
</row>
<row fill='horizontal'>
<cell>
@@ -43,7 +40,7 @@
<JLabel id='typeLabel'/>
</cell>
<cell>
- <JComboBox id='type' onKeyReleased="doCheck(VCSRootConfigProperty.type)" model="{typesModel}"/>
+ <JComboBox id='type' onActionPerformed="doCheck(VCSRootConfigProperty.type)" onKeyReleased="doCheck(VCSRootConfigProperty.type)" model="{typesModel}"/>
</cell>
</row>
<row fill='horizontal'>
1
0
r678 - trunk/lutinvcs/core/src/main/java/org/codelutin/vcs
by tchemit@users.labs.libre-entreprise.org 25 May '08
by tchemit@users.labs.libre-entreprise.org 25 May '08
25 May '08
Author: tchemit
Date: 2008-05-25 15:41:01 +0000 (Sun, 25 May 2008)
New Revision: 678
Modified:
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java
Log:
use a list of RootConfig and not a Map to simplify managment
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java 2008-05-25 15:40:33 UTC (rev 677)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java 2008-05-25 15:41:01 UTC (rev 678)
@@ -47,7 +47,7 @@
static protected VCSConfigFactory instance;
/** root configs indexed by their name */
- protected final java.util.Map<String, VCSRootConfig> roots;
+ protected final List<VCSRootConfig> roots;
/** connexion configs indexed by their rootConfig name */
protected final List<VCSConnexionConfig> connexions;
@@ -67,7 +67,7 @@
}
public List<VCSRootConfig> getRoots() {
- return new ArrayList<VCSRootConfig>(roots.values());
+ return new ArrayList<VCSRootConfig>(roots);
}
public List<VCSConnexionConfig> getConnexions() {
@@ -75,11 +75,25 @@
}
public static VCSRootConfig getRoot(String rootName) {
- if (!getInstance().roots.containsKey(rootName)) {
- // can not
- throw new IllegalStateException("unfound root " + rootName);
+
+ List<VCSRootConfig> configs = getInstance().roots;
+ for (VCSRootConfig config : configs) {
+ if (config.getRootName().equals(rootName)) {
+ return config;
+ }
+ }
+ // can not
+ throw new IllegalStateException("unfound root " + rootName);
+ }
+
+ public static boolean containsRoot(String rootName) {
+ List<VCSRootConfig> configs = getInstance().roots;
+ for (VCSRootConfig config : configs) {
+ if (config.getRootName().equals(rootName)) {
+ return true;
+ }
}
- return getInstance().roots.get(rootName);
+ return false;
}
public static VCSRootConfig newRoot() {
@@ -90,50 +104,44 @@
return config;
}
- public static VCSRootConfig cloneRoot(String name) {
- if (!getInstance().roots.containsKey(name)) {
- // can not
- throw new IllegalStateException("can not clone root " + name + ", not found");
- }
- VCSRootConfig config = getInstance().roots.get(name);
+ public static VCSRootConfig cloneRoot(String name) {
+ VCSRootConfig config = getRoot(name);
log.info(config);
VCSRootConfig result = newRoot();
result.copyFrom(config);
- result.setRootName(config.getRootName() + "_2");
- getInstance().roots.put(name, config);
+ result.setRootName(config.getRootName() +"_"+ getInstance().roots.size());
+ getInstance().roots.add(result);
return result;
}
public static void addRoot(VCSRootConfig config) {
String name = config.getRootName();
- if (getInstance().roots.containsKey(name)) {
+ List<VCSRootConfig> configs = getInstance().roots;
+ for (VCSRootConfig vcsRootConfig : configs) {
+ if (vcsRootConfig.getRootName().equals(name)) {
// can not
throw new IllegalStateException("can not create roots " + name + ", already existing ");
+ }
}
log.info(config);
- getInstance().roots.put(name, config);
+ getInstance().roots.add(config);
}
public static void removeRoot(String name) {
- if (!getInstance().roots.containsKey(name)) {
- // can not
- throw new IllegalStateException("can not remove roots " + name + ", not found");
- }
+ VCSRootConfig config = getRoot(name);
log.info(name);
- getInstance().roots.remove(name);
+ getInstance().roots.remove(config);
}
public static VCSConnexionConfig newConnexion(String rootName, EnumMap<VCSConnexionConfigProperty, Object> props) {
- if (!getInstance().roots.containsKey(rootName)) {
- // can not
- throw new IllegalStateException("unfound root " + rootName);
- }
+ VCSRootConfig rootConfig = getRoot(rootName);
+
VCSConnexionConfig config = new SimpleVCSConnexionConfig(props);
if (props == null || !props.containsKey(VCSConnexionConfigProperty.rootConfig)) {
// force to add rootConfig
- config.setRootConfig(getInstance().roots.get(rootName));
+ config.setRootConfig(rootConfig);
}
log.info(config);
getInstance().connexions.add(config);
@@ -141,7 +149,7 @@
}
protected VCSConfigFactory() {
- roots = new java.util.HashMap<String, VCSRootConfig>();
+ roots = new ArrayList<VCSRootConfig>();
connexions = new ArrayList<VCSConnexionConfig>();
}
}
\ No newline at end of file
1
0
r677 - trunk/lutinui/src/main/java/org/codelutin/ui/config
by tchemit@users.labs.libre-entreprise.org 25 May '08
by tchemit@users.labs.libre-entreprise.org 25 May '08
25 May '08
Author: tchemit
Date: 2008-05-25 15:40:33 +0000 (Sun, 25 May 2008)
New Revision: 677
Modified:
trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java
Log:
uiValue can be null
Modified: trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java
===================================================================
--- trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java 2008-05-17 13:51:28 UTC (rev 676)
+++ trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java 2008-05-25 15:40:33 UTC (rev 677)
@@ -197,7 +197,7 @@
}
public void changeModifiedState(E key, Object uiValue, Object currentValue) {
- if (uiValue.equals(currentValue)) {
+ if (uiValue!=null && uiValue.equals(currentValue)) {
removeModified(key);
} else {
addModified(key);
1
0
r676 - trunk/lutinvcs/ui/jaxx/src/main/resources/icons
by tchemit@users.labs.libre-entreprise.org 17 May '08
by tchemit@users.labs.libre-entreprise.org 17 May '08
17 May '08
Author: tchemit
Date: 2008-05-17 13:51:28 +0000 (Sat, 17 May 2008)
New Revision: 676
Removed:
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootui.png
Log:
introduce rootConfig ui first part...
Deleted: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootui.png
===================================================================
(Binary files differ)
1
0
17 May '08
Author: tchemit
Date: 2008-05-17 13:51:17 +0000 (Sat, 17 May 2008)
New Revision: 675
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/RootConfigUIHandler.java
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-cloneroot.png
trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootconfigui.png
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx
Modified:
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSRootConfig.java
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSRootConfigProperty.java
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/SimpleVCSRootConfig.java
trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.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/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/handler/ConnexionConfigUIHandler.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/ConnexionConfigUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/TestUIModel.java
trunk/lutinvcs/ui/common/src/main/resources/i18n/common-en_GB.properties
trunk/lutinvcs/ui/common/src/main/resources/i18n/common-fr_FR.properties
trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-en_GB.properties
trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-fr_FR.properties
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.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/JaxxVCSUIProvider.java
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css
Log:
introduce rootConfig ui first part...
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConfigFactory.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -23,13 +23,13 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.config.IdentityConfig;
import org.codelutin.util.config.SimpleIdentityConfig;
+import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import org.codelutin.vcs.util.SimpleVCSConnexionConfig;
import org.codelutin.vcs.util.SimpleVCSRootConfig;
-import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import java.util.ArrayList;
+import java.util.EnumMap;
import java.util.List;
-import java.util.EnumMap;
/**
* This classes acts as a factory of {@link org.codelutin.vcs.VCSProvider}, and {@link org.codelutin.vcs.VCSConnexion}.
@@ -43,19 +43,13 @@
static protected final Log log = LogFactory.getLog(VCSConfigFactory.class);
- /**
- * shared instance
- */
+ /** shared instance */
static protected VCSConfigFactory instance;
- /**
- * root configs indexed by their name
- */
+ /** root configs indexed by their name */
protected final java.util.Map<String, VCSRootConfig> roots;
- /**
- * connexion configs indexed by their rootConfig name
- */
+ /** connexion configs indexed by their rootConfig name */
protected final List<VCSConnexionConfig> connexions;
@@ -80,17 +74,56 @@
return connexions;
}
- public static VCSRootConfig newRoot(String name, String type, String host, String repository, Integer port) {
+ public static VCSRootConfig getRoot(String rootName) {
+ if (!getInstance().roots.containsKey(rootName)) {
+ // can not
+ throw new IllegalStateException("unfound root " + rootName);
+ }
+ return getInstance().roots.get(rootName);
+ }
+
+ public static VCSRootConfig newRoot() {
+ String name = "newRoot_" + getInstance().roots.size();
+ VCSRootConfig config = new SimpleVCSRootConfig();
+ config.setRootName(name);
+ log.info(config);
+ return config;
+ }
+
+ public static VCSRootConfig cloneRoot(String name) {
+ if (!getInstance().roots.containsKey(name)) {
+ // can not
+ throw new IllegalStateException("can not clone root " + name + ", not found");
+ }
+ VCSRootConfig config = getInstance().roots.get(name);
+ log.info(config);
+ VCSRootConfig result = newRoot();
+ result.copyFrom(config);
+ result.setRootName(config.getRootName() + "_2");
+ getInstance().roots.put(name, config);
+ return result;
+ }
+
+ public static void addRoot(VCSRootConfig config) {
+ String name = config.getRootName();
if (getInstance().roots.containsKey(name)) {
// can not
throw new IllegalStateException("can not create roots " + name + ", already existing ");
}
- VCSRootConfig config = new SimpleVCSRootConfig(name, type, host, repository, port);
log.info(config);
getInstance().roots.put(name, config);
- return config;
}
+ public static void removeRoot(String name) {
+ if (!getInstance().roots.containsKey(name)) {
+ // can not
+ throw new IllegalStateException("can not remove roots " + name + ", not found");
+ }
+ log.info(name);
+ getInstance().roots.remove(name);
+ }
+
+
public static VCSConnexionConfig newConnexion(String rootName, EnumMap<VCSConnexionConfigProperty, Object> props) {
if (!getInstance().roots.containsKey(rootName)) {
// can not
@@ -98,7 +131,7 @@
}
VCSConnexionConfig config = new SimpleVCSConnexionConfig(props);
- if (props==null || !props.containsKey(VCSConnexionConfigProperty.rootConfig)) {
+ if (props == null || !props.containsKey(VCSConnexionConfigProperty.rootConfig)) {
// force to add rootConfig
config.setRootConfig(getInstance().roots.get(rootName));
}
@@ -107,10 +140,8 @@
return config;
}
-
protected VCSConfigFactory() {
roots = new java.util.HashMap<String, VCSRootConfig>();
connexions = new ArrayList<VCSConnexionConfig>();
}
-
}
\ No newline at end of file
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -151,4 +151,12 @@
return providers;
}
+ /** @return the list of the names of known providers */
+ public List<String> getTypes() {
+ List<String> providerNames = new java.util.ArrayList<String>();
+ for (VCSProvider provider : providers) {
+ providerNames.add(provider.getName());
+ }
+ return providerNames;
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSRootConfig.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSRootConfig.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSRootConfig.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -26,7 +26,7 @@
*/
public interface VCSRootConfig extends Comparable<VCSRootConfig>, Config<VCSRootConfigProperty> {
- String getName();
+ String getRootName();
String getType();
@@ -36,7 +36,7 @@
Integer getPort();
- void setName(String name);
+ void setRootName(String name);
void setType(String type);
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSRootConfigProperty.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSRootConfigProperty.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSRootConfigProperty.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -22,21 +22,31 @@
* @author chemit
* @see VCSRootConfig
*/
-public enum VCSRootConfigProperty {
+public enum VCSRootConfigProperty implements org.codelutin.util.config.Property {
/** property <code>name</code>, unique name of the root definition */
- name,
+ rootName(String.class),
/** property <code>type</code>, type of the root (eg, CVS,...), should match the name of a {@link org.codelutin.vcs.VCSProvider} */
- type,
+ type(String.class),
/** property <code>host</code>, host of the root (eg labs.libreentreprise.org) with no protocol information */
- host,
+ host(String.class),
/** property <code>repository</code>, relative path of vcs root on host (eg cvsroot/myModule) */
- repository,
+ repository(String.class),
/** property <code>port</code>, the port used (if null, will use default vcs type port) */
- port
+ port(Integer.class);
+ private Class<?> ype;
+
+ public Class<?> getType() {
+ return ype;
+ }
+
+ VCSRootConfigProperty(Class<?> type) {
+ this.ype = type;
+ }
+
}
\ No newline at end of file
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/SimpleVCSRootConfig.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/SimpleVCSRootConfig.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/SimpleVCSRootConfig.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -18,7 +18,7 @@
import org.codelutin.vcs.VCSRootConfig;
import org.codelutin.vcs.type.VCSRootConfigProperty;
import static org.codelutin.vcs.type.VCSRootConfigProperty.host;
-import static org.codelutin.vcs.type.VCSRootConfigProperty.name;
+import static org.codelutin.vcs.type.VCSRootConfigProperty.rootName;
import static org.codelutin.vcs.type.VCSRootConfigProperty.port;
import static org.codelutin.vcs.type.VCSRootConfigProperty.repository;
import static org.codelutin.vcs.type.VCSRootConfigProperty.type;
@@ -38,15 +38,15 @@
public SimpleVCSRootConfig(String name, String type, String host, String repository, Integer port) {
this();
- setName(name);
+ setRootName(name);
setType(type);
setHost(host);
setRepository(repository);
setPort(port);
}
- public String getName() {
- return (String) properties.get(name);
+ public String getRootName() {
+ return (String) properties.get(rootName);
}
public String getType() {
@@ -65,8 +65,8 @@
return (String) properties.get(repository);
}
- public void setName(String newName) {
- setProperty(name, newName);
+ public void setRootName(String newName) {
+ setProperty(rootName, newName);
}
public void setType(String newType) {
@@ -86,8 +86,8 @@
}
public int compareTo(VCSRootConfig o) {
- String name = getName();
- String oName = o.getName();
+ String name = getRootName();
+ String oName = o.getRootName();
return name == null ? -1 : oName == null ? 1 : name.compareTo(oName);
}
@@ -97,14 +97,14 @@
if (!(o instanceof SimpleConfig)) return false;
SimpleVCSRootConfig that = (SimpleVCSRootConfig) o;
- String name = getName();
- String oName = that.getName();
+ String name = getRootName();
+ String oName = that.getRootName();
return !(name != null ? !name.equals(oName) : oName != null);
}
@Override
public int hashCode() {
- String name = getName();
+ String name = getRootName();
return (name != null ? name.hashCode() : 0);
}
Modified: trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java
===================================================================
--- trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/tools/src/test/java/org/codelutin/vcs/UITest.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -108,7 +108,13 @@
generator.generateWorkingRepository(root, i, i1, i2, i3);
}
- VCSRootConfig rootConfig = VCSConfigFactory.newRoot("generatedRoot-" + root.getName(), "MOCK", "labs.libre-entreprise.org", "cvsroot/isis-fish", null);
+ VCSRootConfig rootConfig = VCSConfigFactory.newRoot();
+ rootConfig.setRootName("dummy mock remote");
+ rootConfig.setHost("ynot-home.info");
+ rootConfig.setType("MOCK");
+ rootConfig.setRepository("/svnroot/lutinui");
+ VCSConfigFactory.addRoot(rootConfig);
+ //VCSRootConfig rootConfig = VCSConfigFactory.newRoot("generatedRoot-" + root.getName(), "MOCK", "labs.libre-entreprise.org", "cvsroot/isis-fish", null);
EnumMap<VCSConnexionConfigProperty, Object> props = new EnumMap<VCSConnexionConfigProperty, Object>(VCSConnexionConfigProperty.class);
props.put(sshPrivateKeyFile, new File("/home/tony/.ssh/id_dsa"));
@@ -118,7 +124,7 @@
props.put(connexionMode, org.codelutin.vcs.type.VCSConnexionMode.SSH);
props.put(workingCopyFile, root);
- VCSConnexionConfig config = VCSConfigFactory.newConnexion(rootConfig.getName(), props);
+ VCSConnexionConfig config = VCSConfigFactory.newConnexion(rootConfig.getRootName(), props);
return VCSFactory.newConnexion(config);
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -17,12 +17,15 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.ui.config.DialogConfigUI;
import org.codelutin.util.FileUtil;
+import org.codelutin.vcs.VCSConfigFactory;
+import org.codelutin.vcs.VCSRootConfig;
import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.ui.handler.ConnexionConfigUIHandler;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JEditorPane;
@@ -54,6 +57,8 @@
public abstract JEditorPane getDoc();
+ public abstract DefaultComboBoxModel getRootsModel();
+
public abstract JRadioButton getConnexionModeAnonymous();
public abstract JRadioButton getConnexionModePassword();
@@ -118,15 +123,19 @@
}
protected void editRoot() {
- log.info("TODO " + this);
+ String rootName = (String) getRootsList().getSelectedItem();
+ VCSRootConfig config = VCSConfigFactory.getRoot(rootName);
+ UIActionHelper.showRootConfigUI(config, this, "bottom-left");
}
protected void addRoot() {
+ VCSRootConfig config = VCSConfigFactory.newRoot();
+ UIActionHelper.showRootConfigUI(config, this, "bottom-left");
log.info("TODO " + this);
+
}
protected void deleteRoot() {
- log.info("TODO " + this);
}
}
Added: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/RootConfigUI.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -0,0 +1,68 @@
+/**
+ * # #% 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.config.DialogConfigUI;
+import org.codelutin.vcs.VCSConfigFactory;
+import org.codelutin.vcs.VCSRootConfig;
+import org.codelutin.vcs.type.VCSRootConfigProperty;
+import org.codelutin.vcs.ui.handler.RootConfigUIHandler;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComboBox;
+import javax.swing.JTextField;
+import javax.swing.DefaultComboBoxModel;
+
+/** @author chemit */
+public abstract class RootConfigUI extends DialogConfigUI<VCSRootConfigProperty, RootConfigUIHandler> {
+
+ public abstract DefaultComboBoxModel getTypesModel();
+
+ public abstract DefaultComboBoxModel getRootsModel();
+
+ public abstract AbstractButton getCloneRoot();
+
+ public abstract AbstractButton getAddRoot();
+
+ public abstract AbstractButton getDeleteRoot();
+
+ public abstract JTextField getRootName();
+
+ public abstract JTextField getHost();
+
+ public abstract JTextField getPort();
+
+ public abstract JComboBox getType();
+
+ public abstract JComboBox getRootsList();
+
+ protected void addRoot() {
+ VCSRootConfig config = VCSConfigFactory.newRoot();
+ getHandler().getModel().populate(config);
+ }
+
+ protected void cloneRoot() {
+ String rootName = (String) getRootsList().getSelectedItem();
+ VCSRootConfig config =VCSConfigFactory.cloneRoot(rootName);
+ getHandler().getModel().populate(config);
+ }
+
+ protected void deleteRoot() {
+ String rootName = (String) getRootsList().getSelectedItem();
+ VCSConfigFactory.removeRoot(rootName);
+ getHandler().getModel().populate(null);
+ }
+
+}
\ No newline at end of file
Modified: 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 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/TestUI.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -21,6 +21,8 @@
public abstract javax.swing.AbstractButton getShowFirstLaunch();
+ public abstract javax.swing.AbstractButton getShowRootConfig();
+
public abstract javax.swing.AbstractButton getShowConfig();
public abstract javax.swing.AbstractButton getShowSynch();
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/UIActionHelper.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -25,6 +25,7 @@
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.ShowRootConfigAction;
import org.codelutin.vcs.ui.action.ShowSynchUIAction;
import org.codelutin.vcs.ui.action.ShowTestUIAction;
import org.codelutin.vcs.ui.model.TestUIModel;
@@ -51,6 +52,13 @@
fireAction(ui, action);
}
+ public static void showRootConfigUI(Object config, DialogUI ui, String position) {
+ ShowRootConfigAction action = new ShowRootConfigAction(ui, false);
+ action.setSrc(config);
+ action.setPosition(position);
+ fireAction(ui, action);
+ }
+
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);
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -33,6 +33,7 @@
import org.codelutin.vcs.ui.handler.IdentityUIHandler;
import org.codelutin.vcs.ui.handler.SynchUIHandler;
import org.codelutin.vcs.ui.handler.TestUIHandler;
+import org.codelutin.vcs.ui.handler.RootConfigUIHandler;
import org.codelutin.vcs.ui.model.ChangelogUIModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import org.codelutin.vcs.ui.model.ConnexionConfigUIModel;
@@ -41,6 +42,7 @@
import org.codelutin.vcs.ui.model.IdentityUIModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
import org.codelutin.vcs.ui.model.TestUIModel;
+import org.codelutin.vcs.ui.model.RootConfigUIModel;
import java.awt.event.WindowEvent;
@@ -60,12 +62,13 @@
public static final DialogUIDef<ChangelogUIModel, ChangelogUI, ChangelogUIHandler> CHANGELOG_UI;
public static final DialogUIDef<ConfirmUIModel, ConfirmUI, ConfirmUIHandler> CONFIRM_UI;
public static final DialogUIDef<ConnexionConfigUIModel, ConnexionConfigUI, ConnexionConfigUIHandler> CONNEXION_CONFIG_UI;
+ public static final DialogUIDef<RootConfigUIModel, RootConfigUI, RootConfigUIHandler> ROOT_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, CONNEXION_CONFIG_UI, CONFIRM_UI, GENERATE_SHH_KEY_UI, IDENTITY_UI, TEST_UI};
+ return new DialogUIDef[]{SYNCH_UI, DIFF_UI, CHANGELOG_UI, CONNEXION_CONFIG_UI,ROOT_CONFIG_UI, CONFIRM_UI, GENERATE_SHH_KEY_UI, IDENTITY_UI, TEST_UI};
}
protected static VCSUIFactory instance;
@@ -136,6 +139,10 @@
n_("lutinvcs.action.show.configui"),
n_("lutinvcs.action.show.configui.tip"),
n_("lutinvcs.configui.title"));
+ ROOT_CONFIG_UI= newDef(RootConfigUIHandler.class, RootConfigUI.class, RootConfigUIModel.class,
+ n_("lutinvcs.action.show.rootconfigui"),
+ n_("lutinvcs.action.show.rootconfigui.tip"),
+ n_("lutinvcs.configui.title"));
GENERATE_SHH_KEY_UI = newDef(GenerateSshKeyUIHandler.class, GenerateSshKeyUI.class, GenerateSshKeyUIModel.class,
n_("lutinvcs.action.show.generatesshkeyui"),
n_("lutinvcs.action.show.generatesshkeyui.tip"),
Added: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowRootConfigAction.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -0,0 +1,53 @@
+/**
+ * # #% 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.DialogUI;
+import org.codelutin.ui.DialogUIHandler;
+import org.codelutin.ui.ShowUIAction;
+import org.codelutin.vcs.ui.RootConfigUI;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import org.codelutin.vcs.ui.handler.RootConfigUIHandler;
+import org.codelutin.vcs.ui.model.RootConfigUIModel;
+
+import java.awt.event.ActionEvent;
+
+/** @author chemit */
+public class ShowRootConfigAction extends ShowUIAction<RootConfigUIModel, RootConfigUI, RootConfigUIHandler> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected transient Object src;
+
+ public Object getSrc() {
+ return src;
+ }
+
+ public void setSrc(Object src) {
+ this.src = src;
+ }
+
+ public ShowRootConfigAction(DialogUI<DialogUIHandler<?, ?>> ui, boolean showText) {
+ super(ui, VCSUIFactory.ROOT_CONFIG_UI, VCSUIFactory.getInstance(), showText);
+ }
+
+ @Override
+ protected RootConfigUI initUI(ActionEvent e) {
+ RootConfigUI ui = super.initUI(e);
+ ui.getHandler().getModel().populate(src);
+ ui.pack();
+ return ui;
+ }
+}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -16,6 +16,7 @@
import org.codelutin.ui.config.DialogConfigUIHandler;
import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.VCSRootConfig;
import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import static org.codelutin.vcs.type.VCSConnexionConfigProperty.connexionMode;
import static org.codelutin.vcs.type.VCSConnexionConfigProperty.login;
@@ -30,6 +31,7 @@
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
+import javax.swing.DefaultComboBoxModel;
import java.beans.PropertyChangeEvent;
import java.util.EnumSet;
@@ -129,6 +131,16 @@
@Override
protected void populateUI() {
+ // add roots
+ DefaultComboBoxModel comboBoxModel = getUi().getRootsModel();
+ comboBoxModel.removeAllElements();
+ if (getModel().getSrc() == null) {
+ // first root is an empty one
+ comboBoxModel.addElement(" ");
+ }
+ for (VCSRootConfig type : getModel().getRoots()) {
+ comboBoxModel.addElement(type.getRootName());
+ }
super.populateUI();
ConnexionConfigUI ui = getUi();
@@ -155,6 +167,7 @@
break;
}
ui.getTestConnection().setEnabled(true);
+ getUi().getRootsModel().setSelectedItem(config.getRootConfig().getRootName());
}
Added: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/RootConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/RootConfigUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/RootConfigUIHandler.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -0,0 +1,89 @@
+/**
+ * ##% 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.config.DialogConfigUIHandler;
+import org.codelutin.vcs.VCSRootConfig;
+import org.codelutin.vcs.type.VCSRootConfigProperty;
+import org.codelutin.vcs.ui.RootConfigUI;
+import org.codelutin.vcs.ui.model.RootConfigUIModel;
+
+import javax.swing.DefaultComboBoxModel;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class RootConfigUIHandler extends DialogConfigUIHandler<VCSRootConfigProperty, RootConfigUIModel, RootConfigUI> {
+
+ public RootConfigUIHandler(RootConfigUI ui, RootConfigUIModel model) {
+ super(ui, model);
+ ui.setHandler(this);
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ //RootConfigUI ui = getUi();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+
+ // try in super class
+ super.propertyChange(evt);
+ }
+
+
+ @Override
+ protected void populateUI() {
+ // add types
+ DefaultComboBoxModel comboBoxModel = getUi().getTypesModel();
+ comboBoxModel.removeAllElements();
+ for (String type : getModel().getTypes()) {
+ comboBoxModel.addElement(type);
+ }
+ // add roots
+ comboBoxModel = getUi().getRootsModel();
+ comboBoxModel.removeAllElements();
+ if (getModel().getSrc() == null) {
+ // first root is an empty one
+ comboBoxModel.addElement(" ");
+ }
+ for (VCSRootConfig type : getModel().getRoots()) {
+ comboBoxModel.addElement(type.getRootName());
+ }
+ super.populateUI();
+ if (getModel().getSrc() != null) {
+ //TODO disable selectionListener on combos before this operation
+ // select type
+ getUi().getTypesModel().setSelectedItem(getModel().getCurrent().getType());
+ // select root
+ getUi().getRootsModel().setSelectedItem(getModel().getCurrent().getRootName());
+ }
+ }
+
+
+ @Override
+ protected boolean prepareSave() {
+ boolean b = super.prepareSave();
+ if (b) {
+ //TODO
+ }
+ return b;
+ }
+
+}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/TestUIHandler.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -27,7 +27,7 @@
/** @author chemit */
public class TestUIHandler extends org.codelutin.ui.DialogUIHandler<TestUIModel, TestUI> {
- public TestUIHandler(TestUI ui,TestUIModel model) {
+ public TestUIHandler(TestUI ui, TestUIModel model) {
super(ui, model);
ui.setHandler(this);
}
@@ -39,6 +39,7 @@
initAction(VCSUIFactory.IDENTITY_UI, getUi().getShowFirstLaunch());
initAction(VCSUIFactory.CONNEXION_CONFIG_UI, getUi().getShowConfig());
initAction(VCSUIFactory.SYNCH_UI, getUi().getShowSynch());
+ initAction(VCSUIFactory.ROOT_CONFIG_UI, getUi().getShowRootConfig());
}
protected void initAction(DialogUIDef uiDef, AbstractButton button) {
@@ -62,6 +63,10 @@
UIActionHelper.showConfigUI(getModel().getConnexion().getConfig(), getUi(), "bottom-left");
return;
}
+ if (uiDef == VCSUIFactory.ROOT_CONFIG_UI) {
+ UIActionHelper.showRootConfigUI(getModel().getRoot(), getUi(), "bottom-left");
+ return;
+ }
if (uiDef == VCSUIFactory.SYNCH_UI) {
UIActionHelper.showSynchUI(getModel().getConnexion().getConfig(), getUi(), VCSEntryLocation.ALL, getModel().getEntries(), "bottom-left");
return;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -16,12 +16,15 @@
import org.codelutin.ui.config.DialogConfigUIModel;
import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.VCSRootConfig;
+import org.codelutin.vcs.VCSConfigFactory;
import org.codelutin.vcs.type.VCSConnexionConfigProperty;
import static org.codelutin.vcs.type.VCSConnexionConfigProperty.*;
import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.util.SimpleVCSConnexionConfig;
import java.util.EnumSet;
+import java.util.List;
/**
* Model of a a confirmation of action on entries (single type of action possible)
@@ -38,6 +41,8 @@
protected VCSConnexionMode mode;
+ protected List<VCSRootConfig> roots;
+
public ConnexionConfigUIModel() {
super(VCSConnexionConfigProperty.class);
uncheckedKeys = EnumSet.noneOf(VCSConnexionConfigProperty.class);
@@ -49,12 +54,21 @@
@Override
public void populate(Object src) {
+ setRoots(VCSConfigFactory.getInstance().getRoots());
current.copyFrom(src, EnumSet.of(sshNoPassphrase));
noSshPassPhrase = current.isSshNoPassphrase();
super.populate(src);
setConnexionMode(current.getConnexionMode());
}
+ public List<VCSRootConfig> getRoots() {
+ return roots;
+ }
+
+ public void setRoots(List<VCSRootConfig> roots) {
+ this.roots = roots;
+ }
+
public void setNoSshPassPhrase(Boolean noSshPassPhrase) {
Boolean old = this.noSshPassPhrase;
this.noSshPassPhrase = noSshPassPhrase;
@@ -110,6 +124,7 @@
result &= !String.valueOf(value).trim().isEmpty();
break;
case rootConfig:
+ result &= !String.valueOf(value).trim().isEmpty();
break;
case sshLogin:
if (mode != VCSConnexionMode.SSH) {
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/RootConfigUIModel.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -14,18 +14,85 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.ui.util.model.AbstractUIModel;
+import org.codelutin.ui.config.DialogConfigUIModel;
+import org.codelutin.vcs.VCSRootConfig;
+import org.codelutin.vcs.VCSConfigFactory;
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.type.VCSRootConfigProperty;
+import org.codelutin.vcs.util.SimpleVCSRootConfig;
+import java.util.List;
+
/**
* Model of a a confirmation of action on entries (single type of action possible)
*
* @author chemit
*/
-public class RootConfigUIModel extends AbstractUIModel {
+public class RootConfigUIModel extends DialogConfigUIModel<VCSRootConfigProperty, VCSRootConfig> {
+ protected List<VCSRootConfig> roots;
+ protected List<String> types;
+
public RootConfigUIModel() {
+ super(VCSRootConfigProperty.class);
+ }
+ protected VCSRootConfig newConfig() {
+ return new SimpleVCSRootConfig();
}
+ @Override
+ public void populate(Object src) {
+ setRoots(VCSConfigFactory.getInstance().getRoots());
+ setTypes(VCSFactory.getInstance().getTypes());
+ super.populate(src);
+ }
+
+ public List<VCSRootConfig> getRoots() {
+ return roots;
+ }
+
+ public List<String> getTypes() {
+ return types;
+ }
+
+ protected void setRoots(List<VCSRootConfig> roots) {
+ this.roots = roots;
+ }
+
+ public void setTypes(List<String> types) {
+ this.types = types;
+ }
+
+ protected boolean isValid(VCSRootConfigProperty key, Object value) {
+ // each propertie can not be null, nor empty
+ boolean result = value != null && !String.valueOf(value).isEmpty();
+ switch (key) {
+ case host:
+ break;
+ case rootName:
+ //TODO Nameshould be unique
+
+ break;
+ case port:
+ if (result) {
+ // must be an valid positive integer
+ try {
+ int port = Integer.valueOf(value + "");
+ if (port < 1) {
+ result = false;
+ }
+ } catch (NumberFormatException e) {
+ result = false;
+ }
+ }
+ break;
+ case repository:
+ break;
+ case type:
+ break;
+ }
+ return result;
+ }
}
\ No newline at end of file
Modified: 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/model/TestUIModel.java 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/TestUIModel.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -34,6 +34,8 @@
protected Object identity;
+ protected Object root;
+
private VCSEntry[] entries;
public void setUIDef(DialogUIDef uiDef) {
@@ -52,6 +54,10 @@
return identity;
}
+ public Object getRoot() {
+ return root;
+ }
+
public VCSEntry[] getEntries() {
return entries;
}
@@ -68,10 +74,15 @@
this.identity = identity;
}
+ public void setRoot(Object root) {
+ this.root = root;
+ }
+
public void init(TestUIModel model, boolean firstTime) {
connexion = model.getConnexion();
entries = model.getEntries();
identity = model.getIdentity();
+ root = model.getRoot();
if (firstTime) {
// propagate incoming model listeners to ui model
for (PropertyChangeListener listener : model.getPropertyChangeListeners()) {
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/resources/i18n/common-en_GB.properties 2008-05-17 13:51:17 UTC (rev 675)
@@ -24,6 +24,8 @@
lutinvcs.action.show.generatesshkeyui.tip=
lutinvcs.action.show.identityui=
lutinvcs.action.show.identityui.tip=
+lutinvcs.action.show.rootconfigui=
+lutinvcs.action.show.rootconfigui.tip=
lutinvcs.action.show.synchui=
lutinvcs.action.show.synchui.tip=
lutinvcs.action.show.testui=
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/common/src/main/resources/i18n/common-fr_FR.properties 2008-05-17 13:51:17 UTC (rev 675)
@@ -24,6 +24,8 @@
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.rootconfigui=Serveurs vcs
+lutinvcs.action.show.rootconfigui.tip=Configurer les serveurs vcs distant
lutinvcs.action.show.synchui=Synchroniser
lutinvcs.action.show.synchui.tip=Voir la fen\u00EAtre de synchronisation
lutinvcs.action.show.testui=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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-en_GB.properties 2008-05-17 13:51:17 UTC (rev 675)
@@ -6,13 +6,17 @@
lutinvcs.config.email=
lutinvcs.config.firstName=
lutinvcs.config.generate=Generate
+lutinvcs.config.host=
lutinvcs.config.lastName=
lutinvcs.config.message=
lutinvcs.config.modulePath=
lutinvcs.config.pass=
+lutinvcs.config.port=
lutinvcs.config.remoteURL=
+lutinvcs.config.repository=
lutinvcs.config.rootConfig=
lutinvcs.config.rootConfigHead=
+lutinvcs.config.rootName=
lutinvcs.config.server.authenticationMethod=
lutinvcs.config.server.login=
lutinvcs.config.server.passphrase=
@@ -24,9 +28,11 @@
lutinvcs.config.server.ssh.privateKeyFile=
lutinvcs.config.server.ssh.publicKeyFile=
lutinvcs.config.ssh=
+lutinvcs.config.type=
lutinvcs.config.workingCopyFile=
lutinvcs.config.workingCopyFile.change=
lutinvcs.generateSshKey.message=Generate
lutinvcs.identity.message=
lutinvcs.no.config=
lutinvcs.reset=
+lutinvcs.rootConfig.message=
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/jaxx/src/main/resources/i18n/jaxx-fr_FR.properties 2008-05-17 13:51:17 UTC (rev 675)
@@ -6,13 +6,17 @@
lutinvcs.config.email=Courriel
lutinvcs.config.firstName=Pr\u00E9nom
lutinvcs.config.generate=G\u00E9n\u00E9rer
+lutinvcs.config.host=H\u00F4te
lutinvcs.config.lastName=Nom
lutinvcs.config.message=Configuration de la connexion
lutinvcs.config.modulePath=Module path
lutinvcs.config.pass=password
+lutinvcs.config.port=Port
lutinvcs.config.remoteURL=URL
+lutinvcs.config.repository=Repository
lutinvcs.config.rootConfig=Repository
lutinvcs.config.rootConfigHead=Serveur distant
+lutinvcs.config.rootName=Nom
lutinvcs.config.server.authenticationMethod=Authentification
lutinvcs.config.server.login=Login
lutinvcs.config.server.passphrase=passe-phrase
@@ -24,9 +28,11 @@
lutinvcs.config.server.ssh.privateKeyFile=clef priv\u00E9e
lutinvcs.config.server.ssh.publicKeyFile=clef publique
lutinvcs.config.ssh=ssh
+lutinvcs.config.type=Type de serveur
lutinvcs.config.workingCopyFile=Base locale
lutinvcs.config.workingCopyFile.change=Changer de base locale
lutinvcs.generateSshKey.message=G\u00E9n\u00E9rer
lutinvcs.identity.message=Configuration de votre identit\u00E9
lutinvcs.no.config=<Pas de configuration>
lutinvcs.reset=R\u00E9initialiser
+lutinvcs.rootConfig.message=Configuration des serveurs distants
Added: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-cloneroot.png
===================================================================
(Binary files differ)
Property changes on: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-cloneroot.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/lutinvcs/ui/jaxx/src/main/resources/icons/action-show-rootconfigui.png (from rev 657, 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-rootconfigui.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConnexionConfigUI.jaxx 2008-05-17 13:51:17 UTC (rev 675)
@@ -6,7 +6,7 @@
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
import org.codelutin.vcs.ui.action.*;
</script>
-
+ <DefaultComboBoxModel id="rootsModel"/>
<java.awt.CardLayout id='connexionPanelLayout'>
<Table id='anonymousPanel' insets='2,2,2,2'>
<row>
@@ -120,7 +120,7 @@
<Table insets="2,2,2,2" fill='horizontal'>
<row fill='horizontal'>
<cell><JLabel id='rootConfigLabel'/></cell>
- <cell><JComboBox id='rootsList'/></cell>
+ <cell><JComboBox id='rootsList' model="{rootsModel}"/></cell>
</row>
<row fill='horizontal'>
<cell><JLabel id='modulePathLabel'/></cell>
Added: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx (rev 0)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxRootConfigUI.jaxx 2008-05-17 13:51:17 UTC (rev 675)
@@ -0,0 +1,87 @@
+<RootConfigUI modal='true' resizable='false'>
+ <script>import org.codelutin.vcs.type.VCSRootConfigProperty;</script>
+ <style source="config.css"/>
+ <JToolBar id='head' opaque='false'>
+ <JLabel text='lutinvcs.rootConfig.message'/>
+ <Table fill='both' insets='0,0,0,0'>
+ <row>
+ <cell fill='both'/>
+ </row>
+ </Table>
+ <JButton id='addRoot' icon='{createActionIcon("addroot")}' borderPainted='false' onActionPerformed="addRoot()"/>
+ <JButton id='deleteRoot' icon='{createActionIcon("deleteroot")}' borderPainted='false' onActionPerformed="deleteRoot()"/>
+ <JButton id='cloneRoot' icon='{createActionIcon("cloneroot")}' borderPainted='false' onActionPerformed="cloneRoot()"/>
+ <JButton id='reset' action='{newAction(org.codelutin.ui.config.ResetAction.class,false)}' borderPainted='false'/>
+ <JButton id='help' action='{newAction(org.codelutin.vcs.ui.action.HelpAction.class)}' borderPainted='false'/>
+ </JToolBar>
+ <DefaultComboBoxModel id="typesModel"/>
+ <DefaultComboBoxModel id="rootsModel"/>
+
+ <Table fill='both' insets="1,1,1,1">
+ <row fill='horizontal'>
+ <cell columns="2" fill='both'>
+ <JScrollPane columnHeaderView='{head}' styleClass='rootconfigScroll'>
+ <Table fill='horizontal'>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='rootConfigLabel'/>
+ </cell>
+ <cell>
+ <JComboBox id='rootsList' model="{rootsModel}"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='rootNameLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='rootName' onKeyReleased="doCheck(VCSRootConfigProperty.rootName)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='typeLabel'/>
+ </cell>
+ <cell>
+ <JComboBox id='type' onKeyReleased="doCheck(VCSRootConfigProperty.type)" model="{typesModel}"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='hostLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='host' onKeyReleased="doCheck(VCSRootConfigProperty.host)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='repositoryLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='repository' onKeyReleased="doCheck(VCSRootConfigProperty.repository)"/>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JLabel id='portLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='port' onKeyReleased="doCheck(VCSRootConfigProperty.port)"/>
+ </cell>
+ </row>
+ </Table>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell weightx='1'>
+ <JButton id='ok' action='{newAction(org.codelutin.ui.config.SaveAction.class,true)}'/>
+ </cell>
+ <cell weightx='1'>
+ <JButton id='cancel' action='{newAction(org.codelutin.ui.config.CancelAction.class,true)}'/>
+ </cell>
+ </row>
+ </Table>
+
+</RootConfigUI>
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx 2008-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxTestUI.jaxx 2008-05-17 13:51:17 UTC (rev 675)
@@ -3,6 +3,7 @@
<script>import static org.codelutin.vcs.ui.VCSUIFactory.*;</script>
<JToolBar>
<JButton id='showFirstLaunch' onActionPerformed="showUI(IDENTITY_UI)"/>
+ <JButton id='showRootConfig' onActionPerformed="showUI(ROOT_CONFIG_UI)" />
<JButton id='showConfig' onActionPerformed="showUI(CONNEXION_CONFIG_UI)" />
<JButton id='showSynch' onActionPerformed="showUI(SYNCH_UI)"/>
<Table fill='both' insets='0,0,0,0'>
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxVCSUIProvider.java 2008-05-17 13:51:17 UTC (rev 675)
@@ -24,6 +24,7 @@
JaxxChangelogUI.class,
JaxxConfirmUI.class,
JaxxConnexionConfigUI.class,
+ JaxxRootConfigUI.class,
JaxxGenerateSshKeyUI.class,
JaxxIdentityUI.class,
JaxxTestUI.class);
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-05-17 13:50:22 UTC (rev 674)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/config.css 2008-05-17 13:51:17 UTC (rev 675)
@@ -90,6 +90,26 @@
text: "lutinvcs.config.remoteURL";
}
+#rootNameLabel {
+ text: "lutinvcs.config.rootName";
+}
+
+#hostLabel {
+ text: "lutinvcs.config.host";
+}
+
+#portLabel {
+ text: "lutinvcs.config.port";
+}
+
+#typeLabel {
+ text: "lutinvcs.config.type";
+}
+
+#repositoryLabel {
+ text: "lutinvcs.config.repository";
+}
+
#changePrivateKeyFile {
toolTipText: "lutinvcs.config.server.ssh.key.change";
opaque:false;
@@ -140,4 +160,9 @@
horizontalScrollBarPolicy: 31;
height:110;
width:400;
+}
+
+.rootconfigScroll{
+ verticalScrollBarPolicy: 21;
+ horizontalScrollBarPolicy: 31;
}
\ No newline at end of file
1
0
r674 - trunk/lutinui/src/main/java/org/codelutin/ui/config
by tchemit@users.labs.libre-entreprise.org 17 May '08
by tchemit@users.labs.libre-entreprise.org 17 May '08
17 May '08
Author: tchemit
Date: 2008-05-17 13:50:22 +0000 (Sat, 17 May 2008)
New Revision: 674
Modified:
trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java
Log:
can populate with src null
Modified: trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java
===================================================================
--- trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java 2008-05-17 11:32:35 UTC (rev 673)
+++ trunk/lutinui/src/main/java/org/codelutin/ui/config/DialogConfigUIModel.java 2008-05-17 13:50:22 UTC (rev 674)
@@ -114,7 +114,10 @@
public void populate(Object src) {
this.src = src;
- this.current.copyFrom(src);
+ this.current = newConfig();
+ if (src != null) {
+ this.current.copyFrom(src);
+ }
this.modifieds.clear();
this.unvalids.clear();
setModified(false);
1
0
r673 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . handler model
by tchemit@users.labs.libre-entreprise.org 17 May '08
by tchemit@users.labs.libre-entreprise.org 17 May '08
17 May '08
Author: tchemit
Date: 2008-05-17 11:32:35 +0000 (Sat, 17 May 2008)
New Revision: 673
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java
Log:
ajout modulePath dans la config
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-17 11:32:26 UTC (rev 672)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConnexionConfigUI.java 2008-05-17 11:32:35 UTC (rev 673)
@@ -24,11 +24,13 @@
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
import javax.swing.JEditorPane;
-import javax.swing.JLabel;
+import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
+import java.awt.CardLayout;
import java.io.File;
/** @author chemit */
@@ -72,33 +74,20 @@
public abstract JTextField getWorkingCopyFile();
- public abstract JLabel getLoginLabel();
+ public abstract JTextField getModulePath();
- public abstract JLabel getSshLoginLabel();
+ public abstract JPanel getConnexionPanel();
- public abstract JLabel getPasswordLabel();
+ public abstract CardLayout getConnexionPanelLayout();
- public abstract JLabel getSshPassphraseLabel();
+ public abstract JPanel getAnonymousPanel();
- //public abstract JLabel getSshNoPassphraseLabel();
+ public abstract JPanel getPasswordPanel();
- public abstract JLabel getSshPrivateKeyFileLabel();
+ public abstract JPanel getSshPanel();
- public abstract JLabel getWorkingCopyFileLabel();
+ public abstract JComboBox getRootsList();
- 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();
-
-
protected void changeAutheticationMode(VCSConnexionMode mode) {
getHandler().getModel().setConnexionMode(mode);
doCheck(VCSConnexionConfigProperty.connexionMode);
@@ -125,19 +114,19 @@
}
protected void generateKey() {
- //TODO
+ log.info("TODO " + this);
}
protected void editRoot() {
- //TODO
+ log.info("TODO " + this);
}
protected void addRoot() {
- //TODO
+ log.info("TODO " + this);
}
protected void deleteRoot() {
- //TODO
+ log.info("TODO " + this);
}
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-17 11:32:26 UTC (rev 672)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConnexionConfigUIHandler.java 2008-05-17 11:32:35 UTC (rev 673)
@@ -86,11 +86,10 @@
public void doCheck(VCSConnexionConfigProperty key) {
switch (key) {
-
case connexionMode:
// special case (not checkable property)
doCheck(getModel().getMode());
- break;
+ return;
case sshNoPassphrase:
Boolean noPass = (Boolean) getUi().getElementValue(key);
getModel().setNoSshPassPhrase(noPass);
@@ -98,22 +97,13 @@
if (noPass) {
getModel().clear(sshPassphrase);
} //else {
- super.doCheck(sshPassphrase);
+ super.doCheck(sshPassphrase);
//}
- break;
- case login:
- case password:
- case rootConfig:
- case sshLogin:
- case sshPassphrase:
- case sshPrivateKeyFile:
- case workingCopyFile:
- super.doCheck(key);
- break;
- case typeRepo:
- case typeRepoValue:
- break;
- }
+ return;
+ }
+ // other properties use default behaviour
+ super.doCheck(key);
+
}
protected boolean doCheck(VCSConnexionMode value) {
@@ -137,13 +127,7 @@
return result;
}
-
@Override
- public void doCheckAll() {
- super.doCheckAll();
- }
-
- @Override
protected void populateUI() {
super.populateUI();
@@ -193,7 +177,6 @@
modifieds.add(VCSConnexionConfigProperty.sshPassphrase);
}
}
-
}
return b;
}
@@ -210,7 +193,6 @@
ui.getConnexionModePassword().setSelected(true);
break;
case SSH:
-
doCheck(sshLogin);
doCheck(sshNoPassphrase);
doCheck(sshPassphrase);
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java 2008-05-17 11:32:26 UTC (rev 672)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConnexionConfigUIModel.java 2008-05-17 11:32:35 UTC (rev 673)
@@ -51,10 +51,7 @@
public void populate(Object src) {
current.copyFrom(src, EnumSet.of(sshNoPassphrase));
noSshPassPhrase = current.isSshNoPassphrase();
- super.populate(src);
- /*if (noSshPassPhrase) {
- clear(sshPassphrase);
- }*/
+ super.populate(src);
setConnexionMode(current.getConnexionMode());
}
@@ -87,7 +84,6 @@
}
}
changeModifiedState(connexionMode, mode, getCurrent().getConnexionMode());
-
firePropertyChange(MODE_PROPERTY_CHANGED, oldMode, mode);
setConnexionState(null);
}
@@ -145,6 +141,9 @@
result = !f.isEmpty() && new java.io.File(f).exists();
}
break;
+ case modulePath:
+ result &= !String.valueOf(value).trim().isEmpty();
+ break;
case sshNoPassphrase:
// always valid :)
result = true;
1
0