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
April 2008
- 1 participants
- 373 discussions
r413 - in trunk/lutinvcs: lutinvcs-ui/src/test/java/org/codelutin/vcs/ui lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:22:37 +0000 (Sun, 06 Apr 2008)
New Revision: 413
Added:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java
Removed:
trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
Log:
move UITest to jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
Deleted: trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 17:19:12 UTC (rev 412)
+++ trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 17:22:37 UTC (rev 413)
@@ -1,95 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.i18n.I18n;
-import org.codelutin.vcs.VCSConnexion;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.type.VCSState;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.util.VCSConnexionConfigImpl;
-import org.codelutin.vcs.util.VCSEntryImpl;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/** @author chemit */
-public class UITest {
-
- /** The r. */
- static java.util.Random r = new java.util.Random();
-
- public static void main(String[] args) {
-
- I18n.init();
-
- VCSConnexion connexion = initVCS(new File(new File("").getAbsolutePath()));
-
- try {
- connexion.open();
-
- AbstractSynchUI ui = VCSUIFactory.newSynchUI();
-
- fillSynchModel(connexion, ui.getModel(), 20, "trunk", "local/", "remote/");
-
- ui.setVisible(true);
-
- } finally {
- connexion.close();
- }
- }
-
- public static VCSConnexion initVCS(File root) {
- VCSConnexionConfigImpl config = new VCSConnexionConfigImpl();
- config.setType("MOCK");
- config.setLocalDatabasePath(root);
- VCSConnexion connexion = VCSFactory.newConnexion(VCSConnexionMode.ANONYMOUS, config);
- connexion.init(config);
- return connexion;
- }
-
- protected static void fillSynchModel(VCSConnexion handler, SynchUIModel model, int max, String prefix, String localPRefix, String remotePrefix) {
- List<VCSEntry> datas = generateListFileStates(handler, max, prefix, localPRefix, remotePrefix);
- model.populate(VCSEntryLocation.UNKNOW, datas.toArray(new VCSEntry[datas.size()]));
- }
-
- protected static List<VCSEntry> generateListFileStates(VCSConnexion handler, int max, String prefix, String localPRefix, String remotePrefix) {
- List<VCSEntry> datas = generateLocalFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), localPRefix);
- datas.addAll(generateRemoteFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), remotePrefix));
- return datas;
- }
-
- protected static List<VCSEntry> generateLocalFileStates(VCSConnexion handler, int max, File root, String localPRefix) {
- return generateFileStates(handler, root, max, localPRefix, VCSState.MODIFIED, VCSState.UNVERSIONNED, VCSState.OUT_OF_DATE_AND_MODIFIED, VCSState.REMOVED);
- }
-
- protected static List<VCSEntry> generateRemoteFileStates(VCSConnexion handler, int max, File root, String remotePRefix) {
- return generateFileStates(handler, root, max, remotePRefix, VCSState.MISSING, VCSState.OUT_OF_DATE, VCSState.OUT_OF_DATE_AND_MODIFIED);
- }
-
- protected static List<VCSEntry> generateFileStates(VCSConnexion handler, File root, int max, String prefix, VCSState... states) {
- List<VCSEntry> datas = new ArrayList<VCSEntry>();
- for (int i = 0, nbFiles = 1 + r.nextInt(max), size = states.length; i < nbFiles; i++) {
- VCSEntry state = new VCSEntryImpl(handler, root.getName() + File.separator + prefix + "file" + i);
- state.setState(states[r.nextInt(size)]);
- datas.add(state);
- }
- return datas;
- }
-}
Copied: trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java (from rev 402, trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 17:22:37 UTC (rev 413)
@@ -0,0 +1,95 @@
+/**
+ * # #% 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.i18n.I18n;
+import org.codelutin.vcs.VCSConnexion;
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSState;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+import org.codelutin.vcs.util.VCSConnexionConfigImpl;
+import org.codelutin.vcs.util.VCSEntryImpl;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public class UITest {
+
+ /** The r. */
+ static java.util.Random r = new java.util.Random();
+
+ public static void main(String[] args) {
+
+ I18n.init();
+
+ VCSConnexion connexion = initVCS(new File(new File("").getAbsolutePath()));
+
+ try {
+ connexion.open();
+
+ AbstractSynchUI ui = VCSUIFactory.newSynchUI();
+
+ fillSynchModel(connexion, ui.getModel(), 20, "trunk", "local/", "remote/");
+
+ ui.setVisible(true);
+
+ } finally {
+ connexion.close();
+ }
+ }
+
+ public static VCSConnexion initVCS(File root) {
+ VCSConnexionConfigImpl config = new VCSConnexionConfigImpl();
+ config.setType("MOCK");
+ config.setLocalDatabasePath(root);
+ VCSConnexion connexion = VCSFactory.newConnexion(VCSConnexionMode.ANONYMOUS, config);
+ connexion.init(config);
+ return connexion;
+ }
+
+ protected static void fillSynchModel(VCSConnexion handler, SynchUIModel model, int max, String prefix, String localPRefix, String remotePrefix) {
+ List<VCSEntry> datas = generateListFileStates(handler, max, prefix, localPRefix, remotePrefix);
+ model.populate(VCSEntryLocation.UNKNOW, datas.toArray(new VCSEntry[datas.size()]));
+ }
+
+ protected static List<VCSEntry> generateListFileStates(VCSConnexion handler, int max, String prefix, String localPRefix, String remotePrefix) {
+ List<VCSEntry> datas = generateLocalFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), localPRefix);
+ datas.addAll(generateRemoteFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), remotePrefix));
+ return datas;
+ }
+
+ protected static List<VCSEntry> generateLocalFileStates(VCSConnexion handler, int max, File root, String localPRefix) {
+ return generateFileStates(handler, root, max, localPRefix, VCSState.MODIFIED, VCSState.UNVERSIONNED, VCSState.OUT_OF_DATE_AND_MODIFIED, VCSState.REMOVED);
+ }
+
+ protected static List<VCSEntry> generateRemoteFileStates(VCSConnexion handler, int max, File root, String remotePRefix) {
+ return generateFileStates(handler, root, max, remotePRefix, VCSState.MISSING, VCSState.OUT_OF_DATE, VCSState.OUT_OF_DATE_AND_MODIFIED);
+ }
+
+ protected static List<VCSEntry> generateFileStates(VCSConnexion handler, File root, int max, String prefix, VCSState... states) {
+ List<VCSEntry> datas = new ArrayList<VCSEntry>();
+ for (int i = 0, nbFiles = 1 + r.nextInt(max), size = states.length; i < nbFiles; i++) {
+ VCSEntry state = new VCSEntryImpl(handler, root.getName() + File.separator + prefix + "file" + i);
+ state.setState(states[r.nextInt(size)]);
+ datas.add(state);
+ }
+ return datas;
+ }
+}
1
0
r412 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:19:12 +0000 (Sun, 06 Apr 2008)
New Revision: 412
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Removed:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
move ui-pre-jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,112 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.ConfirmUIModel;
-
-import javax.swing.ListSelectionModel;
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-/** @author chemit */
-public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
-
-
- public ConfirmUIHandler() {
- super();
- //this.ui = new JConfirmUI(this);
- }
-
- /*public void setUi(AbstractConfirmUI ui) {
- this.ui = ui;
- }*/
-
- /*public ConfirmUIModel getModel() {
- return getUi().getModel();
- }*/
-
-
- public Class<AbstractConfirmUI> getUiClass() {
- return AbstractConfirmUI.class;
- }
-
- public Class<? super ConfirmUIModel> getModelClass() {
- return ConfirmUIModel.class;
- }
-
- public ListSelectionModel getSelectionModel() {
- return getUi().getContentTable().getSelectionModel();
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
-
- if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
- updateUI();
- return;
- }
-
- if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
- updateMessageUI();
- return;
- }
-
- throw new IllegalStateException("unimplemented property changed : " + evt);
- }
-
- protected void updateUI() {
- VCSAction action = getModel().getAction();
- getUi().getAccept().setText(action.getLibelle());
- getUi().getToolbar().setVisible(action.isCommit());
- getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
- }
-
- protected void updateMessageUI() {
- // update message history combo box ?
- getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
- }
-
- public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
-
- VCSAction action = getModel().getAction();
-
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
-
- if (action.isCommit()) {
- getModel().addCommitMessage(commitMessage);
-
- } else {
- commitMessage = null;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
- }
-
- getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
-
- // dispose ui
- getUi().dispose();
-
- }
-
-
-}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,92 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
-
- //protected AbstractDiffUI ui;
-
- public DiffUIHandler() {
- //this.ui = new JDiffUI(this);
- }
-
- /*public AbstractDiffUI getUi() {
- return ui;
- }*/
-
- /*public void setUi(AbstractDiffUI ui) {
- this.ui = ui;
- }
-
- public DiffUIModel getModel() {
- return ui.getModel();
- }*/
-
- public Class<AbstractDiffUI> getUiClass() {
- return AbstractDiffUI.class;
- }
-
- public Class<? super DiffUIModel> getModelClass() {
- return DiffUIModel.class;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
-
- String action = evt.getPropertyName();
- if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSEntry) evt.getNewValue());
- } else {
- super.propertyChange(evt);
- }
- }
-
- @Override
- public void doSelectLocation(VCSEntryLocation location) {
- super.doSelectLocation(location);
-
- }
-
- protected void initTab(VCSEntryLocation location) {
- //TODO
- }
-
- public void doSelectFile(VCSEntry model) {
- //TODO
- }
-
- public void doAction(VCSAction action, VCSEntry model) {
- //TODO
- }
-
- public void gotoNextDiff() {
- //TODO
- }
-
- public void gotoPreviousDiff() {
- //TODO
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,177 +0,0 @@
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-/** @author chemit */
-public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
-
- //protected AbstractSynchUI ui;
-
- public SynchUIHandler() {
- //this.ui = new JSynchUI(this);
- }
-
- public Class<AbstractSynchUI> getUiClass() {
- return AbstractSynchUI.class;
- }
-
- public Class<? super SynchUIModel> getModelClass() {
- return SynchUIModel.class;
- }
-
- /*public void setUi(AbstractSynchUI ui) {
- this.ui = ui;
- }
-
- public AbstractSynchUI getUi() {
- return ui;
- }*/
-
- /*public SynchUIModel getModel() {
- return ui.getModel();
- }*/
-
- /*public void doAllAction(VCSAction action) {
- doAction(action, false);
- }
-
- public void doSelectAction(VCSAction action) {
- doAction(action, true);
- }*/
-
- @Override
- public void doSelectLocation(VCSEntryLocation location) {
-
- super.doSelectLocation(location);
-
- VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : actions) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = actions.length > 0;
- getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
- getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
- getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
- getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
- getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
- getUi().getRefreshAll().setEnabled(hasActions);
- }
-
- public void doAction(VCSAction action, boolean useSelection) {
- AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
- log.info(action + " : " + model);
- ListSelectionModel selectionModel = getSelectionModel();
- if (action == VCSAction.REFRESH) {
- selectionModel.clearSelection();
- // do refresh of all states
- log.info("refresh :" + model.getRowCount());
- model.refresh(model.getEntries(), System.nanoTime());
- } else {
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
- if (entries.isEmpty()) {
- // nothing to do
- return;
- }
- if (action == VCSAction.DIFF) {
- // show diff ui
- return;
- }
- log.info("files to treate :" + entries.size());
-
- AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
-
- confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
-
- confirmUI.setVisible(true);
- //TODO SynchModel should listener for modification on ActionManagerQueue thread
- log.info("TODO refresh states for files...");
- }
- }
-
- protected void initTab(VCSEntryLocation location) {
- JTable table = getUi().getTable(location);
- AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
- table.setModel(fileStatesModel);
- table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
- AbstractVCSPopup popup = getUi().getPopup(location);
-
- popup.setDispatchAction(new VCSAbsractAction() {
- private static final long serialVersionUID = 8622118724992019898L;
-
- public void actionPerformed(ActionEvent e) {
- doAction(action, false);
- }
- });
- }
-
- protected static class ListMouseListener extends MouseAdapter {
-
- private final AbstractVCSEntriesTableModel model;
-
- private final ListSelectionModel selectionModel;
-
- private final JTable jTable;
- private final AbstractVCSPopup jPopupMenu;
-
- public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
- this.model = model;
- jPopupMenu = ui.getPopup(modelName);
- jTable = ui.getTable(modelName);
- selectionModel = jTable.getSelectionModel();
- }
-
- @Override
- public void mousePressed(MouseEvent e) {
- super.mousePressed(e);
- if (e.isPopupTrigger()) {
- initPopup(e.getX(), e.getY());
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent e) {
- super.mouseReleased(e);
- if (e.isPopupTrigger()) {
- initPopup(e.getX(), e.getY());
- }
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- // nothing to do
- }
-
- protected void initPopup(int x, int y) {
- if (!selectionModel.isSelectionEmpty()) {
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : model.getActions(selectionModel)) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = !acts.isEmpty();
- jPopupMenu.getDiff().setEnabled(hasActions && acts.contains("diff"));
- jPopupMenu.getUpdate().setEnabled(hasActions && acts.contains("update"));
- jPopupMenu.getCommit().setEnabled(hasActions && acts.contains("commit"));
- jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
- jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
- jPopupMenu.getRefresh().setEnabled(hasActions);
- jPopupMenu.pack();
- // display popup
- jPopupMenu.show(jTable, x, y);
- }
- }
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,156 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.util.StringUtil;
-import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.ui.handler.AbstractUIHandler;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-/**
- * Factory if VCS UI, using a cache.
- *
- * @author chemit
- */
-public class VCSUIFactory {
-
- static protected final Log log = LogFactory.getLog(VCSFactory.class);
-
- protected static VCSUIFactory instance;
-
- protected Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
- protected ServiceLoader<AbstractUI> loader;
-
-
- public static AbstractSynchUI newSynchUI() {
- SynchUIHandler result = getInstance().newHandler(SynchUIHandler.class);
- return result.getUi();
- }
-
- public static AbstractConfirmUI newConfirmUI() {
- ConfirmUIHandler result = getInstance().newHandler(ConfirmUIHandler.class);
- return result.getUi();
- }
-
- public static AbstractDiffUI newDiffUI() {
- DiffUIHandler result = getInstance().newHandler(DiffUIHandler.class);
- return result.getUi();
- }
-
- public void close() {
- if (cache != null) {
- cache.clear();
- cache = null;
- }
- if (loader != null) {
- loader.reload();
- loader = null;
- }
- }
-
- protected static VCSUIFactory getInstance() {
- if (instance == null) {
- instance = new VCSUIFactory();
- }
- return instance;
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- close();
- }
-
- protected synchronized Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
- if (cache == null) {
- cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
- }
- return cache;
- }
-
- protected synchronized ServiceLoader<AbstractUI> getLoader() {
- if (loader == null) {
- long t0 = System.nanoTime();
-
- loader = ServiceLoader.load(AbstractUI.class);
- int nb = 0;
- for (AbstractUI provider : loader) {
- log.info(provider.getName() + " [" + provider + ']');
- nb++;
- }
- log.info("found " + nb + " ui(s) in " + StringUtil.convertTime(t0, System.nanoTime()));
- }
- return loader;
- }
-
- @SuppressWarnings({"unchecked"})
- protected <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
- H result;
-
- result = (H) getInstance().getCache().get(klass);
-
- if (result == null) {
-
- try {
- // instance of handler
- result = klass.getConstructor().newInstance();
-
- // instance of model
- AbstractUIModel model = (AbstractUIModel) result.getModelClass().newInstance();
-
- // obtain intance of ui
- AbstractUI ui = getUI(result.getUiClass());
-
- // attach model to ui
- ui.setModel(model);
-
- // attach handler to ui
- ui.setHandler(result);
-
- // attach ui to handler
- result.setUi(ui);
-
- // init handler
- result.init();
-
- getCache().put(klass, result);
- } catch (Exception e) {
- throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
- }
- }
- return result;
- }
-
- @SuppressWarnings({"unchecked"})
- protected <U extends AbstractUI> U getUI(Class<U> klass) {
-
- for (AbstractUI ui : getLoader()) {
- if (klass.isAssignableFrom(ui.getClass())) {
- return (U) ui;
- }
- }
- throw new IllegalStateException("could not find ui " + klass);
- }
-
- protected VCSUIFactory() {
- }
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,112 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+
+/** @author chemit */
+public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
+
+
+ public ConfirmUIHandler() {
+ super();
+ //this.ui = new JConfirmUI(this);
+ }
+
+ /*public void setUi(AbstractConfirmUI ui) {
+ this.ui = ui;
+ }*/
+
+ /*public ConfirmUIModel getModel() {
+ return getUi().getModel();
+ }*/
+
+
+ public Class<AbstractConfirmUI> getUiClass() {
+ return AbstractConfirmUI.class;
+ }
+
+ public Class<? super ConfirmUIModel> getModelClass() {
+ return ConfirmUIModel.class;
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ return getUi().getContentTable().getSelectionModel();
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ updateMessageUI();
+ return;
+ }
+
+ throw new IllegalStateException("unimplemented property changed : " + evt);
+ }
+
+ protected void updateUI() {
+ VCSAction action = getModel().getAction();
+ getUi().getAccept().setText(action.getLibelle());
+ getUi().getToolbar().setVisible(action.isCommit());
+ getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
+ }
+
+ protected void updateMessageUI() {
+ // update message history combo box ?
+ getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
+ }
+
+ public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
+
+ VCSAction action = getModel().getAction();
+
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
+
+ if (action.isCommit()) {
+ getModel().addCommitMessage(commitMessage);
+
+ } else {
+ commitMessage = null;
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
+ }
+
+ getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
+
+ // dispose ui
+ getUi().dispose();
+
+ }
+
+
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,92 @@
+/**
+ * # #% 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.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
+
+ //protected AbstractDiffUI ui;
+
+ public DiffUIHandler() {
+ //this.ui = new JDiffUI(this);
+ }
+
+ /*public AbstractDiffUI getUi() {
+ return ui;
+ }*/
+
+ /*public void setUi(AbstractDiffUI ui) {
+ this.ui = ui;
+ }
+
+ public DiffUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ public Class<AbstractDiffUI> getUiClass() {
+ return AbstractDiffUI.class;
+ }
+
+ public Class<? super DiffUIModel> getModelClass() {
+ return DiffUIModel.class;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+
+ String action = evt.getPropertyName();
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
+ } else {
+ super.propertyChange(evt);
+ }
+ }
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+ super.doSelectLocation(location);
+
+ }
+
+ protected void initTab(VCSEntryLocation location) {
+ //TODO
+ }
+
+ public void doSelectFile(VCSEntry model) {
+ //TODO
+ }
+
+ public void doAction(VCSAction action, VCSEntry model) {
+ //TODO
+ }
+
+ public void gotoNextDiff() {
+ //TODO
+ }
+
+ public void gotoPreviousDiff() {
+ //TODO
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,177 @@
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.handler.VCSAbsractAction;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
+
+ //protected AbstractSynchUI ui;
+
+ public SynchUIHandler() {
+ //this.ui = new JSynchUI(this);
+ }
+
+ public Class<AbstractSynchUI> getUiClass() {
+ return AbstractSynchUI.class;
+ }
+
+ public Class<? super SynchUIModel> getModelClass() {
+ return SynchUIModel.class;
+ }
+
+ /*public void setUi(AbstractSynchUI ui) {
+ this.ui = ui;
+ }
+
+ public AbstractSynchUI getUi() {
+ return ui;
+ }*/
+
+ /*public SynchUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ /*public void doAllAction(VCSAction action) {
+ doAction(action, false);
+ }
+
+ public void doSelectAction(VCSAction action) {
+ doAction(action, true);
+ }*/
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
+ }
+
+ public void doAction(VCSAction action, boolean useSelection) {
+ AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
+ log.info(action + " : " + model);
+ ListSelectionModel selectionModel = getSelectionModel();
+ if (action == VCSAction.REFRESH) {
+ selectionModel.clearSelection();
+ // do refresh of all states
+ log.info("refresh :" + model.getRowCount());
+ model.refresh(model.getEntries(), System.nanoTime());
+ } else {
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
+ if (entries.isEmpty()) {
+ // nothing to do
+ return;
+ }
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ return;
+ }
+ log.info("files to treate :" + entries.size());
+
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+
+ confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
+
+ confirmUI.setVisible(true);
+ //TODO SynchModel should listener for modification on ActionManagerQueue thread
+ log.info("TODO refresh states for files...");
+ }
+ }
+
+ protected void initTab(VCSEntryLocation location) {
+ JTable table = getUi().getTable(location);
+ AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
+ table.setModel(fileStatesModel);
+ table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
+ AbstractVCSPopup popup = getUi().getPopup(location);
+
+ popup.setDispatchAction(new VCSAbsractAction() {
+ private static final long serialVersionUID = 8622118724992019898L;
+
+ public void actionPerformed(ActionEvent e) {
+ doAction(action, false);
+ }
+ });
+ }
+
+ protected static class ListMouseListener extends MouseAdapter {
+
+ private final AbstractVCSEntriesTableModel model;
+
+ private final ListSelectionModel selectionModel;
+
+ private final JTable jTable;
+ private final AbstractVCSPopup jPopupMenu;
+
+ public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
+ this.model = model;
+ jPopupMenu = ui.getPopup(modelName);
+ jTable = ui.getTable(modelName);
+ selectionModel = jTable.getSelectionModel();
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ super.mousePressed(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ super.mouseReleased(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ // nothing to do
+ }
+
+ protected void initPopup(int x, int y) {
+ if (!selectionModel.isSelectionEmpty()) {
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : model.getActions(selectionModel)) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = !acts.isEmpty();
+ jPopupMenu.getDiff().setEnabled(hasActions && acts.contains("diff"));
+ jPopupMenu.getUpdate().setEnabled(hasActions && acts.contains("update"));
+ jPopupMenu.getCommit().setEnabled(hasActions && acts.contains("commit"));
+ jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
+ jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
+ jPopupMenu.getRefresh().setEnabled(hasActions);
+ jPopupMenu.pack();
+ // display popup
+ jPopupMenu.show(jTable, x, y);
+ }
+ }
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,156 @@
+/**
+ * # #% 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.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.StringUtil;
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+/**
+ * Factory if VCS UI, using a cache.
+ *
+ * @author chemit
+ */
+public class VCSUIFactory {
+
+ static protected final Log log = LogFactory.getLog(VCSFactory.class);
+
+ protected static VCSUIFactory instance;
+
+ protected Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ protected ServiceLoader<AbstractUI> loader;
+
+
+ public static AbstractSynchUI newSynchUI() {
+ SynchUIHandler result = getInstance().newHandler(SynchUIHandler.class);
+ return result.getUi();
+ }
+
+ public static AbstractConfirmUI newConfirmUI() {
+ ConfirmUIHandler result = getInstance().newHandler(ConfirmUIHandler.class);
+ return result.getUi();
+ }
+
+ public static AbstractDiffUI newDiffUI() {
+ DiffUIHandler result = getInstance().newHandler(DiffUIHandler.class);
+ return result.getUi();
+ }
+
+ public void close() {
+ if (cache != null) {
+ cache.clear();
+ cache = null;
+ }
+ if (loader != null) {
+ loader.reload();
+ loader = null;
+ }
+ }
+
+ protected static VCSUIFactory getInstance() {
+ if (instance == null) {
+ instance = new VCSUIFactory();
+ }
+ return instance;
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ super.finalize();
+ close();
+ }
+
+ protected synchronized Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
+ if (cache == null) {
+ cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
+ }
+ return cache;
+ }
+
+ protected synchronized ServiceLoader<AbstractUI> getLoader() {
+ if (loader == null) {
+ long t0 = System.nanoTime();
+
+ loader = ServiceLoader.load(AbstractUI.class);
+ int nb = 0;
+ for (AbstractUI provider : loader) {
+ log.info(provider.getName() + " [" + provider + ']');
+ nb++;
+ }
+ log.info("found " + nb + " ui(s) in " + StringUtil.convertTime(t0, System.nanoTime()));
+ }
+ return loader;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ protected <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
+ H result;
+
+ result = (H) getInstance().getCache().get(klass);
+
+ if (result == null) {
+
+ try {
+ // instance of handler
+ result = klass.getConstructor().newInstance();
+
+ // instance of model
+ AbstractUIModel model = (AbstractUIModel) result.getModelClass().newInstance();
+
+ // obtain intance of ui
+ AbstractUI ui = getUI(result.getUiClass());
+
+ // attach model to ui
+ ui.setModel(model);
+
+ // attach handler to ui
+ ui.setHandler(result);
+
+ // attach ui to handler
+ result.setUi(ui);
+
+ // init handler
+ result.init();
+
+ getCache().put(klass, result);
+ } catch (Exception e) {
+ throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
+ }
+ }
+ return result;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ protected <U extends AbstractUI> U getUI(Class<U> klass) {
+
+ for (AbstractUI ui : getLoader()) {
+ if (klass.isAssignableFrom(ui.getClass())) {
+ return (U) ui;
+ }
+ }
+ throw new IllegalStateException("could not find ui " + klass);
+ }
+
+ protected VCSUIFactory() {
+ }
+
+}
1
0
r411 - in trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java: . org org/codelutin org/codelutin/vcs
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:18:56 +0000 (Sun, 06 Apr 2008)
New Revision: 411
Added:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/
Log:
move UITest to jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
1
0
r410 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:14:57 +0000 (Sun, 06 Apr 2008)
New Revision: 410
Modified:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
use default constructor for ui since we use ServiceLoader
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -14,43 +14,99 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+import java.util.List;
/** @author chemit */
-public class ConfirmUIHandler extends AbstractConfirmUIHandler {
+public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
- protected final AbstractConfirmUI ui;
public ConfirmUIHandler() {
- this.ui = new JConfirmUI(this);
+ super();
+ //this.ui = new JConfirmUI(this);
}
- public ConfirmUIModel getModel() {
- return ui.getModel();
+ /*public void setUi(AbstractConfirmUI ui) {
+ this.ui = ui;
+ }*/
+
+ /*public ConfirmUIModel getModel() {
+ return getUi().getModel();
+ }*/
+
+
+ public Class<AbstractConfirmUI> getUiClass() {
+ return AbstractConfirmUI.class;
}
- public AbstractConfirmUI getUi() {
- return ui;
+ public Class<? super ConfirmUIModel> getModelClass() {
+ return ConfirmUIModel.class;
}
public ListSelectionModel getSelectionModel() {
- return ui.getContentTable().getSelectionModel();
+ return getUi().getContentTable().getSelectionModel();
}
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ updateMessageUI();
+ return;
+ }
+
+ throw new IllegalStateException("unimplemented property changed : " + evt);
+ }
+
protected void updateUI() {
- VCSAction action = ui.getModel().getAction();
- ui.getAccept().setText(action.getLibelle());
- ui.getToolbar().setVisible(action.isCommit());
- ui.getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
+ VCSAction action = getModel().getAction();
+ getUi().getAccept().setText(action.getLibelle());
+ getUi().getToolbar().setVisible(action.isCommit());
+ getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
}
protected void updateMessageUI() {
// update message history combo box ?
- ui.getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
+ getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
}
+ public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
+
+ VCSAction action = getModel().getAction();
+
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
+
+ if (action.isCommit()) {
+ getModel().addCommitMessage(commitMessage);
+
+ } else {
+ commitMessage = null;
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
+ }
+
+ getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
+
+ // dispose ui
+ getUi().dispose();
+
+ }
+
+
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -17,26 +17,59 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.model.DiffUIModel;
+import java.beans.PropertyChangeEvent;
+
/** @author chemit */
-public class DiffUIHandler extends AbstractDiffUIHandler<JDiffUI> {
+public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
- protected final AbstractDiffUI ui;
+ //protected AbstractDiffUI ui;
public DiffUIHandler() {
- this.ui = new JDiffUI(this);
+ //this.ui = new JDiffUI(this);
}
- public JDiffUI getUi() {
- return (JDiffUI) ui;
+ /*public AbstractDiffUI getUi() {
+ return ui;
+ }*/
+
+ /*public void setUi(AbstractDiffUI ui) {
+ this.ui = ui;
}
public DiffUIModel getModel() {
return ui.getModel();
+ }*/
+
+ public Class<AbstractDiffUI> getUiClass() {
+ return AbstractDiffUI.class;
}
+ public Class<? super DiffUIModel> getModelClass() {
+ return DiffUIModel.class;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+
+ String action = evt.getPropertyName();
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
+ } else {
+ super.propertyChange(evt);
+ }
+ }
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+ super.doSelectLocation(location);
+
+ }
+
protected void initTab(VCSEntryLocation location) {
//TODO
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -3,7 +3,6 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
@@ -17,28 +16,59 @@
import java.util.List;
/** @author chemit */
-public class SynchUIHandler extends AbstractSynchUIHandler<JSynchUI> {
+public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
- protected final JSynchUI ui;
+ //protected AbstractSynchUI ui;
public SynchUIHandler() {
- this.ui = new JSynchUI(this);
+ //this.ui = new JSynchUI(this);
}
- public JSynchUI getUi() {
- return ui;
+ public Class<AbstractSynchUI> getUiClass() {
+ return AbstractSynchUI.class;
}
- public SynchUIModel getModel() {
- return ui.getModel();
+ public Class<? super SynchUIModel> getModelClass() {
+ return SynchUIModel.class;
}
- public void doAllAction(VCSAction action) {
+ /*public void setUi(AbstractSynchUI ui) {
+ this.ui = ui;
+ }
+
+ public AbstractSynchUI getUi() {
+ return ui;
+ }*/
+
+ /*public SynchUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ /*public void doAllAction(VCSAction action) {
doAction(action, false);
}
public void doSelectAction(VCSAction action) {
doAction(action, true);
+ }*/
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
}
public void doAction(VCSAction action, boolean useSelection) {
@@ -61,6 +91,7 @@
return;
}
log.info("files to treate :" + entries.size());
+
AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
@@ -75,14 +106,14 @@
JTable table = getUi().getTable(location);
AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
table.setModel(fileStatesModel);
- table.addMouseListener(new ListMouseListener(ui, fileStatesModel, location));
- AbstractVCSPopup jvcsPopup = getUi().getPopup(location);
- //jvcsPopup.setDispatchAction(new VCSPopupAction(this, location));
- jvcsPopup.setDispatchAction(new VCSAbsractAction() {
+ table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
+ AbstractVCSPopup popup = getUi().getPopup(location);
+
+ popup.setDispatchAction(new VCSAbsractAction() {
private static final long serialVersionUID = 8622118724992019898L;
public void actionPerformed(ActionEvent e) {
- doSelectAction(action);
+ doAction(action, false);
}
});
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -14,10 +14,16 @@
*/
package org.codelutin.vcs.ui;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.StringUtil;
+import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
import java.util.HashMap;
import java.util.Map;
+import java.util.ServiceLoader;
/**
* Factory if VCS UI, using a cache.
@@ -26,59 +32,125 @@
*/
public class VCSUIFactory {
- protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ static protected final Log log = LogFactory.getLog(VCSFactory.class);
- protected static AbstractTabUI synchUI;
- protected static AbstractDiffUI diffUI;
- protected static AbstractConfirmUI confirmUI;
+ protected static VCSUIFactory instance;
+ protected Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ protected ServiceLoader<AbstractUI> loader;
+
+
public static AbstractSynchUI newSynchUI() {
- SynchUIHandler result = newHandler(SynchUIHandler.class);
+ SynchUIHandler result = getInstance().newHandler(SynchUIHandler.class);
return result.getUi();
}
- public static AbstractDiffUI newDiffUI() {
- DiffUIHandler result = newHandler(DiffUIHandler.class);
+ public static AbstractConfirmUI newConfirmUI() {
+ ConfirmUIHandler result = getInstance().newHandler(ConfirmUIHandler.class);
return result.getUi();
}
- public static AbstractConfirmUI newConfirmUI() {
- ConfirmUIHandler result = newHandler(ConfirmUIHandler.class);
+ public static AbstractDiffUI newDiffUI() {
+ DiffUIHandler result = getInstance().newHandler(DiffUIHandler.class);
return result.getUi();
}
- public static void close() {
+ public void close() {
if (cache != null) {
cache.clear();
+ cache = null;
}
- cache = null;
+ if (loader != null) {
+ loader.reload();
+ loader = null;
+ }
}
- protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
+ protected static VCSUIFactory getInstance() {
+ if (instance == null) {
+ instance = new VCSUIFactory();
+ }
+ return instance;
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ super.finalize();
+ close();
+ }
+
+ protected synchronized Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
if (cache == null) {
cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
}
return cache;
}
+ protected synchronized ServiceLoader<AbstractUI> getLoader() {
+ if (loader == null) {
+ long t0 = System.nanoTime();
+
+ loader = ServiceLoader.load(AbstractUI.class);
+ int nb = 0;
+ for (AbstractUI provider : loader) {
+ log.info(provider.getName() + " [" + provider + ']');
+ nb++;
+ }
+ log.info("found " + nb + " ui(s) in " + StringUtil.convertTime(t0, System.nanoTime()));
+ }
+ return loader;
+ }
+
@SuppressWarnings({"unchecked"})
- protected static <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
+ protected <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
H result;
- result = (H) getCache().get(klass);
+
+ result = (H) getInstance().getCache().get(klass);
+
if (result == null) {
+
try {
- result = klass.newInstance();
+ // instance of handler
+ result = klass.getConstructor().newInstance();
+
+ // instance of model
+ AbstractUIModel model = (AbstractUIModel) result.getModelClass().newInstance();
+
+ // obtain intance of ui
+ AbstractUI ui = getUI(result.getUiClass());
+
+ // attach model to ui
+ ui.setModel(model);
+
+ // attach handler to ui
+ ui.setHandler(result);
+
+ // attach ui to handler
+ result.setUi(ui);
+
+ // init handler
result.init();
+
getCache().put(klass, result);
- } catch (InstantiationException e) {
+ } catch (Exception e) {
throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
- } catch (IllegalAccessException e) {
- throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
}
}
return result;
}
+ @SuppressWarnings({"unchecked"})
+ protected <U extends AbstractUI> U getUI(Class<U> klass) {
+
+ for (AbstractUI ui : getLoader()) {
+ if (klass.isAssignableFrom(ui.getClass())) {
+ return (U) ui;
+ }
+ }
+ throw new IllegalStateException("could not find ui " + klass);
+ }
+
protected VCSUIFactory() {
}
+
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -17,6 +17,7 @@
import jaxx.runtime.swing.Table;
import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
import javax.swing.JButton;
import javax.swing.JLabel;
@@ -48,13 +49,7 @@
public abstract JButton getAccept();
- public AbstractConfirmUI() {
- }
- public AbstractConfirmUI(AbstractConfirmUIHandler handler) {
- super(handler, new ConfirmUIModel());
- }
-
@Override
protected AbstractConfirmUIHandler getHandler() {
return (AbstractConfirmUIHandler) super.getHandler();
@@ -65,14 +60,16 @@
return (ConfirmUIModel) super.getModel();
}
+ @Override
+ public void setModel(AbstractUIModel model) {
+ super.setModel(model);
+ getContentTable().setModel(model.getEntriesModel());
+ }
+
public void doAccept() {
getHandler().doAction(getCommitMessage().getText(), getModel().getEntriesModel());
}
- protected void showLastMessages() {
-
- }
-
@Override
public void setVisible(boolean b) {
if (b) {
@@ -80,4 +77,8 @@
}
super.setVisible(b);
}
+
+ protected void showLastMessages() {
+ //TODO
+ }
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -28,14 +28,6 @@
public abstract JButton getPreviousDiff();
- public AbstractDiffUI() {
- super();
- }
-
- public AbstractDiffUI(AbstractTabUIHandler handler) {
- super(handler, new DiffUIModel());
- }
-
@Override
public DiffUIModel getModel() {
return (DiffUIModel) model;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -43,14 +43,6 @@
public abstract AbstractVCSPopup getRemotePopup();
- public AbstractSynchUI() {
- super();
- }
-
- public AbstractSynchUI(AbstractSynchUIHandler handler) {
- super(handler, new SynchUIModel());
- }
-
@Override
public SynchUIModel getModel() {
return (SynchUIModel) model;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -20,13 +20,14 @@
/** @author chemit */
public class AbstractUI extends javax.swing.JDialog {
- protected final AbstractUIModel model;
+ protected AbstractUIModel model;
- protected final AbstractUIHandler handler;
+ protected AbstractUIHandler handler;
public AbstractUI() {
// Jaxx always generate the default constructor, so need it, but DO NOT USE IT!
- throw new IllegalStateException("the default constructor can NOT be used!");
+ //throw new IllegalStateException("the default constructor can NOT be used!");
+ UIHelper.setQuitAction(this);
}
public AbstractUI(AbstractUIHandler handler, AbstractUIModel model) {
@@ -43,5 +44,12 @@
return handler;
}
+ public void setModel(AbstractUIModel model) {
+ this.model = model;
+ }
+ public void setHandler(AbstractUIHandler handler) {
+ this.handler = handler;
+ }
+
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -21,7 +21,7 @@
import java.awt.event.ActionEvent;
/** @author chemit */
-public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
+public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {
protected VCSAbsractAction dispatchAction;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.AbstractUI;
+import org.codelutin.vcs.ui.AbstractConfirmUI;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
@@ -28,7 +28,7 @@
*
* @author chemit
*/
-public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractUI> {
+public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
protected abstract void updateUI();
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -30,12 +30,28 @@
protected static Log log = LogFactory.getLog(AbstractUIHandler.class);
- public abstract M getModel();
+ private U ui;
- public abstract U getUi();
+ public abstract Class<? super U> getUiClass();
+ public abstract Class<? super M> getModelClass();
+
public abstract ListSelectionModel getSelectionModel();
+ @SuppressWarnings({"unchecked"})
+ public M getModel() {
+ return (M) getUi().getModel();
+ }
+
+ public U getUi() {
+ return ui;
+ }
+
+ public void setUi(U ui) {
+ this.ui = ui;
+ }
+
+
public void init() {
if (getModel() == null) {
throw new IllegalStateException("no model was defined for " + this);
1
0
r409 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:14:47 +0000 (Sun, 06 Apr 2008)
New Revision: 409
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
Log:
use default constructor for ui since we use ServiceLoader
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 17:14:14 UTC (rev 408)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 17:14:47 UTC (rev 409)
@@ -1,11 +1,11 @@
<AbstractConfirmUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
resizable='false' height='300' width='400'>
<style source="common.css"/>
- <script>
+ <!--script>
public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
super(handler);
}
- </script>
+ </script-->
<Table>
<row fill='both'>
<cell fill='both'>
@@ -44,7 +44,8 @@
<row>
<cell fill='both' weightx='1' weighty='1'>
<JScrollPane id='content' styleClass='confirmScroll'>
- <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getEntriesModel()}"/>
+ <JTable id="contentTable" styleClass='confirmTable'/>
+ <!--JTable id="contentTable" styleClass='confirmTable' model="{getModel().getEntriesModel()}"/-->
</JScrollPane>
</cell>
</row>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 17:14:14 UTC (rev 408)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 17:14:47 UTC (rev 409)
@@ -1,14 +1,13 @@
<AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
- <script>
+ <!--script>
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
- public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
+ /*public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
super(handler);
- }
- </script>
-
+ }*/
+ </script-->
<java.awt.CardLayout id='cardLayout'/>
<Table>
@@ -18,42 +17,42 @@
<JToggleButton id='allTab' selected='true' buttonGroup='tabs' mnemonic="A"
toolTipText="lutinvcs.tabs.diff.tooltip.all"
icon='{createImageIcon("remote_vs_local.png")}'
- onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.ALL)'/>
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' mnemonic="L"
toolTipText="lutinvcs.tabs.diff.tooltip.local"
icon='{createImageIcon("local_vs_local.png")}'
- onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.LOCAL)'/>
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' mnemonic="R"
icon='{createImageIcon("remote_vs_remote.png")}'
toolTipText="lutinvcs.tabs.diff.tooltip.remote"
- onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.REMOTE)'/>
<JButton id='nextDiff' toolTipText="lutinvcs.action.tooltip.nextDiff"
icon='{createImageIcon("diff-next.png")}' onActionPerformed='gotoNextDiff()'/>
<JButton id='previousDiff' toolTipText="lutinvcs.action.tooltip.previousDiff"
- icon='{createImageIcon("diff-previous.png")}' onActionPerformed='gotoPreviousDiff()'/>
+ icon='{createImageIcon("diff-prev.png")}' onActionPerformed='gotoPreviousDiff()'/>
<JButton id='refresh' toolTipText="lutinvcs.action.tooltip.refresh"
icon='{createImageIcon("autoRefresh.png")}'
- onActionPerformed='doAction(VCSAction.REFRESH)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REFRESH)'/>
<JButton id='update' toolTipText="lutinvcs.action.tooltip.update"
icon='{createImageIcon("update.png")}'
- onActionPerformed='doAction(VCSAction.UPDATE)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.UPDATE)'/>
<JButton id='commit' toolTipText="lutinvcs.action.tooltip.commit"
icon='{createImageIcon("commit.png")}'
- onActionPerformed='doAction(VCSAction.COMMIT)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.COMMIT)'/>
<JButton id='revert' toolTipText="lutinvcs.action.tooltip.revert"
icon='{createImageIcon("rollback.png")}'
- onActionPerformed='doAction(VCSAction.REVERT)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REVERT)'/>
<JButton id='delete' toolTipText="lutinvcs.action.tooltip.delete"
icon='{createImageIcon("remove.png")}'
- onActionPerformed='doAction(VCSAction.DELETE)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.DELETE)'/>
</JToolBar>
</cell>
</row>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 17:14:14 UTC (rev 408)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 17:14:47 UTC (rev 409)
@@ -1,14 +1,13 @@
<AbstractSynchUI title='lutinvcs.synch.title' modal="true" defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
- <script>
+ <!--script>
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
- public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
+ /*public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
super(handler);
- }
- </script>
-
+ }*/
+ </script-->
<java.awt.CardLayout id='cardLayout'/>
<JVCSPopup id="allPopup"/>
@@ -22,38 +21,39 @@
<JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
- onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.ALL)'/>
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local'
mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local"
- onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.LOCAL)'/>
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote'
mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote"
- onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.REMOTE)'/>
<JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll"
icon='{createImageIcon("autoRefresh.png")}'
- onActionPerformed='doAction(VCSAction.REFRESH,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REFRESH,false)'/>
<JButton id='diffAll' toolTipText="lutinvcs.action.tooltip.diffAll"
- icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,false)'/>
+ icon='{createImageIcon("diff.png")}'
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.DIFF,false)'/>
<JButton id='updateAll' toolTipText="lutinvcs.action.tooltip.updateAll"
icon='{createImageIcon("update.png")}'
- onActionPerformed='doAction(VCSAction.UPDATE,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.UPDATE,false)'/>
<JButton id='commitAll' toolTipText="lutinvcs.action.tooltip.commitAll"
icon='{createImageIcon("commit.png")}'
- onActionPerformed='doAction(VCSAction.COMMIT,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.COMMIT,false)'/>
<JButton id='revertAll' toolTipText="lutinvcs.action.tooltip.revertAll"
icon='{createImageIcon("rollback.png")}'
- onActionPerformed='doAction(VCSAction.REVERT,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REVERT,false)'/>
<JButton id='deleteAll' toolTipText="lutinvcs.action.tooltip.deleteAll"
icon='{createImageIcon("remove.png")}'
- onActionPerformed='doAction(VCSAction.DELETE,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.DELETE,false)'/>
</JToolBar>
</cell>
</row>
1
0
r408 - in trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources: . META-INF META-INF/services
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:14:14 +0000 (Sun, 06 Apr 2008)
New Revision: 408
Added:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI
Log:
add ui from jaxx as service :)
Added: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI 2008-04-06 17:14:14 UTC (rev 408)
@@ -0,0 +1,3 @@
+org.codelutin.vcs.ui.JConfirmUI
+org.codelutin.vcs.ui.JSynchUI
+org.codelutin.vcs.ui.JDiffUI
\ No newline at end of file
1
0
r407 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 15:16:51 +0000 (Sun, 06 Apr 2008)
New Revision: 407
Removed:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
Log:
improve ui design
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -45,7 +45,7 @@
VCSAction action = ui.getModel().getAction();
ui.getAccept().setText(action.getLibelle());
ui.getToolbar().setVisible(action.isCommit());
- ui.getHandler().getSelectionModel().setSelectionInterval(0, getModel().getModel().getRowCount() - 1);
+ ui.getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
}
protected void updateMessageUI() {
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -4,11 +4,13 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
+import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@@ -32,7 +34,15 @@
}
public void doAllAction(VCSAction action) {
- AbstractVCSEntriesTableModel model = getModel().getModel();
+ doAction(action, false);
+ }
+
+ public void doSelectAction(VCSAction action) {
+ doAction(action, true);
+ }
+
+ public void doAction(VCSAction action, boolean useSelection) {
+ AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
log.info(action + " : " + model);
ListSelectionModel selectionModel = getSelectionModel();
if (action == VCSAction.REFRESH) {
@@ -41,7 +51,7 @@
log.info("refresh :" + model.getRowCount());
model.refresh(model.getEntries(), System.nanoTime());
} else {
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(null));
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
if (entries.isEmpty()) {
// nothing to do
return;
@@ -63,11 +73,18 @@
protected void initTab(VCSEntryLocation location) {
JTable table = getUi().getTable(location);
- AbstractVCSEntriesTableModel fileStatesModel = getModel().getModel();
+ AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
table.setModel(fileStatesModel);
table.addMouseListener(new ListMouseListener(ui, fileStatesModel, location));
AbstractVCSPopup jvcsPopup = getUi().getPopup(location);
- jvcsPopup.setDispatchAction(new VCSPopupAction(ui, location));
+ //jvcsPopup.setDispatchAction(new VCSPopupAction(this, location));
+ jvcsPopup.setDispatchAction(new VCSAbsractAction() {
+ private static final long serialVersionUID = 8622118724992019898L;
+
+ public void actionPerformed(ActionEvent e) {
+ doSelectAction(action);
+ }
+ });
}
protected static class ListMouseListener extends MouseAdapter {
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -1,70 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-import java.util.List;
-
-/**
- * Action of a clik inside the popup menu
- *
- * @author chemit
- */
-public class VCSPopupAction extends VCSAbsractAction {
- private static final long serialVersionUID = -1983061535956510913L;
-
- protected VCSEntryLocation location;
- protected transient ListSelectionModel selectionModel;
-
- protected transient AbstractTabUI ui;
-
- protected AbstractVCSEntriesTableModel tableModel;
-
- public VCSPopupAction(AbstractTabUI ui, VCSEntryLocation location) {
- super();
- this.ui = ui;
- this.location = location;
- //this.selectionModel = ui.getHandler().getSelectionModel();
- this.selectionModel = ui.getTable(location).getSelectionModel();
- tableModel = ui.getModel().getModel();
- }
-
- public void actionPerformed(ActionEvent e) {
- // select only lines for this action inside already selected lines
- List<VCSEntry> entries = tableModel.filter(action, tableModel.getDisplayedEntries(selectionModel));
- log.info("action: " + action + ", files to treate :" + entries.size() + " " + selectionModel);
- if (action == VCSAction.DIFF) {
- // show diff ui
- ui.getModel().refresh(entries);
-
- } else if (action == VCSAction.REFRESH) {
- // refresh ui, and update list if needed
-
- } else {
- // show confirm action ui
- AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
- confirmUI.getModel().init(action, tableModel.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
- confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, entries.size() - 1);
- confirmUI.setVisible(true);
- }
- }
-}
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 15:16:51 UTC (rev 407)
@@ -2,12 +2,9 @@
resizable='false' height='300' width='400'>
<style source="common.css"/>
<script>
- import org.codelutin.vcs.type.VCSAction;
-
public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
super(handler);
}
-
</script>
<Table>
<row fill='both'>
@@ -27,8 +24,7 @@
<cell fill='both'/>
</row>
</Table>
- <JButton id='lastMessages'
- toolTipText="lutinvcs.action.tooltip.lastMessages"
+ <JButton id='lastMessages' toolTipText="lutinvcs.action.tooltip.lastMessages"
icon='{createImageIcon("recent_msgs.png")}'
onActionPerformed='showLastMessages()'/>
</JToolBar>
@@ -48,7 +44,7 @@
<row>
<cell fill='both' weightx='1' weighty='1'>
<JScrollPane id='content' styleClass='confirmScroll'>
- <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getModel()}"/>
+ <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getEntriesModel()}"/>
</JScrollPane>
</cell>
</row>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 15:16:51 UTC (rev 407)
@@ -60,17 +60,14 @@
<row fill='both'>
<cell fill='both' weighty='1' weightx='2'>
<JPanel id='preview' layout='{cardLayout}'>
- <JScrollPane id='allContent' styleClass='diffScroll' constraints='"modelSynchAll"'>
- <JTable id="allTable" styleClass='diffTable'
- onMouseClicked="selectFile(allTable)"/>
+ <JScrollPane id='allContent' styleClass='diffScroll' constraints='"taball"'>
+ <JTable id="allTable" styleClass='diffTable' onMouseClicked="selectFile()"/>
</JScrollPane>
- <JScrollPane id='localContent' styleClass='diffScroll' constraints='"modelSynchLocal"'>
- <JTable id="localTable" styleClass='diffTable'
- onMouseClicked="selectFile(localTable)"/>
+ <JScrollPane id='localContent' styleClass='diffScroll' constraints='"tablocal"'>
+ <JTable id="localTable" styleClass='diffTable' onMouseClicked="selectFile()"/>
</JScrollPane>
- <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"modelSynchRemote"'
- onMouseClicked="selectFile(remoteTable)">
- <JTable id="remoteTable" styleClass='diffTable'/>
+ <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"tabremote"'>
+ <JTable id="remoteTable" styleClass='diffTable' onMouseClicked="selectFile()"/>
</JScrollPane>
</JPanel>
</cell>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 15:16:51 UTC (rev 407)
@@ -1,5 +1,4 @@
-<AbstractSynchUI title='lutinvcs.synch.title' modal="true" id='synchui'
- defaultCloseOperation='DISPOSE_ON_CLOSE'>
+<AbstractSynchUI title='lutinvcs.synch.title' modal="true" defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
@@ -8,65 +7,66 @@
public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
super(handler);
}
- //add(table);
</script>
<java.awt.CardLayout id='cardLayout'/>
+ <JVCSPopup id="allPopup"/>
+ <JVCSPopup id="localPopup"/>
+ <JVCSPopup id="remotePopup"/>
<Table id='table'>
<row fill='both'>
<cell fill='both' weightx='1'>
<JToolBar>
- <!--JPopupMenu enabled='false'/-->
- <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
+
<JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
+
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local'
mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local"
onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
+
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote'
mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote"
onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
<JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll"
icon='{createImageIcon("autoRefresh.png")}'
- onActionPerformed='doAllAction(VCSAction.REFRESH)'/>
+ onActionPerformed='doAction(VCSAction.REFRESH,false)'/>
<JButton id='diffAll' toolTipText="lutinvcs.action.tooltip.diffAll"
- icon='{createImageIcon("diff.png")}' onActionPerformed='doAllAction(VCSAction.DIFF)'/>
+ icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,false)'/>
<JButton id='updateAll' toolTipText="lutinvcs.action.tooltip.updateAll"
icon='{createImageIcon("update.png")}'
- onActionPerformed='doAllAction(VCSAction.UPDATE)'/>
+ onActionPerformed='doAction(VCSAction.UPDATE,false)'/>
<JButton id='commitAll' toolTipText="lutinvcs.action.tooltip.commitAll"
icon='{createImageIcon("commit.png")}'
- onActionPerformed='doAllAction(VCSAction.COMMIT)'/>
+ onActionPerformed='doAction(VCSAction.COMMIT,false)'/>
<JButton id='revertAll' toolTipText="lutinvcs.action.tooltip.revertAll"
icon='{createImageIcon("rollback.png")}'
- onActionPerformed='doAllAction(VCSAction.REVERT)'/>
+ onActionPerformed='doAction(VCSAction.REVERT,false)'/>
<JButton id='deleteAll' toolTipText="lutinvcs.action.tooltip.deleteAll"
icon='{createImageIcon("remove.png")}'
- onActionPerformed='doAllAction(VCSAction.DELETE)'/>
+ onActionPerformed='doAction(VCSAction.DELETE,false)'/>
</JToolBar>
</cell>
</row>
<row fill='both'>
<cell fill='both' weighty='1' weightx='2'>
<JPanel id='preview' layout='{cardLayout}'>
- <JScrollPane id='allContent' styleClass='updateScroll' constraints='"modelSynchAll"'>
+ <JScrollPane id='allContent' styleClass='updateScroll' constraints='"taball"'>
<JTable id="allTable" styleClass='updateTable'/>
</JScrollPane>
- <JScrollPane id='localContent' styleClass='updateScroll' constraints='"modelSynchLocal"'>
+ <JScrollPane id='localContent' styleClass='updateScroll' constraints='"tablocal"'>
<JTable id="localTable" styleClass='updateTable'/>
</JScrollPane>
- <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"modelSynchRemote"'>
+ <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"tabremote"'>
<JTable id="remoteTable" styleClass='updateTable'/>
</JScrollPane>
</JPanel>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,8 +16,6 @@
import jaxx.runtime.swing.Table;
import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
-import org.codelutin.vcs.ui.handler.AbstractUIHandler;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import javax.swing.JButton;
@@ -68,10 +66,18 @@
}
public void doAccept() {
- getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
+ getHandler().doAction(getCommitMessage().getText(), getModel().getEntriesModel());
}
protected void showLastMessages() {
}
+
+ @Override
+ public void setVisible(boolean b) {
+ if (b) {
+ getAccept().setEnabled(getModel().getEntriesModel().getRowCount() > 0);
+ }
+ super.setVisible(b);
+ }
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -20,7 +20,6 @@
import org.codelutin.vcs.ui.model.DiffUIModel;
import javax.swing.JButton;
-import javax.swing.JTable;
/** @author chemit */
public abstract class AbstractDiffUI extends AbstractTabUI {
@@ -37,16 +36,18 @@
super(handler, new DiffUIModel());
}
+ @Override
public DiffUIModel getModel() {
return (DiffUIModel) model;
}
+ @Override
protected AbstractDiffUIHandler getHandler() {
return (AbstractDiffUIHandler) handler;
}
- protected void selectFile(JTable table) {
- getModel().setFileModel(model.getModel().getDisplayedEntries(table.getSelectionModel()).get(0));
+ protected void selectFile() {
+ getModel().setFileModel(model.getEntriesModel().getDisplayedEntries(getHandler().getSelectionModel()).get(0));
}
protected void doAction(VCSAction action) {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -20,7 +20,6 @@
import org.codelutin.vcs.ui.model.SynchUIModel;
import javax.swing.JButton;
-import java.awt.CardLayout;
/** @author chemit */
public abstract class AbstractSynchUI extends AbstractTabUI {
@@ -52,18 +51,16 @@
super(handler, new SynchUIModel());
}
+ @Override
public SynchUIModel getModel() {
return (SynchUIModel) model;
}
+ @Override
protected AbstractSynchUIHandler getHandler() {
return (AbstractSynchUIHandler) handler;
}
- protected void doAllAction(VCSAction action) {
- getModel().doAllAction(action);
- }
-
public AbstractVCSPopup getPopup(VCSEntryLocation modelName) {
switch (modelName) {
case ALL:
@@ -77,4 +74,8 @@
}
throw new IllegalStateException("no popup found for " + modelName);
}
+
+ protected void doAction(VCSAction action, boolean useSelection) {
+ getHandler().doAction(action, useSelection);
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -49,15 +49,14 @@
public abstract CardLayout getCardLayout();
- public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
- super(handler, model);
- }
-
public AbstractTabUI() {
- // for jaxx but never used
super();
}
+ public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
+ super(handler, model);
+ }
+
public AbstractTabUIModel getModel() {
return (AbstractTabUIModel) model;
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -14,8 +14,8 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.type.VCSAction;
import javax.swing.JMenuItem;
import java.awt.event.ActionEvent;
@@ -46,4 +46,5 @@
ActionEvent e = new ActionEvent(item, 1, action.name());
dispatchAction.actionPerformed(e);
}
+
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -14,11 +14,11 @@
*/
package org.codelutin.vcs.ui;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JRootPane;
-import javax.swing.Action;
-import javax.swing.AbstractAction;
-import javax.swing.JComponent;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
@@ -28,9 +28,9 @@
* @author chemit
*/
public class UIHelper {
+
public static void setQuitAction(final JDialog ui) {
JRootPane rootPane = ui.getRootPane();
- //rootPane.setDefaultButton(accept);
Action quitAction = new AbstractAction("quit") {
private static final long serialVersionUID = -869095664995763057L;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -34,6 +34,7 @@
TagManager.registerDefaultNamespace("AbstractSynchUI", "org.codelutin.vcs.ui.*");
TagManager.registerDefaultNamespace("AbstractDiffUI", "org.codelutin.vcs.ui.*");
TagManager.registerDefaultNamespace("AbstractVCSPopup", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("JVCSPopup", "org.codelutin.vcs.ui.*");
}
}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -1,67 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import static org.codelutin.i18n.I18n.n_;
-
-/** @author chemit */
-public class VCSUIConstants {
-
- /** columns names for a simple table model with module, file and status */
- public static final String[] SIMPLE_COLUMNS_NAMES = new String[]{
- n_("lutinvcs.module"),
- n_("lutinvcs.file"),
- n_("lutinvcs.status")
- };
-
- /** model name for synchronize ui */
- public static final String SYNCH_MODEL_PROPERTY = "modelSynch";
-
- /** model name for confirm ui */
- public static final String CONFIRM_MODEL_PROPERTY = "modelConfirm";
-
- /** model name for diff ui */
- public static final String DIFF_MODEL_PROPERTY = "modelConfirm";
-
- public static final String ACTION_PROPERTY_CHANGED = "action";
-
- public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage";
-
- public static final String FILE_PROPERTY_CHANGED = "file";
-
- public static final String NEXT_DIFF_PROPERTY_CHANGED = "nextDiff";
-
- public static final String PREVIOUS_DIFF_PROPERTY_CHANGED = "previousDiff";
-
- public static final String REFRESH_PROPERTY_CHANGED = "refresh";
-
- public static final String TAB_PROPERTY_CHANGED = "tab";
-
- public static final String DIFF_ALL_PROPERTY_CHANGED = "diffAll";
-
- public static final String COMMIT_ALL_PROPERTY_CHANGED = "commitAll";
-
- public static final String UPDATE_ALL_PROPERTY_CHANGED = "updateAll";
-
- public static final String REVERT_ALL_PROPERTY_CHANGED = "revertAll";
-
- public static final String DIFF_PROPERTY_CHANGED = "diff";
-
- public static final String COMMIT_PROPERTY_CHANGED = "commit";
-
- public static final String UPDATE_PROPERTY_CHANGED = "update";
-
- public static final String REVERT_PROPERTY_CHANGED = "revert";
-}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -17,7 +17,6 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.AbstractUI;
-import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
@@ -41,12 +40,12 @@
}
String action = evt.getPropertyName();
- if (VCSUIConstants.ACTION_PROPERTY_CHANGED.equals(action)) {
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
updateUI();
return;
}
- if (VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
updateMessageUI();
return;
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -18,7 +18,6 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.AbstractDiffUI;
-import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.DiffUIModel;
import java.beans.PropertyChangeEvent;
@@ -32,7 +31,7 @@
//}
String action = evt.getPropertyName();
- if (VCSUIConstants.FILE_PROPERTY_CHANGED.equals(action)) {
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
doSelectFile((VCSEntry) evt.getNewValue());
} else {
super.propertyChange(evt);
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -26,13 +26,13 @@
/** @author chemit */
public abstract class AbstractSynchUIHandler<U extends AbstractSynchUI> extends AbstractTabUIHandler<SynchUIModel, U> {
- public abstract void doAllAction(VCSAction action);
+ public abstract void doAction(VCSAction action, boolean useSelect);
public void doSelectLocation(VCSEntryLocation location) {
super.doSelectLocation(location);
- VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
List<String> acts = new ArrayList<String>();
for (VCSAction action : actions) {
acts.add(action.name().toLowerCase());
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,7 +16,6 @@
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.AbstractTabUI;
-import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractTabUIModel;
import javax.swing.ListSelectionModel;
@@ -45,14 +44,14 @@
//}
String action = evt.getPropertyName();
- if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
+ if (AbstractTabUIModel.LOCATION_PROPERTY_CHANGED.equals(action)) {
doSelectLocation((VCSEntryLocation) evt.getNewValue());
}
}
public void doSelectLocation(VCSEntryLocation location) {
log.info(location);
- getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
+ getUi().getCardLayout().show(getUi().getPreview(), "tab" + location.name().toLowerCase());
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -44,7 +44,7 @@
}
public VCSEntryLocation getLocation() {
- return getModel().getModel().getLocation();
+ return getModel().getEntriesModel().getLocation();
}
protected VCSActionManager getActionManager() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -15,19 +15,20 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
/**
- * Model of a repository
+ * Abstract for a dialog with location information (says one tab by location type (except UNKNOW type of course...)
*
* @author chemit
*/
public class AbstractTabUIModel extends AbstractUIModel {
+ public static final String LOCATION_PROPERTY_CHANGED = "location";
+
public void setLocation(VCSEntryLocation location) {
- VCSEntryLocation oldLocation = getModel().getLocation();
- getModel().setLocation(location);
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
+ VCSEntryLocation oldLocation = getEntriesModel().getLocation();
+ getEntriesModel().setLocation(location);
+ firePropertyChange(LOCATION_PROPERTY_CHANGED, oldLocation, location);
}
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -18,10 +18,8 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.type.VCSEntryLocation;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -33,48 +31,36 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log = LogFactory.getLog(AbstractUIModel.class);
- /** current action to be fired */
- protected VCSAction action;
/** support for change properties support */
protected PropertyChangeSupport changeSupport;
- protected final AbstractVCSEntriesTableModel model;
+ protected final AbstractVCSEntriesTableModel entriesModel;
protected AbstractUIModel() {
- model = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
+ entriesModel = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
}
- public AbstractVCSEntriesTableModel getModel() {
- return model;
+ public AbstractVCSEntriesTableModel getEntriesModel() {
+ return entriesModel;
}
public void populate(VCSConnexion connexion) throws VCSException {
- getModel().populate(connexion, System.nanoTime());
+ getEntriesModel().populate(connexion, System.nanoTime());
}
public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location) throws VCSException {
- getModel().populate(connexion, relativeLocalPaths, location, System.nanoTime());
+ getEntriesModel().populate(connexion, relativeLocalPaths, location, System.nanoTime());
}
public void populate(VCSEntryLocation location, VCSEntry[] datas) {
- getModel().populate(location, datas);
+ getEntriesModel().populate(location, datas);
}
public void refresh(List<VCSEntry> entries) {
- getModel().refresh(entries, System.nanoTime());
+ getEntriesModel().refresh(entries, System.nanoTime());
}
- public VCSAction getAction() {
- return action;
- }
-
- public void setAction(VCSAction action) {
- VCSAction oldAction = this.action;
- this.action = action;
- firePropertyChange(VCSUIConstants.ACTION_PROPERTY_CHANGED, oldAction, action);
- }
-
public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
if (listener == null) {
return;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -20,12 +20,12 @@
package org.codelutin.vcs.ui.model;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntries;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.util.VCSEntriesImpl;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -17,13 +17,12 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import static org.codelutin.vcs.ui.VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED;
import java.util.ArrayList;
import java.util.List;
/**
- * Model of a repository
+ * Model of a a confirmation of action on entries (single type of action possible)
*
* @author chemit
*/
@@ -32,6 +31,10 @@
/** history of commit messages */
protected List<String> commitMessages;
+ /** current action to be fired */
+ protected VCSAction action;
+ public static final String ACCEPT_PROPERTY_CHANGED = "action";
+ public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage";
public List<String> getCommitMessages() {
if (commitMessages == null) {
@@ -40,6 +43,10 @@
return commitMessages;
}
+ public VCSAction getAction() {
+ return action;
+ }
+
public void addCommitMessage(String commitMessage) {
if (commitMessage != null && !commitMessage.isEmpty() && !getCommitMessages().contains(commitMessage)) {
// add message in history
@@ -49,11 +56,15 @@
}
public void init(VCSAction action, VCSEntryLocation location, VCSEntry[] states) {
- // always reset action in order to allow propagation of action changed
- this.action = null;
- model.clear();
- model.populate(location, states);
+ getEntriesModel().clear();
+ getEntriesModel().populate(location, states);
setAction(action);
}
+ public void setAction(VCSAction action) {
+ this.action = action;
+ // null oldValue to ensure propagation of changed
+ firePropertyChange(ACCEPT_PROPERTY_CHANGED, null, action);
+ }
+
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,9 +16,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.VCSHandler;
+import org.codelutin.vcs.type.VCSAction;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -31,7 +31,6 @@
*/
public class DiffPanelUIModel {
- /** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log = LogFactory.getLog(DiffPanelUIModel.class);
/** local root : wroking copy */
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -15,7 +15,6 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.ui.VCSUIConstants;
/**
* Model of a repository
@@ -24,13 +23,15 @@
*/
public class DiffUIModel extends AbstractTabUIModel {
+ public static final String FILE_PROPERTY_CHANGED = "file";
+
/** current file displayed */
protected VCSEntry fileModel;
public void setFileModel(VCSEntry fileModel) {
VCSEntry oldFileModel = this.fileModel;
this.fileModel = fileModel;
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldFileModel, fileModel);
+ firePropertyChange(FILE_PROPERTY_CHANGED, oldFileModel, fileModel);
}
public VCSEntry getFileModel() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,16 +16,21 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSState;
-import org.codelutin.vcs.ui.VCSUIConstants;
/** @author chemit */
public class SimpleVCSEntriesTableModelImpl extends AbstractVCSEntriesTableModel {
private static final long serialVersionUID = -6397327068709720165L;
- protected SimpleVCSEntriesTableModelImpl(String name) {
+ /** columns names for a simple table model with module, file and status */
+ public static final String[] SIMPLE_COLUMNS_NAMES = new String[]{
+ org.codelutin.i18n.I18n.n_("lutinvcs.module"),
+ org.codelutin.i18n.I18n.n_("lutinvcs.file"),
+ org.codelutin.i18n.I18n.n_("lutinvcs.status")
+ };
- super(name, VCSUIConstants.SIMPLE_COLUMNS_NAMES);
+ public SimpleVCSEntriesTableModelImpl(String name) {
+ super(name, SIMPLE_COLUMNS_NAMES);
}
public Object getValueAt(int rowIndex, int columnIndex) {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -14,8 +14,6 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.type.VCSAction;
-
/**
* Model of a repository
*
@@ -23,10 +21,5 @@
*/
public class SynchUIModel extends AbstractTabUIModel {
- public void doAllAction(VCSAction action) {
- setAction(action);
- firePropertyChange(action.name().toLowerCase() + "All", null, model);
- }
-
}
1
0
r406 - in trunk/lutinvcs: lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:54:13 +0000 (Sun, 06 Apr 2008)
New Revision: 406
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
Log:
model is instanciate in AbstractXXXUI
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
@@ -5,16 +5,8 @@
import org.codelutin.vcs.type.VCSAction;
public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
- super(handler,new org.codelutin.vcs.ui.model.ConfirmUIModel());
- Action acceptAction = new AbstractAction("accept") {
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
+ super(handler);
}
- };
- getAccept().setAction((acceptAction));
- }
</script>
<Table>
@@ -62,7 +54,7 @@
</row>
<row>
<cell fill='both'>
- <JButton id='accept' text='lutinvcs.accept'/>
+ <JButton id='accept' text='lutinvcs.accept' onActionPerformed='doAccept()'/>
</cell>
</row>
</Table>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
@@ -5,7 +5,7 @@
import org.codelutin.vcs.type.VCSEntryLocation;
public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
- super(handler,new org.codelutin.vcs.ui.model.DiffUIModel());
+ super(handler);
}
</script>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
@@ -6,9 +6,9 @@
import org.codelutin.vcs.type.VCSEntryLocation;
public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
- super(handler,new org.codelutin.vcs.ui.model.SynchUIModel());
+ super(handler);
}
- add(table);
+ //add(table);
</script>
<java.awt.CardLayout id='cardLayout'/>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:54:13 UTC (rev 406)
@@ -53,8 +53,8 @@
public AbstractConfirmUI() {
}
- public AbstractConfirmUI(AbstractUIHandler handler, AbstractUIModel model) {
- super(handler, model);
+ public AbstractConfirmUI(AbstractConfirmUIHandler handler) {
+ super(handler, new ConfirmUIModel());
}
@Override
@@ -67,6 +67,10 @@
return (ConfirmUIModel) super.getModel();
}
+ public void doAccept() {
+ getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
+ }
+
protected void showLastMessages() {
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:54:13 UTC (rev 406)
@@ -17,7 +17,6 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
-import org.codelutin.vcs.ui.model.AbstractTabUIModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
import javax.swing.JButton;
@@ -34,8 +33,8 @@
super();
}
- public AbstractDiffUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
- super(handler, model);
+ public AbstractDiffUI(AbstractTabUIHandler handler) {
+ super(handler, new DiffUIModel());
}
public DiffUIModel getModel() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:54:13 UTC (rev 406)
@@ -48,8 +48,8 @@
super();
}
- public AbstractSynchUI(AbstractSynchUIHandler handler, SynchUIModel model) {
- super(handler, model);
+ public AbstractSynchUI(AbstractSynchUIHandler handler) {
+ super(handler, new SynchUIModel());
}
public SynchUIModel getModel() {
1
0
r405 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:47:28 +0000 (Sun, 06 Apr 2008)
New Revision: 405
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
new module : ui-pre-jaxx
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -23,7 +23,7 @@
/** @author chemit */
public class ConfirmUIHandler extends AbstractConfirmUIHandler {
- protected final JConfirmUI ui;
+ protected final AbstractConfirmUI ui;
public ConfirmUIHandler() {
this.ui = new JConfirmUI(this);
@@ -33,7 +33,7 @@
return ui.getModel();
}
- public JConfirmUI getUi() {
+ public AbstractConfirmUI getUi() {
return ui;
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -51,7 +51,7 @@
return;
}
log.info("files to treate :" + entries.size());
- JConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -61,7 +61,7 @@
} else {
// show confirm action ui
- JConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
confirmUI.getModel().init(action, tableModel.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, entries.size() - 1);
confirmUI.setVisible(true);
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -30,7 +30,7 @@
protected static AbstractTabUI synchUI;
protected static AbstractDiffUI diffUI;
- protected static JConfirmUI confirmUI;
+ protected static AbstractConfirmUI confirmUI;
public static AbstractSynchUI newSynchUI() {
SynchUIHandler result = newHandler(SynchUIHandler.class);
@@ -42,7 +42,7 @@
return result.getUi();
}
- public static JConfirmUI newConfirmUI() {
+ public static AbstractConfirmUI newConfirmUI() {
ConfirmUIHandler result = newHandler(ConfirmUIHandler.class);
return result.getUi();
}
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,37 +1,21 @@
-<org.codelutin.vcs.ui.AbstractUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
- resizable='false' height='300' width='400'>
+<AbstractConfirmUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
+ resizable='false' height='300' width='400'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
- import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
- import org.codelutin.vcs.ui.model.ConfirmUIModel ;
- public JConfirmUI(AbstractConfirmUIHandler handler) {
-
- super(handler,new ConfirmUIModel());
-
- Action acceptAction= new AbstractAction("accept") {
+ public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
+ super(handler,new org.codelutin.vcs.ui.model.ConfirmUIModel());
+ Action acceptAction = new AbstractAction("accept") {
private static final long serialVersionUID = 1L;
+
public void actionPerformed(ActionEvent e) {
- getHandler().doAction(getCommitMessage().getText(),getModel().getModel());
+ getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
}
};
- accept.setAction((acceptAction));
+ getAccept().setAction((acceptAction));
}
- @Override
- protected AbstractConfirmUIHandler getHandler() {
- return (AbstractConfirmUIHandler) super.getHandler();
- }
-
- @Override
- public ConfirmUIModel getModel() {
- return (ConfirmUIModel) super.getModel();
- }
-
- protected void showLastMessages() {
-
- }
</script>
<Table>
<row fill='both'>
@@ -82,5 +66,5 @@
</cell>
</row>
</Table>
-</org.codelutin.vcs.ui.AbstractUI>
+</AbstractConfirmUI>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,4 +1,4 @@
-<org.codelutin.vcs.ui.AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
+<AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
@@ -76,4 +76,4 @@
</cell>
</row>
</Table>
-</org.codelutin.vcs.ui.AbstractDiffUI>
+</AbstractDiffUI>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,5 +1,5 @@
-<org.codelutin.vcs.ui.AbstractSynchUI title='lutinvcs.synch.title' modal="true" id='synchui'
- defaultCloseOperation='DISPOSE_ON_CLOSE'>
+<AbstractSynchUI title='lutinvcs.synch.title' modal="true" id='synchui'
+ defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
@@ -13,14 +13,15 @@
<java.awt.CardLayout id='cardLayout'/>
- <!--JPopupMenu enabled='false'/-->
- <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
+
<Table id='table'>
<row fill='both'>
<cell fill='both' weightx='1'>
<JToolBar>
+ <!--JPopupMenu enabled='false'/-->
+ <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
<JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
@@ -72,4 +73,4 @@
</cell>
</row>
</Table>
-</org.codelutin.vcs.ui.AbstractSynchUI>
\ No newline at end of file
+</AbstractSynchUI>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,25 +1,13 @@
-<org.codelutin.vcs.ui.AbstractVCSPopup>
+<AbstractVCSPopup>
<script>
import org.codelutin.vcs.type.VCSAction;
- import org.codelutin.vcs.ui.handler.VCSAbsractAction;
- protected VCSAbsractAction dispatchAction;
-
- protected void setDispatchAction(VCSAbsractAction action) {
- this.dispatchAction=action;
- }
-
- protected void doAction(VCSAction action,JMenuItem item) {
- dispatchAction.setAction(action);
- ActionEvent e = new ActionEvent( item,1,action.name());
- dispatchAction.actionPerformed(e);
- }
- /*add(refresh);
+ add(refresh);
add(diff);
add(update);
add(commit);
add(revert);
- add(delete);*/
+ add(delete);
</script>
<JMenuItem id='refresh' text='{_("lutinvcs.action.refresh")}' toolTipText='{_("lutinvcs.action.tooltip.refresh")}'
icon='{createImageIcon("autoRefresh.png")}' onActionPerformed='doAction(VCSAction.REFRESH,refresh)'/>
@@ -33,4 +21,4 @@
icon='{createImageIcon("rollback.png")}' onActionPerformed='doAction(VCSAction.REVERT,revert)'/>
<JMenuItem id='delete' text='{_("lutinvcs.action.delete")}' toolTipText='{_("lutinvcs.action.tooltip.delete")}'
icon='{createImageIcon("remove.png")}' onActionPerformed='doAction(VCSAction.DELETE,delete)'/>
-</org.codelutin.vcs.ui.AbstractVCSPopup>
\ No newline at end of file
+</AbstractVCSPopup>
\ No newline at end of file
Added: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -0,0 +1,73 @@
+/**
+ * # #% 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 jaxx.runtime.swing.Table;
+import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JToolBar;
+
+/** @author chemit */
+public abstract class AbstractConfirmUI extends AbstractUI {
+
+ public abstract JLabel getActionLabel();
+
+ public abstract Table getToolbar();
+
+ public abstract JToolBar getTool();
+
+ public abstract JLabel getActionCommitLabel();
+
+ public abstract JButton getLastMessages();
+
+ public abstract JScrollPane getCommitScroll();
+
+ public abstract JTextArea getCommitMessage();
+
+ public abstract JScrollPane getContent();
+
+ public abstract JTable getContentTable();
+
+ public abstract JButton getAccept();
+
+ public AbstractConfirmUI() {
+ }
+
+ public AbstractConfirmUI(AbstractUIHandler handler, AbstractUIModel model) {
+ super(handler, model);
+ }
+
+ @Override
+ protected AbstractConfirmUIHandler getHandler() {
+ return (AbstractConfirmUIHandler) super.getHandler();
+ }
+
+ @Override
+ public ConfirmUIModel getModel() {
+ return (ConfirmUIModel) super.getModel();
+ }
+
+ protected void showLastMessages() {
+
+ }
+}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -22,6 +22,7 @@
/** @author chemit */
public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
+
protected VCSAbsractAction dispatchAction;
public abstract JMenuItem getRefresh();
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -19,27 +19,21 @@
import jaxx.tags.swing.JPopupMenuHandler;
import jaxx.tags.swing.JWindowHandler;
-import java.beans.Introspector;
-
public class VCSInitializer implements jaxx.spi.Initializer {
public void initialize() {
- String[] searchPath = Introspector.getBeanInfoSearchPath();
- String[] newSearchPath = new String[searchPath.length + 1];
- System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
- newSearchPath[newSearchPath.length - 1] = "jaxx.beaninfos";
- Introspector.setBeanInfoSearchPath(newSearchPath);
-
- //TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new jaxx.tags.DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
-
+ //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JWindowHandler.class);
TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractVCSPopup.class), JPopupMenuHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractConfirmUI.class), JWindowHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractDiffUI.class), JWindowHandler.class);
TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
- //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JDialog.class);
+ TagManager.registerDefaultNamespace("AbstractConfirmUI", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("AbstractSynchUI", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("AbstractDiffUI", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("AbstractVCSPopup", "org.codelutin.vcs.ui.*");
- //TagManager.registerDefaultNamespace("AbstractUI", "javax.swing.*");
-
}
}
\ No newline at end of file
1
0
r404 - trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:19:28 +0000 (Sun, 06 Apr 2008)
New Revision: 404
Removed:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties
Log:
new module : ui-pre-jaxx
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties 2008-04-06 13:18:58 UTC (rev 403)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties 2008-04-06 13:19:28 UTC (rev 404)
@@ -1,4 +0,0 @@
-lutinvcs.error.thread.action=
-lutinvcs.file=File
-lutinvcs.module=Module
-lutinvcs.status=Status
1
0