r675 - in trunk/lutinvcs: core/src/main/java/org/codelutin/vcs core/src/main/java/org/codelutin/vcs/type core/src/main/java/org/codelutin/vcs/util tools/src/test/java/org/codelutin/vcs ui/common/src/main/java/org/codelutin/vcs/ui ui/common/src/main/java/org/codelutin/vcs/ui/action ui/common/src/main/java/org/codelutin/vcs/ui/handler ui/common/src/main/java/org/codelutin/vcs/ui/model ui/common/src/main/resources/i18n ui/jaxx/src/main/resources/i18n ui/jaxx/src/main/resources/icons ui/jaxx/src/
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
participants (1)
-
tchemit@users.labs.libre-entreprise.org