Jaxx-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
April 2008
- 1 participants
- 373 discussions
[Buix-commits] r313 - trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:13:00 +0000 (Thu, 03 Apr 2008)
New Revision: 313
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/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/VCSPopupAction.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
move to handler package
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-03 17:12:49 UTC (rev 312)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-03 17:13:00 UTC (rev 313)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.ui.action.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import javax.swing.JTable;
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-03 17:12:49 UTC (rev 312)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-03 17:13:00 UTC (rev 313)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.action.AbstractDiffUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
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-03 17:12:49 UTC (rev 312)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-03 17:13:00 UTC (rev 313)
@@ -2,7 +2,7 @@
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.action.AbstractSynchUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
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-03 17:12:49 UTC (rev 312)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-03 17:13:00 UTC (rev 313)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.action.VCSAbsractAction;
+import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
import javax.swing.ListSelectionModel;
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-03 17:12:49 UTC (rev 312)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-03 17:13:00 UTC (rev 313)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.action.AbstractUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractUIHandler;
import java.util.HashMap;
import java.util.List;
1
0
[Buix-commits] r312 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:12:49 +0000 (Thu, 03 Apr 2008)
New Revision: 312
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/
Log:
move to handler package
1
0
[Buix-commits] r311 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:12:08 +0000 (Thu, 03 Apr 2008)
New Revision: 311
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java
Log:
move to handler package
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 17:12:08 UTC (rev 311)
@@ -1,59 +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.action;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public abstract class AbstractSynchUIHandler extends AbstractUIHandler<SynchUIModel> {
-
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
- String action = evt.getPropertyName();
- SimpleVCSFileStatesModel model = (SimpleVCSFileStatesModel) evt.getNewValue();
- if (SynchUIModel.TAB_PROPERTY_CHANGED.equals(action)) {
- doSelectTabAction(model);
- } else if (action.endsWith("All")) {
- try {
- String actionName = action.substring(0, action.length() - 3);
- VCSAction vcsAction = VCSAction.valueOf(actionName.toUpperCase());
- doAllAction(vcsAction, model);
- } catch (IllegalArgumentException e) {
- // ignore it ?
- }
- } else {
- try {
- VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
- doSelectAction(vcsAction, model);
- } catch (IllegalArgumentException e) {
- // ignore it ?
- }
-
- }
- }
-
- public abstract void doSelectAction(VCSAction action, SimpleVCSFileStatesModel model);
-
- public abstract void doAllAction(VCSAction action, SimpleVCSFileStatesModel model);
-
- public abstract void doSelectTabAction(SimpleVCSFileStatesModel action);
-
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java 2008-04-03 17:12:08 UTC (rev 311)
@@ -1,42 +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.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
-
-import javax.swing.ListSelectionModel;
-import javax.swing.JDialog;
-import java.beans.PropertyChangeListener;
-
-/** @author chemit */
-public abstract class AbstractUIHandler<M extends AbstractUIModel> implements PropertyChangeListener {
-
- protected static Log log = LogFactory.getLog(AbstractConfirmUIHandler.class);
-
- public abstract M getModel();
-
- public abstract JDialog getUi();
-
- public abstract ListSelectionModel getSelectionModel();
-
- public void init() {
- if (getModel() == null) {
- throw new IllegalStateException("no model was defined for " + this);
- }
- getModel().addPropertyChangeListener(this);
- }
-}
1
0
[Buix-commits] r310 - in trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui: . action handler
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:12:00 +0000 (Thu, 03 Apr 2008)
New Revision: 310
Added:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/VCSAbsractAction.java
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
Log:
move to handler package
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java 2008-04-03 17:04:28 UTC (rev 309)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -1,57 +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.action;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
-import org.codelutin.vcs.ui.model.ConfirmUIModel;
-
-import javax.swing.ListSelectionModel;
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel> {
-
- protected abstract void updateUI();
-
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
- String action = evt.getPropertyName();
-
- if (ConfirmUIModel.ACTION_PROPERTY_CHANGED.equals(action)) {
- updateUI();
- return;
- }
- try {
- String commitMessage = (String) evt.getNewValue();
- VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
- doAction(vcsAction, commitMessage, getModel().getModel());
- } catch (IllegalArgumentException e) {
- // ignore ite
- }
- }
-
- public void doAction(VCSAction action, String commitMessage, AbstractVCSFileStatesModel model) {
- ListSelectionModel selectionModel = getSelectionModel();
- model.select(action, selectionModel, false);
- VCSFileState[] data = model.getData(selectionModel);
- //TODO fire vcs action on given data
- log.info("action:" + action + ", message:" + commitMessage + ", nb files:" + data.length);
- }
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java 2008-04-03 17:04:28 UTC (rev 309)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -1,59 +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.action;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public abstract class AbstractDiffUIHandler extends AbstractUIHandler<DiffUIModel> {
-
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
- String action = evt.getPropertyName();
-
- if (DiffUIModel.TAB_PROPERTY_CHANGED.equals(action)) {
- doSelectTab((SimpleVCSFileStatesModel) evt.getNewValue());
- } else {
- if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSFileState) evt.getNewValue());
- } else {
- try {
- VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
- doAction(vcsAction, (VCSFileState) evt.getNewValue());
- } catch (IllegalArgumentException e) {
- // ignore ite
- }
- }
- }
- }
-
- public abstract void doSelectTab(SimpleVCSFileStatesModel action);
-
- public abstract void doSelectFile(VCSFileState model);
-
- public abstract void doAction(VCSAction action, VCSFileState model);
-
- public abstract void gotoNextDiff();
-
- public abstract void gotoPreviousDiff();
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/VCSAbsractAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/VCSAbsractAction.java 2008-04-03 17:04:28 UTC (rev 309)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/VCSAbsractAction.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -1,42 +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.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSHandler;
-
-import javax.swing.AbstractAction;
-
-/** @author chemit */
-public abstract class VCSAbsractAction extends AbstractAction {
-
- protected static Log log = LogFactory.getLog(VCSAbsractAction.class);
-
- protected VCSAction action;
-
- protected transient VCSHandler handler;
-
- private static final long serialVersionUID = 1074145285171920255L;
-
- public VCSAbsractAction(VCSHandler handler) {
- this.handler = handler;
- }
-
- public void setAction(VCSAction action) {
- this.action = action;
- }
-}
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler (from rev 308, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action)
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java 2008-04-03 17:04:04 UTC (rev 308)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -12,7 +12,7 @@
* - Suite 330, Boston, MA 02111-1307, USA.
* # #%
*/
-package org.codelutin.vcs.ui.action;
+package org.codelutin.vcs.ui.handler;
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java 2008-04-03 17:04:04 UTC (rev 308)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -12,7 +12,7 @@
* - Suite 330, Boston, MA 02111-1307, USA.
* # #%
*/
-package org.codelutin.vcs.ui.action;
+package org.codelutin.vcs.ui.handler;
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 17:04:04 UTC (rev 308)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -12,7 +12,7 @@
* - Suite 330, Boston, MA 02111-1307, USA.
* # #%
*/
-package org.codelutin.vcs.ui.action;
+package org.codelutin.vcs.ui.handler;
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java 2008-04-03 17:04:04 UTC (rev 308)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -12,7 +12,7 @@
* - Suite 330, Boston, MA 02111-1307, USA.
* # #%
*/
-package org.codelutin.vcs.ui.action;
+package org.codelutin.vcs.ui.handler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/VCSAbsractAction.java 2008-04-03 17:04:04 UTC (rev 308)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java 2008-04-03 17:12:00 UTC (rev 310)
@@ -12,7 +12,7 @@
* - Suite 330, Boston, MA 02111-1307, USA.
* # #%
*/
-package org.codelutin.vcs.ui.action;
+package org.codelutin.vcs.ui.handler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
1
0
[Buix-commits] r309 - trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:04:28 +0000 (Thu, 03 Apr 2008)
New Revision: 309
Removed:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/
Log:
uis
1
0
[Buix-commits] r308 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:04:04 +0000 (Thu, 03 Apr 2008)
New Revision: 308
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties
Log:
uis
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties 2008-04-03 17:02:06 UTC (rev 307)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties 2008-04-03 17:04:04 UTC (rev 308)
@@ -1,3 +1,4 @@
+lutinvcs.accept=Accept
lutinvcs.action.commit=commit
lutinvcs.action.delete=delete
lutinvcs.action.diff=show diff
@@ -2,9 +3,12 @@
lutinvcs.action.refresh=refresh
-lutinvcs.action.revert=revert selected files
+lutinvcs.action.revert=revert
lutinvcs.action.tooltip.commit=commit selected files
lutinvcs.action.tooltip.commitAll=commit all files
lutinvcs.action.tooltip.delete=delete
lutinvcs.action.tooltip.deleteAll=delete all files
-lutinvcs.action.tooltip.diff=show diff for selected files
+lutinvcs.action.tooltip.diff=show diff of selected files
lutinvcs.action.tooltip.diffAll=show diff of all files
+lutinvcs.action.tooltip.lastMessages=
+lutinvcs.action.tooltip.nextDiff=next diff
+lutinvcs.action.tooltip.previousDiff=previous diff
lutinvcs.action.tooltip.refresh=refresh selected files
@@ -16,9 +20,15 @@
lutinvcs.action.tooltip.update=update selected files
lutinvcs.action.tooltip.updateAll=update all files
lutinvcs.action.update=update
-lutinvcs.quit=Quit
+lutinvcs.commit.message=Please fill a message for your commit
+lutinvcs.confirm.message=Message TODO
+lutinvcs.confirm.title=Confirm UI
+lutinvcs.diff.title=Diff UI
lutinvcs.synch.title=Synch
lutinvcs.tabs.all=all
+lutinvcs.tabs.diff.tooltip.all=both local and remote modifed files
+lutinvcs.tabs.diff.tooltip.local=only local modified files
+lutinvcs.tabs.diff.tooltip.remote=only remote modified files
lutinvcs.tabs.local=local
lutinvcs.tabs.remote=remote
lutinvcs.tabs.tooltip.all=Show all files (local and remote)
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties 2008-04-03 17:02:06 UTC (rev 307)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties 2008-04-03 17:04:04 UTC (rev 308)
@@ -1,3 +1,4 @@
+lutinvcs.accept=Accepter
lutinvcs.action.commit=committer
lutinvcs.action.delete=supprimer
lutinvcs.action.diff=voir les diff
@@ -7,18 +8,27 @@
lutinvcs.action.tooltip.commitAll=commiter tous les fichiers
lutinvcs.action.tooltip.delete=supprimer les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.deleteAll=supprimer tous les fichiers
-lutinvcs.action.tooltip.diff=voir les diff\u00E9rences des fichiers s\u00E9lectionn\u00E9s
+lutinvcs.action.tooltip.diff=voir tous les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.diffAll=voir les diff\u00E9rences de tous les fichiers
-lutinvcs.action.tooltip.refresh=rafra\u00EEchir
+lutinvcs.action.tooltip.lastMessages=
+lutinvcs.action.tooltip.nextDiff=voir la prochaine diff\u00E9rence
+lutinvcs.action.tooltip.previousDiff=voir la diff\u00E9rence pr\u00E9c\u00E9dente
+lutinvcs.action.tooltip.refresh=rafra\u00EEchir tous les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.refreshAll=rafra\u00EEchir tous les fichiers
lutinvcs.action.tooltip.revert=annuler les modifications sur les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.revertAll=annuler les modifications sur tous les fichiers
lutinvcs.action.tooltip.update=mettre \u00E0 jour les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.updateAll=mettre \u00E0 jour tous les fichiers
lutinvcs.action.update=mettre \u00E0 jour
-lutinvcs.quit=Quitter
+lutinvcs.commit.message=Renseigner le message de commit
+lutinvcs.confirm.message=Message TODO
+lutinvcs.confirm.title=Confirm UI
+lutinvcs.diff.title=Diff UI
lutinvcs.synch.title=Synchronisation
lutinvcs.tabs.all=all
+lutinvcs.tabs.diff.tooltip.all=voir tous les fichiers modifi\u00E9s
+lutinvcs.tabs.diff.tooltip.local=voir les fichiers locaux modifi\u00E9es
+lutinvcs.tabs.diff.tooltip.remote=voir les fichiers distants modifi\u00E9s
lutinvcs.tabs.local=local
lutinvcs.tabs.remote=remote
lutinvcs.tabs.tooltip.all=voir tous les fichiers modifi\u00E9s localement ou \u00E0 distance
1
0
[Buix-commits] r307 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:02:06 +0000 (Thu, 03 Apr 2008)
New Revision: 307
Added:
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/JDiffPanelUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
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/JVCSPopup.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css
Log:
uis
Copied: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx (from rev 298, 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/JConfirmUI.jaxx (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -0,0 +1,93 @@
+<JDialog title='lutinvcs.confirm.title' id='ui' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'>
+ <style source="common.css"/>
+ <script>
+
+ import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.ui.action.AbstractConfirmUIHandler;
+
+ protected AbstractConfirmUIHandler handler;
+
+ public JConfirmUI(AbstractConfirmUIHandler handler) {
+ this.handler =handler;
+ JRootPane rootPane = ui.getRootPane();
+ //rootPane.setDefaultButton(accept);
+
+ Action quitAction = new AbstractAction("cancel") {
+ private static final long serialVersionUID = -869095664995763057L;
+ public void actionPerformed(ActionEvent e) {
+ ui.dispose();
+ }
+ };
+
+ Action acceptAction= new AbstractAction("accept") {
+ private static final long serialVersionUID = -869095664995763055L;
+ public void actionPerformed(ActionEvent e) {
+ model.doAction(commitMessage.getText());
+ }
+ };
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"),"quit");
+ rootPane.getActionMap().put("quit", quitAction);
+ accept.setAction((acceptAction));
+ }
+
+ protected AbstractConfirmUIHandler getHandler() {
+ return handler;
+ }
+
+ protected void showLastMessages() {
+
+ }
+ </script>
+
+ <org.codelutin.vcs.ui.model.ConfirmUIModel id="model"/>
+
+
+ <Table>
+ <row fill='both'>
+ <cell fill='both'>
+ <JLabel id="actionLabel" text="lutinvcs.confirm.message"/>
+ </cell>
+ </row>
+
+ <row fill='both'>
+ <cell fill='both' weightx='1'>
+ <Table id="toolbar" fill='both'>
+ <row>
+ <cell fill='both'>
+ <JLabel id="actionCommitLabel" text="lutinvcs.commit.message"/>
+ </cell>
+ <cell fill='both'>
+ <JLabel/>
+ </cell>
+ <cell fill='horizontal' anchor='east'>
+ <JButton id='lastMessages' toolTipText="lutinvcs.action.tooltip.lastMessages"
+ icon='{createImageIcon("recent_messages.png")}'
+ onActionPerformed='showLastMessages()'/>
+ </cell>
+ </row>
+ <row fill='both'>
+ <cell fill='both' columns='3' weightx='1' weighty='1'>
+ <JScrollPane id="commitScroll" height='60' verticalScrollBarPolicy="20">
+ <!--JScrollPane id="commitScroll" verticalScrollBarPolicy="20" columnHeaderView="{toolbar}"-->
+ <JTextArea id="commitMessage" constructorParams="4,50"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+
+ <row>
+ <cell fill='both' weightx='1' weighty='1'>
+ <JScrollPane id='content' styleClass='confirmScroll'>
+ <JTable id="contentTable" styleClass='confirmTable' model="{model.getModel()}"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='both'>
+ <JButton id='accept' text='lutinvcs.accept'/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
Added: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffPanelUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffPanelUI.jaxx (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffPanelUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -0,0 +1,15 @@
+<!--Table>
+ <style source="common.css"/>
+ <row fill='both'>
+ <cell fill='both' weightx='1'-->
+<JSplitPane id='splitPane2' orientation='horizontal' oneTouchExpandable='true'>
+ <JScrollPane id='remoteScroll' styleClass='updateScroll'>
+ <JTextArea id="remoteContent"/>
+ </JScrollPane>
+ <JScrollPane id='localScroll' styleClass='updateScroll'>
+ <JTextArea id="localContent"/>
+ </JScrollPane>
+</JSplitPane>
+ <!--/cell>
+ </row>
+</Table-->
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -0,0 +1,156 @@
+<JDialog title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
+ <style source="common.css"/>
+ <script>
+
+ import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.ui.action.AbstractDiffUIHandler;
+ import org.codelutin.vcs.ui.VCSUIConstants;
+
+ protected AbstractDiffUIHandler handler;
+
+ public JTable getTable(String modelName) {
+ return (JTable) get$objectMap().get(modelName+"Table");
+ }
+
+ @Override
+ public void setVisible(boolean b) {
+ if (getHandler().getModel().getTabModel() == null) {
+ // first launch, no tab model selected,choose one
+ selectTab(VCSUIConstants.DIFF_ALL_MODEL_PROPERTY);
+ }
+ super.setVisible(b);
+ }
+
+ public JDiffUI(AbstractDiffUIHandler handler) {
+ this.handler =handler;
+ }
+
+ protected AbstractDiffUIHandler getHandler() {
+ return handler;
+ }
+
+ protected void setHandler(AbstractDiffUIHandler handler) {
+ this.handler = handler;
+ }
+
+ protected void selectTab(String tabname) {
+ model.setTabModel(model.getModel(tabname));
+ }
+
+ protected void selectFile(JTable table) {
+ model.setFileModel(model.getTabModel().getData(table.getSelectionModel())[0]);
+ }
+
+ protected void doAction(VCSAction action) {
+ model.doAction(action);
+ }
+
+ protected void gotoNextDiff() {
+ handler.gotoNextDiff();
+ }
+
+ protected void gotoPreviousDiff() {
+ handler.gotoPreviousDiff();
+ }
+
+ Action quitAction;
+ JRootPane rootPane = diffui.getRootPane();
+ //rootPane.setDefaultButton(quit);
+ quitAction = new AbstractAction("quit") {
+ private static final long serialVersionUID = -869095664995763057L;
+ public void actionPerformed(ActionEvent e) {
+ diffui.dispose();
+ }
+ };
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"),"quit");
+ rootPane.getActionMap().put("quit", quitAction);
+ </script>
+
+ <org.codelutin.vcs.ui.model.DiffUIModel id="model"/>
+
+ <java.awt.CardLayout id='cardLayout'/>
+
+ <Table>
+ <row fill='both'>
+ <cell fill='both' weightx='1'>
+ <JToolBar>
+ <JToggleButton id='allTab' selected='true' buttonGroup='tabs' mnemonic="A"
+ toolTipText="lutinvcs.tabs.diff.tooltip.all"
+ icon='{createImageIcon("remote_vs_local.png")}'
+ onActionPerformed='selectTab("modelSynchAll")'/>
+ <JToggleButton id='localTab' selected='false' buttonGroup='tabs' mnemonic="L"
+ toolTipText="lutinvcs.tabs.diff.tooltip.local"
+ icon='{createImageIcon("local_vs_local.png")}'
+ onActionPerformed='selectTab("modelSynchLocal")'/>
+ <JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' mnemonic="R"
+ icon='{createImageIcon("remote_vs_remote.png")}'
+ toolTipText="lutinvcs.tabs.diff.tooltip.remote"
+ onActionPerformed='selectTab("modelSynchRemote")'/>
+
+
+ <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()'/>
+
+ <JButton id='refresh' toolTipText="lutinvcs.action.tooltip.refresh"
+ icon='{createImageIcon("autoRefresh.png")}'
+ onActionPerformed='doAction(VCSAction.REFRESH)'/>
+
+ <JButton id='update' toolTipText="lutinvcs.action.tooltip.update"
+ icon='{createImageIcon("update.png")}'
+ onActionPerformed='doAction(VCSAction.UPDATE)'/>
+
+ <JButton id='commit' toolTipText="lutinvcs.action.tooltip.commit"
+ icon='{createImageIcon("commit.png")}'
+ onActionPerformed='doAction(VCSAction.COMMIT)'/>
+
+ <JButton id='revert' toolTipText="lutinvcs.action.tooltip.revert"
+ icon='{createImageIcon("rollback.png")}'
+ onActionPerformed='doAction(VCSAction.REVERT)'/>
+
+ <JButton id='delete' toolTipText="lutinvcs.action.tooltip.delete"
+ icon='{createImageIcon("remove.png")}'
+ onActionPerformed='doAction(VCSAction.DELETE)'/>
+ </JToolBar>
+ </cell>
+ </row>
+ <row fill='both'>
+ <cell fill='both' weighty='1' weightx='2'>
+ <JPanel id='preview' layout='{cardLayout}'>
+ <JScrollPane id='allContent' styleClass='diffScroll' constraints='"modelSynchAll"'>
+ <JTable id="modelDiffAllTable" styleClass='diffTable'
+ onMouseClicked="selectFile(modelDiffAllTable)"/>
+ </JScrollPane>
+ <JScrollPane id='localContent' styleClass='diffScroll' constraints='"modelSynchLocal"'>
+ <JTable id="modelDiffLocalTable" styleClass='diffTable'
+ onMouseClicked="selectFile(modelDiffLocalTable)"/>
+ </JScrollPane>
+ <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"modelSynchRemote"'
+ onMouseClicked="selectFile(modelDiffRemoteTable)">
+ <JTable id="modelDiffRemoteTable" styleClass='diffTable'/>
+ </JScrollPane>
+ </JPanel>
+ </cell>
+ </row>
+ <!--row>
+ <cell fill='both'>
+ <JToolBar>
+ <Table insets='0,0,0,0'>
+ <row fill='both' anchor='west'>
+ <cell fill='both' weightx='2'>
+ <JLabel id="label"/>
+ </cell>
+ </row>
+ <row fill='both' anchor='east'>
+ <cell fill='both'>
+ <JProgressBar id="progress"/>
+ </cell>
+ </row>
+ </Table>
+ </JToolBar>
+ </cell>
+ </row-->
+ </Table>
+</JDialog>
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-03 17:01:51 UTC (rev 306)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -18,9 +18,8 @@
@Override
public void setVisible(boolean b) {
if (getHandler().getModel().getTabModel() == null) {
- getHandler().init();
// first launch, no tab model selected,choose one
- selectTab(VCSUIConstants.ALL_MODEL_PROPERTY);
+ selectTab(VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY);
}
super.setVisible(b);
}
@@ -47,8 +46,7 @@
Action quitAction;
JRootPane rootPane = ui.getRootPane();
- rootPane.setDefaultButton(quit);
- quitAction = new AbstractAction(quit.getText()) {
+ quitAction = new AbstractAction("quit") {
private static final long serialVersionUID = -869095664995763057L;
public void actionPerformed(ActionEvent e) {
ui.dispose();
@@ -121,11 +119,11 @@
</JPanel>
</cell>
</row>
- <row>
+ <!--row>
<cell fill='both'>
<JButton id='quit' text='lutinvcs.quit' action='{quitAction}'/>
</cell>
- </row>
+ </row-->
<!--row>
<cell fill='both'>
<JToolBar>
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-03 17:01:51 UTC (rev 306)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -1,4 +1,4 @@
-<JPopupMenu enabled='false'>
+<JPopupMenu>
<script>
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.ui.action.VCSAbsractAction;
@@ -14,17 +14,23 @@
ActionEvent e = new ActionEvent( item,1,action.name());
dispatchAction.actionPerformed(e);
}
+ add(refresh);
+ add(diff);
+ add(update);
+ add(commit);
+ add(revert);
+ add(delete);
</script>
- <JMenuItem id='refresh' text="lutinvcs.action.refresh" toolTipText="lutinvcs.action.tooltip.refresh"
+ <JMenuItem id='refresh' text='{_("lutinvcs.action.refresh")}' toolTipText='{_("lutinvcs.action.tooltip.refresh")}'
icon='{createImageIcon("autoRefresh.png")}' onActionPerformed='doAction(VCSAction.REFRESH,refresh)'/>
- <JMenuItem id='diff' text="lutinvcs.action.diff" toolTipText="lutinvcs.action.tooltip.diff"
+ <JMenuItem id='diff' text='{_("lutinvcs.action.diff")}' toolTipText='{_("lutinvcs.action.tooltip.diff")}'
icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,diff)'/>
- <JMenuItem id='update' text="lutinvcs.action.update" toolTipText="lutinvcs.action.tooltip.update"
+ <JMenuItem id='update' text='{_("lutinvcs.action.update")}' toolTipText='{_("lutinvcs.action.tooltip.update")}'
icon='{createImageIcon("update.png")}' onActionPerformed='doAction(VCSAction.UPDATE,update)'/>
- <JMenuItem id='commit' text="lutinvcs.action.commit" toolTipText="lutinvcs.action.tooltip.commit"
+ <JMenuItem id='commit' text='{_("lutinvcs.action.commit")}' toolTipText='{_("lutinvcs.action.tooltip.commit")}'
icon='{createImageIcon("commit.png")}' onActionPerformed='doAction(VCSAction.COMMIT,commit)'/>
- <JMenuItem id='revert' text="lutinvcs.action.revert" toolTipText="lutinvcs.action.tooltip.revert"
+ <JMenuItem id='revert' text='{_("lutinvcs.action.revert")}' toolTipText='{_("lutinvcs.action.tooltip.revert")}'
icon='{createImageIcon("rollback.png")}' onActionPerformed='doAction(VCSAction.REVERT,revert)'/>
- <JMenuItem id='delete' text="lutinvcs.action.delete" toolTipText="lutinvcs.action.tooltip.delete"
+ <JMenuItem id='delete' text='{_("lutinvcs.action.delete")}' toolTipText='{_("lutinvcs.action.tooltip.delete")}'
icon='{createImageIcon("remove.png")}' onActionPerformed='doAction(VCSAction.DELETE,delete)'/>
-</JPopupMenu>
+</JPopupMenu>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css 2008-04-03 17:01:51 UTC (rev 306)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css 2008-04-03 17:02:06 UTC (rev 307)
@@ -42,7 +42,6 @@
}
;
-
}
.updateScroll {
1
0
[Buix-commits] r306 - in trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui: . action
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:01:51 +0000 (Thu, 03 Apr 2008)
New Revision: 306
Added:
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/VCSPopupAction.java
Removed:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java
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/VCSUIFactory.java
Log:
implantations d'handler d'ui
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -0,0 +1,58 @@
+/**
+ * # #% 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.VCSAction;
+import org.codelutin.vcs.ui.action.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class ConfirmUIHandler extends AbstractConfirmUIHandler {
+
+ protected final JConfirmUI ui;
+
+ public ConfirmUIHandler() {
+ super();
+ this.ui = new JConfirmUI(this);
+ }
+
+ public ConfirmUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public JConfirmUI getUi() {
+ return ui;
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ JTable table = ui.getContentTable();
+ return table.getSelectionModel();
+ }
+
+ protected void updateUI() {
+ VCSAction action = ui.getModel().getAction();
+ ui.getAccept().setText(action.getLibelle());
+ ui.getToolbar().setVisible(action.isCommit());
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ super.propertyChange(evt);
+
+ }
+}
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -0,0 +1,63 @@
+/**
+ * # #% 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.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.action.AbstractDiffUIHandler;
+import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
+
+import javax.swing.ListSelectionModel;
+
+/** @author chemit */
+public class DiffUIHandler extends AbstractDiffUIHandler {
+
+ protected final JDiffUI ui;
+
+ public DiffUIHandler() {
+ super();
+ this.ui = new JDiffUI(this);
+ }
+
+ public JDiffUI getUi() {
+ return ui;
+ }
+
+ public DiffUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ AbstractVCSFileStatesModel tabModel = getModel().getTabModel();
+ return tabModel == null ? null : ui.getTable(tabModel.getName()).getSelectionModel();
+ }
+
+ public void doSelectTab(SimpleVCSFileStatesModel action) {
+ }
+
+ public void doSelectFile(VCSFileState model) {
+ }
+
+ public void doAction(VCSAction action, VCSFileState model) {
+ }
+
+ public void gotoNextDiff() {
+ }
+
+ public void gotoPreviousDiff() {
+ }
+}
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-03 17:01:40 UTC (rev 305)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -3,10 +3,9 @@
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
import org.codelutin.vcs.ui.action.AbstractSynchUIHandler;
-import org.codelutin.vcs.ui.action.VCSPopupAction;
import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.ui.model.SynchVCSFileStatesModel;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
@@ -15,6 +14,7 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/** @author chemit */
@@ -22,35 +22,33 @@
protected final JSynchUI ui;
- public SynchUIHandler(JSynchUI ui) {
+ public SynchUIHandler() {
super();
- this.ui = ui;
+ this.ui = new JSynchUI(this);
}
+ public JSynchUI getUi() {
+ return ui;
+ }
+
@Override
public void init() {
super.init();
- initTab(VCSUIConstants.ALL_MODEL_PROPERTY);
- initTab(VCSUIConstants.LOCAL_MODEL_PROPERTY);
- initTab(VCSUIConstants.REMOTE_MODEL_PROPERTY);
+ initTab(VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY);
+ initTab(VCSUIConstants.SYNCH_LOCAL_MODEL_PROPERTY);
+ initTab(VCSUIConstants.SYNCH_REMOTE_MODEL_PROPERTY);
}
- private void initTab(String modelName) {
- JTable table = ui.getTable(modelName);
- SynchVCSFileStatesModel fileStatesModel = getModel().getModel(modelName);
- table.setModel(fileStatesModel);
- table.getSelectionModel().addListSelectionListener(this);
- table.addMouseListener(new ListMouseListener(ui, fileStatesModel));
- JVCSPopup jvcsPopup = ui.getPopup(modelName);
- jvcsPopup.setInvoker(table);
- jvcsPopup.setDispatchAction(new VCSPopupAction(ui, modelName));
- }
-
public SynchUIModel getModel() {
return ui.getModel();
}
- public void doAllAction(VCSAction action, SynchVCSFileStatesModel model) {
+ public ListSelectionModel getSelectionModel() {
+ AbstractVCSFileStatesModel tabModel = getModel().getTabModel();
+ return tabModel == null ? null : ui.getTable(tabModel.getName()).getSelectionModel();
+ }
+
+ public void doAllAction(VCSAction action, SimpleVCSFileStatesModel model) {
log.info(action + " : " + model);
JTable table = ui.getTable(model.getName());
ListSelectionModel selectionModel = table.getSelectionModel();
@@ -66,7 +64,7 @@
}
}
- public void doSelectAction(VCSAction action, SynchVCSFileStatesModel model) {
+ public void doSelectAction(VCSAction action, SimpleVCSFileStatesModel model) {
log.info(action + " : " + model);
JTable table = ui.getTable(model.getName());
ListSelectionModel selectionModel = table.getSelectionModel();
@@ -74,12 +72,19 @@
// nothing to do
return;
}
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ return;
+ }
VCSFileState[] states = model.getData(selectionModel);
log.info("files to treate :" + states.length);
-
+ JConfirmUI confirmUI = VCSUIFactory.newConfirmUI(Arrays.asList(states));
+ confirmUI.getModel().setAction(action);
+ confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, states.length - 1);
+ confirmUI.setVisible(true);
}
- public void doSelectTabAction(SynchVCSFileStatesModel model) {
+ public void doSelectTabAction(SimpleVCSFileStatesModel model) {
log.info(model);
String tabModelName = model.getName();
@@ -105,10 +110,22 @@
}
}
+ private void initTab(String modelName) {
+ JTable table = ui.getTable(modelName);
+ SimpleVCSFileStatesModel fileStatesModel = getModel().getModel(modelName);
+ table.setModel(fileStatesModel);
+ table.getSelectionModel().addListSelectionListener(this);
+ table.addMouseListener(new ListMouseListener(ui, fileStatesModel));
+ JVCSPopup jvcsPopup = ui.getPopup(modelName);
+ jvcsPopup.setDispatchAction(new VCSPopupAction(ui, modelName));
+ }
+
private class ListMouseListener extends MouseAdapter {
private final AbstractVCSFileStatesModel model;
+
private final ListSelectionModel selectionModel;
+
private final JTable jTable;
private final JVCSPopup jPopupMenu;
@@ -127,13 +144,17 @@
@Override
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
- initPopup(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
}
@Override
public void mouseReleased(MouseEvent e) {
super.mouseReleased(e);
- initPopup(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
}
@Override
@@ -141,8 +162,8 @@
// nothing to do
}
- protected void initPopup(MouseEvent e) {
- if (e.isPopupTrigger() && !selectionModel.isSelectionEmpty()) {
+ 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());
@@ -154,8 +175,9 @@
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, e.getX(), e.getY());
+ jPopupMenu.show(jTable, x, y);
}
}
}
Copied: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java (from rev 299, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -0,0 +1,61 @@
+/**
+ * # #% 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.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.action.VCSAbsractAction;
+import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+
+import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
+import java.util.Arrays;
+
+/**
+ * Action of a clik inside the popup menu
+ *
+ * @author chemit
+ */
+public class VCSPopupAction extends VCSAbsractAction {
+ private static final long serialVersionUID = -1983061535956510913L;
+
+ protected AbstractVCSFileStatesModel model;
+ protected transient ListSelectionModel selectionModel;
+
+ public VCSPopupAction(JSynchUI ui, String modelName) {
+ super(ui.getModel().getHandler());
+ this.model = ui.getModel().getModel(modelName);
+ this.selectionModel = ui.getTable(modelName).getSelectionModel();
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ // select only lines for this action inside already selected lines
+ model.select(action, selectionModel, false);
+ // obtain thoses lines
+ VCSFileState[] states = model.getData(selectionModel);
+ log.info("action: " + action + ", files to treate :" + states.length);
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ } else if (action == VCSAction.REFRESH) {
+ // refresh ui, and update list if needed
+ } else {
+ // show confirm action ui
+ JConfirmUI confirmUI = VCSUIFactory.newConfirmUI(Arrays.asList(states));
+ confirmUI.getModel().setAction(action);
+ confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, states.length - 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-03 17:01:40 UTC (rev 305)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -15,20 +15,69 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.action.AbstractUIHandler;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/** @author chemit */
public class VCSUIFactory {
- static JSynchUI synchUI;
+ protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ public static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
+ if (cache == null) {
+ cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
+ }
+ return cache;
+ }
+
+ protected static JSynchUI synchUI;
+ protected static JDiffUI diffUI;
+ protected static JConfirmUI confirmUI;
+
public static JSynchUI newSynchUI(List<VCSFileState> states) {
- if (synchUI == null) {
- synchUI = new JSynchUI();
- synchUI.setHandler(new SynchUIHandler(synchUI));
+ SynchUIHandler result = newHandler(SynchUIHandler.class, states);
+ return result.getUi();
+ }
+
+ public static JDiffUI newDiffUI(List<VCSFileState> states) {
+ DiffUIHandler result = newHandler(DiffUIHandler.class, states);
+ return result.getUi();
+ }
+
+ public static JConfirmUI newConfirmUI(List<VCSFileState> states) {
+ ConfirmUIHandler result = newHandler(ConfirmUIHandler.class, states);
+ return result.getUi();
+ }
+
+ public static void close() {
+ if (cache != null) {
+ cache.clear();
}
- synchUI.getModel().setData(states);
- return synchUI;
+ cache = null;
}
+
+ @SuppressWarnings({"unchecked"})
+ protected static <H extends AbstractUIHandler> H newHandler(Class<H> klass, List<VCSFileState> states) {
+ H result;
+ result = (H) getCache().get(klass);
+ if (result == null) {
+ try {
+ result = klass.newInstance();
+ result.init();
+ getCache().put(klass, result);
+ } catch (InstantiationException 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());
+ }
+ }
+ result.getModel().setData(states);
+ return result;
+ }
+
+ protected VCSUIFactory() {
+ }
}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java 2008-04-03 17:01:40 UTC (rev 305)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -1,49 +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.action;
-
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.JSynchUI;
-import org.codelutin.vcs.ui.JVCSPopup;
-import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
-
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-
-/** @author chemit */
-public class VCSPopupAction extends VCSAbsractAction {
- private static final long serialVersionUID = -1983061535956510913L;
-
- protected JVCSPopup popup;
- protected AbstractVCSFileStatesModel model;
- protected transient ListSelectionModel selectionModel;
-
- public VCSPopupAction(JSynchUI ui, String modelName) {
- super(ui.getModel().getHandler());
- this.model = ui.getModel().getModel(modelName);
- this.popup = ui.getPopup(modelName);
- this.selectionModel = ui.getTable(modelName).getSelectionModel();
- }
-
- public void actionPerformed(ActionEvent e) {
- // select only lines for this action inside already selected lines
- model.select(action, selectionModel, false);
- // obtain thoses lines
- VCSFileState[] states = model.getData(selectionModel);
- // do real vcs action on thoses lines
- //TODO delegate to VCSActionThread ?
- log.info("files to treate :" + states.length);
- }
-}
1
0
[Buix-commits] r305 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:01:40 +0000 (Thu, 03 Apr 2008)
New Revision: 305
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
Log:
ui constants
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-03 17:01:02 UTC (rev 304)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-03 17:01:40 UTC (rev 305)
@@ -27,17 +27,23 @@
};
/** model name for synchronize all tab ui */
- public static final String ALL_MODEL_PROPERTY = "modelSynchAll";
+ public static final String SYNCH_ALL_MODEL_PROPERTY = "modelSynchAll";
/** model name for synchronize local tab ui */
- public static final String LOCAL_MODEL_PROPERTY = "modelSynchLocal";
+ public static final String SYNCH_LOCAL_MODEL_PROPERTY = "modelSynchLocal";
/** model name for synchronize remote tab ui */
- public static final String REMOTE_MODEL_PROPERTY = "modelSynchRemote";
+ public static final String SYNCH_REMOTE_MODEL_PROPERTY = "modelSynchRemote";
- /** model name for diff ui */
- public static final String DIFF_MODEL_PROPERTY = "modelDiff";
+ /** model name for diff all tab ui */
+ public static final String DIFF_ALL_MODEL_PROPERTY = "modelDiffAll";
+ /** model name for diff local tab ui */
+ public static final String DIFF_LOCAL_MODEL_PROPERTY = "modelDiffLocal";
+
+ /** model name for diff remote tab ui */
+ public static final String DIFF_REMOTE_MODEL_PROPERTY = "modelDiffRemote";
+
/** model name for commit ui */
public static final String COMMIT_MODEL_PROPERTY = "modelCommit";
1
0
[Buix-commits] r304 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:01:02 +0000 (Thu, 03 Apr 2008)
New Revision: 304
Added:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
Log:
model d'uis
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,108 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.model;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.List;
+
+/** @author chemit */
+public abstract class AbstractUIModel {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static protected final Log log = LogFactory.getLog(AbstractUIModel.class);
+
+ /** vcs handler to use (lazy instanciation) */
+ protected VCSHandler handler;
+ /** support for change properties support */
+ protected PropertyChangeSupport changeSupport;
+
+ public VCSHandler getHandler() {
+ return handler;
+ }
+
+ public abstract void setData(List<VCSFileState> states);
+
+ public abstract void addData(List<VCSFileState> states);
+
+ public abstract void removeData(List<VCSFileState> states);
+
+ protected void splitStates(List<VCSFileState> states, List<VCSFileState> local, List<VCSFileState> remote) {
+ for (VCSFileState state : states) {
+ if (state.getState() != null && state.getState().isLocal()) {
+ local.add(state);
+ }
+ if (state.getState() != null && state.getState().isRemote()) {
+ remote.add(state);
+ }
+ }
+ }
+
+ public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ if (listener == null) {
+ return;
+ }
+ if (changeSupport == null) {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+ changeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
+ if (listener == null) {
+ return;
+ }
+ if (changeSupport == null) {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+ changeSupport.addPropertyChangeListener(listener);
+ }
+
+ public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
+ if (listener == null || changeSupport == null) {
+ return;
+ }
+ changeSupport.removePropertyChangeListener(listener);
+ }
+
+ public synchronized void removePropertyChangeListeners() {
+ if (changeSupport == null) {
+ return;
+ }
+ for (PropertyChangeListener listener : getPropertyChangeListeners()) {
+ changeSupport.removePropertyChangeListener(listener);
+ }
+ }
+
+ public synchronized PropertyChangeListener[] getPropertyChangeListeners() {
+ if (changeSupport == null) {
+ return new PropertyChangeListener[0];
+ }
+ return changeSupport.getPropertyChangeListeners();
+ }
+
+ public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ if (changeSupport == null || (oldValue == null && newValue == null) ||
+ (oldValue != null && oldValue.equals(newValue))) {
+ return;
+ }
+ changeSupport.firePropertyChange(propertyName, oldValue, newValue);
+ }
+}
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,106 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.model;
+
+import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class ConfirmUIModel extends AbstractUIModel {
+
+
+ /** la propri�t� pour indiquer un changement de racine d'arbre */
+ public static final String ACTION_PROPERTY_CHANGED = "tab";
+
+ /** local root : wroking copy */
+ protected URL localRoot;
+
+ /** remote root : remote url */
+ protected URL remoteRoot;
+
+ /** model */
+ protected SimpleVCSFileStatesModel model;
+
+ /** current action to fired */
+ protected VCSAction action;
+
+ protected List<String> messageHistory;
+
+ public ConfirmUIModel() {
+ }
+
+ public ConfirmUIModel(VCSHandler handler, URL leftRoot, URL rightRoot) {
+ this.handler = handler;
+ this.localRoot = leftRoot;
+ this.remoteRoot = rightRoot;
+ }
+
+ public AbstractVCSFileStatesModel getModel() {
+ if (model == null) {
+ model = new SimpleVCSFileStatesModel(action + "");
+ }
+ return model;
+ }
+
+ public List<String> getMessageHistory() {
+ if (messageHistory == null) {
+ messageHistory = new ArrayList<String>();
+ }
+ return messageHistory;
+ }
+
+ public void setData(List<VCSFileState> states) {
+ getModel().setData(states);
+ }
+
+ public void addData(List<VCSFileState> states) {
+ getModel().addData(states.toArray(new VCSFileState[states.size()]));
+ }
+
+ public void removeData(List<VCSFileState> states) {
+ getModel().removeData(states.toArray(new VCSFileState[states.size()]));
+ }
+
+ public void doAction(String commitMesssage) {
+ if (model == null || action == null) {
+ return;
+ }
+ if (commitMesssage != null && !getMessageHistory().contains(commitMesssage)) {
+ getMessageHistory().add(commitMesssage);
+ }
+ firePropertyChange(action.name().toLowerCase(), null, commitMesssage);
+ }
+
+ public void setAction(VCSAction action) {
+ VCSAction oldAction = this.action;
+ this.action = action;
+ firePropertyChange(ACTION_PROPERTY_CHANGED, oldAction, action);
+ }
+
+ public VCSAction getAction() {
+ return action;
+ }
+
+
+}
\ No newline at end of file
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,157 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.model;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.net.URL;
+
+/**
+ * Model of a diff panel (remote content vs local content
+ *
+ * @author chemit
+ */
+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 */
+ protected URL leftRoot;
+
+ /** remote root : remote url */
+ protected URL rightRoot;
+
+ /** vcs handler to use (lazy instanciation) */
+ protected VCSHandler handler;
+
+ /** map of models */
+ protected VCSFileState model;
+
+ /** support for change properties support */
+ protected PropertyChangeSupport changeSupport;
+
+ /** local content */
+ protected String leftContent;
+
+ /** remote content */
+ protected String rightContent;
+
+ /** current action to fired */
+ protected VCSAction action;
+
+ public DiffPanelUIModel() {
+ }
+
+ public DiffPanelUIModel(VCSHandler handler, URL leftRoot, URL rightRoot) {
+ this.handler = handler;
+ this.leftRoot = leftRoot;
+ this.rightRoot = rightRoot;
+ }
+
+ public VCSHandler getHandler() {
+ return handler;
+ }
+
+ public URL getLeftRoot() {
+ return leftRoot;
+ }
+
+ public URL getRightRoot() {
+ return rightRoot;
+ }
+
+ public String getLeftContent() {
+ return leftContent;
+ }
+
+ public String getRightContent() {
+ return rightContent;
+ }
+
+ public void setLeftContent(String leftContent) {
+ this.leftContent = leftContent;
+ }
+
+ public void setLeftRoot(URL leftRoot) {
+ this.leftRoot = leftRoot;
+ }
+
+ public void setRightContent(String rightContent) {
+ this.rightContent = rightContent;
+ }
+
+ public void setRightRoot(URL rightRoot) {
+ this.rightRoot = rightRoot;
+ }
+
+ public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ if (listener == null) {
+ return;
+ }
+ if (changeSupport == null) {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+ changeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
+ if (listener == null) {
+ return;
+ }
+ if (changeSupport == null) {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+ changeSupport.addPropertyChangeListener(listener);
+ }
+
+ public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
+ if (listener == null || changeSupport == null) {
+ return;
+ }
+ changeSupport.removePropertyChangeListener(listener);
+ }
+
+ public synchronized void removePropertyChangeListeners() {
+ if (changeSupport == null) {
+ return;
+ }
+ for (PropertyChangeListener listener : getPropertyChangeListeners()) {
+ changeSupport.removePropertyChangeListener(listener);
+ }
+ }
+
+ public synchronized PropertyChangeListener[] getPropertyChangeListeners() {
+ if (changeSupport == null) {
+ return new PropertyChangeListener[0];
+ }
+ return changeSupport.getPropertyChangeListeners();
+ }
+
+ public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ if (changeSupport == null || (oldValue == null && newValue == null) ||
+ (oldValue != null && oldValue.equals(newValue))) {
+ return;
+ }
+ changeSupport.firePropertyChange(propertyName, oldValue, newValue);
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java (from rev 298, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,172 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.model;
+
+import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_LOCAL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_REMOTE_MODEL_PROPERTY;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class DiffUIModel extends AbstractUIModel {
+
+ /** property to indicate change tab */
+ public static final String TAB_PROPERTY_CHANGED = "tab";
+
+ /** property to indicate change file (display a new DiffPanelUI) */
+ 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 COMMIT_PROPERTY_CHANGED = "commit";
+
+ public static final String UPDATE_PROPERTY_CHANGED = "update";
+
+ public static final String REVERT_PROPERTY_CHANGED = "revert";
+
+ /** local root : wroking copy */
+ protected URL leftRoot;
+
+ /** remote root : remote url */
+ protected URL rightRoot;
+
+ /** map of models */
+ protected List<SimpleVCSFileStatesModel> models;
+
+ /** current tab displayed */
+ protected AbstractVCSFileStatesModel tabModel;
+
+ /** current file displayed */
+ protected VCSFileState fileModel;
+
+ /** current action to fired */
+ protected VCSAction action;
+
+ public DiffUIModel() {
+ }
+
+ public DiffUIModel(VCSHandler handler, URL leftRoot, URL rightRoot) {
+ this.handler = handler;
+ this.leftRoot = leftRoot;
+ this.rightRoot = rightRoot;
+ }
+
+ public AbstractVCSFileStatesModel getTabModel() {
+ return tabModel;
+ }
+
+ public void setTabModel(AbstractVCSFileStatesModel tabModel) {
+ AbstractVCSFileStatesModel oldTabModel = this.tabModel;
+ this.tabModel = tabModel;
+ firePropertyChange(TAB_PROPERTY_CHANGED, oldTabModel, tabModel);
+ }
+
+ public void setFileModel(VCSFileState fileModel) {
+ VCSFileState oldFileModel = this.fileModel;
+ this.fileModel = fileModel;
+ firePropertyChange(TAB_PROPERTY_CHANGED, oldFileModel, tabModel);
+ }
+
+ public AbstractVCSFileStatesModel getTabModel(String tabModel) {
+ return getModel(tabModel);
+ }
+
+ public void setLeftRoot(URL leftRoot) {
+ this.leftRoot = leftRoot;
+ }
+
+ public void setRightRoot(URL rightRoot) {
+ this.rightRoot = rightRoot;
+ }
+
+ public SimpleVCSFileStatesModel getModel(String modelName) {
+ SimpleVCSFileStatesModel tableModel = null;
+ for (SimpleVCSFileStatesModel model : getModels()) {
+ if (modelName.equals(model.getName())) {
+ tableModel = model;
+ break;
+ }
+ }
+ if (tableModel == null) {
+ getModels().add(tableModel = new SimpleVCSFileStatesModel(modelName));
+ }
+ return tableModel;
+ }
+
+ public void doAllAction(VCSAction action) {
+ if (tabModel == null) {
+ return;
+ }
+ this.action = action;
+ firePropertyChange(action.name().toLowerCase() + "All", null, tabModel);
+ }
+
+ public void setData(List<VCSFileState> states) {
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
+ List<VCSFileState> local = new ArrayList<VCSFileState>();
+ List<VCSFileState> remote = new ArrayList<VCSFileState>();
+ splitStates(states, local, remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).setData(local);
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).setData(remote);
+ }
+
+ public void addData(List<VCSFileState> states) {
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
+ List<VCSFileState> local = new ArrayList<VCSFileState>();
+ List<VCSFileState> remote = new ArrayList<VCSFileState>();
+ splitStates(states, local, remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).addData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).addData(remote.toArray(new VCSFileState[remote.size()]));
+ }
+
+ public void removeData(List<VCSFileState> states) {
+ getModel(SYNCH_ALL_MODEL_PROPERTY).removeData(states.toArray(new VCSFileState[states.size()]));
+ List<VCSFileState> local = new ArrayList<VCSFileState>();
+ List<VCSFileState> remote = new ArrayList<VCSFileState>();
+ splitStates(states, local, remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).removeData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).removeData(remote.toArray(new VCSFileState[remote.size()]));
+ }
+
+ public void doAction(VCSAction action) {
+ if (tabModel == null) {
+ return;
+ }
+ this.action = action;
+ firePropertyChange(action.name().toLowerCase(), null, tabModel);
+ }
+
+ protected List<SimpleVCSFileStatesModel> getModels() {
+ if (models == null) {
+ models = new ArrayList<SimpleVCSFileStatesModel>();
+ }
+ return models;
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java (from rev 301, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,49 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.model;
+
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.ui.VCSUIConstants;
+
+/** @author chemit */
+public class SimpleVCSFileStatesModel extends AbstractVCSFileStatesModel {
+
+ private static final long serialVersionUID = -7592705623128585146L;
+
+ public SimpleVCSFileStatesModel(String name) {
+ super(name, VCSUIConstants.SIMPLE_COLUMNS_NAMES);
+ }
+
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ if (isEmpty()) return null;
+ VCSFileState item = data.get(rowIndex);
+ Object result = null;
+ if (columnIndex == 0) {
+ // get module
+ result = item.getModuleName();
+ } else if (columnIndex == 1) {
+ // get file
+ result = item.getModuleRelativeFileName();
+ } else if (columnIndex == 2) {
+ // get status
+ VCSState state = item.getState();
+ result = state == null ? null : state.libelle();
+ }
+ return result;
+ }
+
+
+}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-03 17:00:51 UTC (rev 303)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -14,17 +14,13 @@
*/
package org.codelutin.vcs.ui.model;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
import org.codelutin.vcs.VCSHandler;
-import static org.codelutin.vcs.ui.VCSUIConstants.ALL_MODEL_PROPERTY;
-import static org.codelutin.vcs.ui.VCSUIConstants.LOCAL_MODEL_PROPERTY;
-import static org.codelutin.vcs.ui.VCSUIConstants.REMOTE_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_LOCAL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_REMOTE_MODEL_PROPERTY;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
@@ -35,11 +31,8 @@
*
* @author chemit
*/
-public class SynchUIModel {
+public class SynchUIModel extends AbstractUIModel {
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static protected final Log log = LogFactory.getLog(SynchUIModel.class);
-
/** la propri�t� pour indiquer un changement de racine d'arbre */
public static final String TAB_PROPERTY_CHANGED = "tab";
@@ -65,15 +58,9 @@
/** remote root : remote url */
protected URL remoteRoot;
- /** vcs handler to use (lazy instanciation) */
- protected VCSHandler handler;
-
/** map of models */
- protected List<SynchVCSFileStatesModel> models;
+ protected List<SimpleVCSFileStatesModel> models;
- /** support for change properties support */
- protected PropertyChangeSupport changeSupport;
-
/** current tab displayed */
protected AbstractVCSFileStatesModel tabModel;
@@ -115,45 +102,45 @@
this.remoteRoot = remoteRoot;
}
- public SynchVCSFileStatesModel getModel(String modelName) {
- SynchVCSFileStatesModel tableModel = null;
- for (SynchVCSFileStatesModel model : getModels()) {
+ public SimpleVCSFileStatesModel getModel(String modelName) {
+ SimpleVCSFileStatesModel tableModel = null;
+ for (SimpleVCSFileStatesModel model : getModels()) {
if (modelName.equals(model.getName())) {
tableModel = model;
break;
}
}
if (tableModel == null) {
- getModels().add(tableModel = new SynchVCSFileStatesModel(modelName));
+ getModels().add(tableModel = new SimpleVCSFileStatesModel(modelName));
}
return tableModel;
}
public void setData(List<VCSFileState> states) {
- getModel(ALL_MODEL_PROPERTY).setData(states);
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
List<VCSFileState> local = new ArrayList<VCSFileState>();
List<VCSFileState> remote = new ArrayList<VCSFileState>();
splitStates(states, local, remote);
- getModel(LOCAL_MODEL_PROPERTY).setData(local);
- getModel(REMOTE_MODEL_PROPERTY).setData(remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).setData(local);
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).setData(remote);
}
public void addData(List<VCSFileState> states) {
- getModel(ALL_MODEL_PROPERTY).setData(states);
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
List<VCSFileState> local = new ArrayList<VCSFileState>();
List<VCSFileState> remote = new ArrayList<VCSFileState>();
splitStates(states, local, remote);
- getModel(LOCAL_MODEL_PROPERTY).addData(local.toArray(new VCSFileState[local.size()]));
- getModel(REMOTE_MODEL_PROPERTY).addData(remote.toArray(new VCSFileState[remote.size()]));
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).addData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).addData(remote.toArray(new VCSFileState[remote.size()]));
}
public void removeData(List<VCSFileState> states) {
- getModel(ALL_MODEL_PROPERTY).removeData(states.toArray(new VCSFileState[states.size()]));
+ getModel(SYNCH_ALL_MODEL_PROPERTY).removeData(states.toArray(new VCSFileState[states.size()]));
List<VCSFileState> local = new ArrayList<VCSFileState>();
List<VCSFileState> remote = new ArrayList<VCSFileState>();
splitStates(states, local, remote);
- getModel(LOCAL_MODEL_PROPERTY).removeData(local.toArray(new VCSFileState[local.size()]));
- getModel(REMOTE_MODEL_PROPERTY).removeData(remote.toArray(new VCSFileState[remote.size()]));
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).removeData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).removeData(remote.toArray(new VCSFileState[remote.size()]));
}
public void doAllAction(VCSAction action) {
@@ -164,72 +151,12 @@
firePropertyChange(action.name().toLowerCase() + "All", null, tabModel);
}
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (listener == null) {
- return;
- }
- if (changeSupport == null) {
- changeSupport = new PropertyChangeSupport(this);
- }
- changeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- if (listener == null) {
- return;
- }
- if (changeSupport == null) {
- changeSupport = new PropertyChangeSupport(this);
- }
- changeSupport.addPropertyChangeListener(listener);
- }
-
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- if (listener == null || changeSupport == null) {
- return;
- }
- changeSupport.removePropertyChangeListener(listener);
- }
-
- public synchronized void removePropertyChangeListeners() {
- if (changeSupport == null) {
- return;
- }
- for (PropertyChangeListener listener : getPropertyChangeListeners()) {
- changeSupport.removePropertyChangeListener(listener);
- }
- }
-
- public synchronized PropertyChangeListener[] getPropertyChangeListeners() {
- if (changeSupport == null) {
- return new PropertyChangeListener[0];
- }
- return changeSupport.getPropertyChangeListeners();
- }
-
- public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
- if (changeSupport == null || (oldValue == null && newValue == null) ||
- (oldValue != null && oldValue.equals(newValue))) {
- return;
- }
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- protected List<SynchVCSFileStatesModel> getModels() {
+ protected List<SimpleVCSFileStatesModel> getModels() {
if (models == null) {
- models = new ArrayList<SynchVCSFileStatesModel>();
+ models = new ArrayList<SimpleVCSFileStatesModel>();
}
return models;
}
- protected void splitStates(List<VCSFileState> states, List<VCSFileState> local, List<VCSFileState> remote) {
- for (VCSFileState state : states) {
- if (state.getState() != null && state.getState().isLocal()) {
- local.add(state);
- }
- if (state.getState() != null && state.getState().isRemote()) {
- remote.add(state);
- }
- }
- }
+
}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java 2008-04-03 17:00:51 UTC (rev 303)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -1,47 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui.model;
-
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.VCSState;
-import org.codelutin.vcs.ui.VCSUIConstants;
-
-/** @author chemit */
-public class SynchVCSFileStatesModel extends AbstractVCSFileStatesModel {
- private static final long serialVersionUID = -7592705623128585146L;
-
- public SynchVCSFileStatesModel(String name) {
- super(name, VCSUIConstants.SIMPLE_COLUMNS_NAMES);
- }
-
- public Object getValueAt(int rowIndex, int columnIndex) {
- if (isEmpty()) return null;
- VCSFileState item = data.get(rowIndex);
- Object result = null;
- if (columnIndex == 0) {
- // get module
- result = item.getModuleName();
- } else if (columnIndex == 1) {
- // get file
- result = item.getModuleRelativeFileName();
- } else if (columnIndex == 2) {
- // get status
- VCSState state = item.getState();
- result = state == null ? null : state.libelle();
- }
- return result;
- }
-
-}
1
0