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
- 3898 discussions
[Buix-commits] r417 - in trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui: . handler
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:41:08 +0000 (Sun, 06 Apr 2008)
New Revision: 417
Modified:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
Log:
clean code and remove AbstractHandler unused
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:39:22 UTC (rev 416)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:41:08 UTC (rev 417)
@@ -51,7 +51,7 @@
@Override
- protected ConfirmUIHandler getHandler() {
+ public ConfirmUIHandler getHandler() {
return (ConfirmUIHandler) super.getHandler();
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 17:39:22 UTC (rev 416)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 17:41:08 UTC (rev 417)
@@ -37,7 +37,7 @@
public abstract JMenuItem getDelete();
- protected void setDispatchAction(VCSAbsractAction action) {
+ public void setDispatchAction(VCSAbsractAction action) {
this.dispatchAction = action;
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-06 17:39:22 UTC (rev 416)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-06 17:41:08 UTC (rev 417)
@@ -3,7 +3,6 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
import org.codelutin.vcs.ui.AbstractSynchUI;
1
0
[Buix-commits] r416 - trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:39:22 +0000 (Sun, 06 Apr 2008)
New Revision: 416
Modified:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
clean code and remove AbstractHandler unused
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:39:09 UTC (rev 415)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:39:22 UTC (rev 416)
@@ -19,6 +19,9 @@
import org.codelutin.util.StringUtil;
import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.handler.ConfirmUIHandler;
+import org.codelutin.vcs.ui.handler.DiffUIHandler;
+import org.codelutin.vcs.ui.handler.SynchUIHandler;
import org.codelutin.vcs.ui.model.AbstractUIModel;
import java.util.HashMap;
1
0
[Buix-commits] r415 - in trunk/lutinvcs: lutinvcs-api/src/main/resources/i18n lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:39:09 +0000 (Sun, 06 Apr 2008)
New Revision: 415
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
Removed:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
Modified:
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
Log:
clean code and remove AbstractHandler unused
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties 2008-04-06 17:39:09 UTC (rev 415)
@@ -6,8 +6,8 @@
lutinvcs.action.diff=voir les diff\u00E9rences
lutinvcs.action.overwriteAndUpdate=Update
lutinvcs.action.refresh=Rafra\u00EEchir
-lutinvcs.action.revert=Rollback
-lutinvcs.action.update=Update
+lutinvcs.action.revert=Annuler les modifications
+lutinvcs.action.update=Mettre \u00E0 jour
lutinvcs.error.checkout.dir=Ne peut pas uploader le fichier ''{0}''
lutinvcs.error.connexion.noinit=La connexion {0} n''a pas \u00E9t\u00E9 initialis\u00E9e
lutinvcs.error.connexion.noopen=La connexion {0} n''a pas \u00E9t\u00E9 ouverte
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,11 +1,6 @@
<AbstractConfirmUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
resizable='false' height='300' width='400'>
<style source="common.css"/>
- <!--script>
- public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
- super(handler);
- }
- </script-->
<Table>
<row fill='both'>
<cell fill='both'>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,13 +1,5 @@
<AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
- <!--script>
- import org.codelutin.vcs.type.VCSAction;
- import org.codelutin.vcs.type.VCSEntryLocation;
-
- /*public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
- super(handler);
- }*/
- </script-->
<java.awt.CardLayout id='cardLayout'/>
<Table>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,13 +1,6 @@
<AbstractSynchUI title='lutinvcs.synch.title' modal="true" defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
- <!--script>
- import org.codelutin.vcs.type.VCSAction;
- import org.codelutin.vcs.type.VCSEntryLocation;
- /*public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
- super(handler);
- }*/
- </script-->
<java.awt.CardLayout id='cardLayout'/>
<JVCSPopup id="allPopup"/>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml 2008-04-06 17:39:09 UTC (rev 415)
@@ -43,6 +43,11 @@
<scope>compile</scope>
</dependency>
<dependency>
+ <groupId>lutinlib.vcs</groupId>
+ <artifactId>lutinvcs-provider-mock</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
<groupId>lutinlib</groupId>
<artifactId>jaxx</artifactId>
<scope>compile</scope>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -15,9 +15,9 @@
package org.codelutin.vcs.ui;
import jaxx.runtime.swing.Table;
-import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
+import org.codelutin.vcs.ui.handler.ConfirmUIHandler;
import javax.swing.JButton;
import javax.swing.JLabel;
@@ -51,8 +51,8 @@
@Override
- protected AbstractConfirmUIHandler getHandler() {
- return (AbstractConfirmUIHandler) super.getHandler();
+ protected ConfirmUIHandler getHandler() {
+ return (ConfirmUIHandler) super.getHandler();
}
@Override
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -15,9 +15,8 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
-import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
import org.codelutin.vcs.ui.model.DiffUIModel;
+import org.codelutin.vcs.ui.handler.DiffUIHandler;
import javax.swing.JButton;
@@ -34,8 +33,8 @@
}
@Override
- protected AbstractDiffUIHandler getHandler() {
- return (AbstractDiffUIHandler) handler;
+ protected DiffUIHandler getHandler() {
+ return (DiffUIHandler) handler;
}
protected void selectFile() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -16,8 +16,8 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.model.SynchUIModel;
+import org.codelutin.vcs.ui.handler.SynchUIHandler;
import javax.swing.JButton;
@@ -49,8 +49,8 @@
}
@Override
- protected AbstractSynchUIHandler getHandler() {
- return (AbstractSynchUIHandler) handler;
+ protected SynchUIHandler getHandler() {
+ return (SynchUIHandler) handler;
}
public AbstractVCSPopup getPopup(VCSEntryLocation modelName) {
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,112 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.ConfirmUIModel;
-
-import javax.swing.ListSelectionModel;
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-/** @author chemit */
-public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
-
-
- public ConfirmUIHandler() {
- super();
- //this.ui = new JConfirmUI(this);
- }
-
- /*public void setUi(AbstractConfirmUI ui) {
- this.ui = ui;
- }*/
-
- /*public ConfirmUIModel getModel() {
- return getUi().getModel();
- }*/
-
-
- public Class<AbstractConfirmUI> getUiClass() {
- return AbstractConfirmUI.class;
- }
-
- public Class<? super ConfirmUIModel> getModelClass() {
- return ConfirmUIModel.class;
- }
-
- public ListSelectionModel getSelectionModel() {
- return getUi().getContentTable().getSelectionModel();
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
-
- if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
- updateUI();
- return;
- }
-
- if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
- updateMessageUI();
- return;
- }
-
- throw new IllegalStateException("unimplemented property changed : " + evt);
- }
-
- protected void updateUI() {
- VCSAction action = getModel().getAction();
- getUi().getAccept().setText(action.getLibelle());
- getUi().getToolbar().setVisible(action.isCommit());
- getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
- }
-
- protected void updateMessageUI() {
- // update message history combo box ?
- getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
- }
-
- public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
-
- VCSAction action = getModel().getAction();
-
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
-
- if (action.isCommit()) {
- getModel().addCommitMessage(commitMessage);
-
- } else {
- commitMessage = null;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
- }
-
- getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
-
- // dispose ui
- getUi().dispose();
-
- }
-
-
-}
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,92 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
-
- //protected AbstractDiffUI ui;
-
- public DiffUIHandler() {
- //this.ui = new JDiffUI(this);
- }
-
- /*public AbstractDiffUI getUi() {
- return ui;
- }*/
-
- /*public void setUi(AbstractDiffUI ui) {
- this.ui = ui;
- }
-
- public DiffUIModel getModel() {
- return ui.getModel();
- }*/
-
- public Class<AbstractDiffUI> getUiClass() {
- return AbstractDiffUI.class;
- }
-
- public Class<? super DiffUIModel> getModelClass() {
- return DiffUIModel.class;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
-
- String action = evt.getPropertyName();
- if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSEntry) evt.getNewValue());
- } else {
- super.propertyChange(evt);
- }
- }
-
- @Override
- public void doSelectLocation(VCSEntryLocation location) {
- super.doSelectLocation(location);
-
- }
-
- protected void initTab(VCSEntryLocation location) {
- //TODO
- }
-
- public void doSelectFile(VCSEntry model) {
- //TODO
- }
-
- public void doAction(VCSAction action, VCSEntry model) {
- //TODO
- }
-
- public void gotoNextDiff() {
- //TODO
- }
-
- public void gotoPreviousDiff() {
- //TODO
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,177 +0,0 @@
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-/** @author chemit */
-public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
-
- //protected AbstractSynchUI ui;
-
- public SynchUIHandler() {
- //this.ui = new JSynchUI(this);
- }
-
- public Class<AbstractSynchUI> getUiClass() {
- return AbstractSynchUI.class;
- }
-
- public Class<? super SynchUIModel> getModelClass() {
- return SynchUIModel.class;
- }
-
- /*public void setUi(AbstractSynchUI ui) {
- this.ui = ui;
- }
-
- public AbstractSynchUI getUi() {
- return ui;
- }*/
-
- /*public SynchUIModel getModel() {
- return ui.getModel();
- }*/
-
- /*public void doAllAction(VCSAction action) {
- doAction(action, false);
- }
-
- public void doSelectAction(VCSAction action) {
- doAction(action, true);
- }*/
-
- @Override
- public void doSelectLocation(VCSEntryLocation location) {
-
- super.doSelectLocation(location);
-
- VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : actions) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = actions.length > 0;
- getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
- getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
- getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
- getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
- getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
- getUi().getRefreshAll().setEnabled(hasActions);
- }
-
- public void doAction(VCSAction action, boolean useSelection) {
- AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
- log.info(action + " : " + model);
- ListSelectionModel selectionModel = getSelectionModel();
- if (action == VCSAction.REFRESH) {
- selectionModel.clearSelection();
- // do refresh of all states
- log.info("refresh :" + model.getRowCount());
- model.refresh(model.getEntries(), System.nanoTime());
- } else {
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
- if (entries.isEmpty()) {
- // nothing to do
- return;
- }
- if (action == VCSAction.DIFF) {
- // show diff ui
- return;
- }
- log.info("files to treate :" + entries.size());
-
- AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
-
- confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
-
- confirmUI.setVisible(true);
- //TODO SynchModel should listener for modification on ActionManagerQueue thread
- log.info("TODO refresh states for files...");
- }
- }
-
- protected void initTab(VCSEntryLocation location) {
- JTable table = getUi().getTable(location);
- AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
- table.setModel(fileStatesModel);
- table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
- AbstractVCSPopup popup = getUi().getPopup(location);
-
- popup.setDispatchAction(new VCSAbsractAction() {
- private static final long serialVersionUID = 8622118724992019898L;
-
- public void actionPerformed(ActionEvent e) {
- doAction(action, false);
- }
- });
- }
-
- protected static class ListMouseListener extends MouseAdapter {
-
- private final AbstractVCSEntriesTableModel model;
-
- private final ListSelectionModel selectionModel;
-
- private final JTable jTable;
- private final AbstractVCSPopup jPopupMenu;
-
- public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
- this.model = model;
- jPopupMenu = ui.getPopup(modelName);
- jTable = ui.getTable(modelName);
- selectionModel = jTable.getSelectionModel();
- }
-
- @Override
- public void mousePressed(MouseEvent e) {
- super.mousePressed(e);
- if (e.isPopupTrigger()) {
- initPopup(e.getX(), e.getY());
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent e) {
- super.mouseReleased(e);
- if (e.isPopupTrigger()) {
- initPopup(e.getX(), e.getY());
- }
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- // nothing to do
- }
-
- protected void initPopup(int x, int y) {
- if (!selectionModel.isSelectionEmpty()) {
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : model.getActions(selectionModel)) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = !acts.isEmpty();
- jPopupMenu.getDiff().setEnabled(hasActions && acts.contains("diff"));
- jPopupMenu.getUpdate().setEnabled(hasActions && acts.contains("update"));
- jPopupMenu.getCommit().setEnabled(hasActions && acts.contains("commit"));
- jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
- jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
- jPopupMenu.getRefresh().setEnabled(hasActions);
- jPopupMenu.pack();
- // display popup
- jPopupMenu.show(jTable, x, y);
- }
- }
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,81 +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.handler;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.AbstractConfirmUI;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.ConfirmUIModel;
-
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-/**
- * Abstract ConfirmUI handler
- *
- * @author chemit
- */
-public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
-
- protected abstract void updateUI();
-
- protected abstract void updateMessageUI();
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
-
- if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
- updateUI();
- return;
- }
-
- if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
- updateMessageUI();
- return;
- }
-
- throw new IllegalStateException("unimplemented property changed : " + evt);
- }
-
- public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
-
- VCSAction action = getModel().getAction();
-
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
-
- if (action.isCommit()) {
- getModel().addCommitMessage(commitMessage);
-
- } else {
- commitMessage = null;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
- }
-
- getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
-
- // dispose ui
- getUi().dispose();
-
- }
-
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -1,66 +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.handler;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.AbstractDiffUI;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public abstract class AbstractDiffUIHandler<U extends AbstractDiffUI> extends AbstractTabUIHandler<DiffUIModel, U> {
-
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
-
- String action = evt.getPropertyName();
- if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSEntry) evt.getNewValue());
- } else {
- super.propertyChange(evt);
- }
- }
-
- public abstract void doSelectFile(VCSEntry model);
-
- public abstract void doAction(VCSAction action, VCSEntry model);
-
- public abstract void gotoNextDiff();
-
- public abstract void gotoPreviousDiff();
-
- public void doSelectLocation(VCSEntryLocation location) {
- log.info(location);
-
- getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
- //VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
- /*List<String> acts = new ArrayList<String>();
- for (VCSAction action : actions) {
- acts.add(action.name().toLowerCase());
- } */
- /*boolean hasActions = actions.length > 0;
- getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
- getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
- getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
- getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
- getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
- getUi().getRefreshAll().setEnabled(hasActions);*/
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 17:24:11 UTC (rev 414)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -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.handler;
-
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.AbstractSynchUI;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-
-import javax.swing.ListSelectionModel;
-import java.util.ArrayList;
-import java.util.List;
-
-/** @author chemit */
-public abstract class AbstractSynchUIHandler<U extends AbstractSynchUI> extends AbstractTabUIHandler<SynchUIModel, U> {
-
- public abstract void doAction(VCSAction action, boolean useSelect);
-
- public void doSelectLocation(VCSEntryLocation location) {
-
- super.doSelectLocation(location);
-
- VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : actions) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = actions.length > 0;
- getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
- getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
- getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
- getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
- getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
- getUi().getRefreshAll().setEnabled(hasActions);
- }
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java (from rev 413, trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -0,0 +1,113 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+import org.codelutin.vcs.ui.AbstractConfirmUI;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+
+/** @author chemit */
+public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
+
+
+ public ConfirmUIHandler() {
+ super();
+ //this.ui = new JConfirmUI(this);
+ }
+
+ /*public void setUi(AbstractConfirmUI ui) {
+ this.ui = ui;
+ }*/
+
+ /*public ConfirmUIModel getModel() {
+ return getUi().getModel();
+ }*/
+
+
+ public Class<AbstractConfirmUI> getUiClass() {
+ return AbstractConfirmUI.class;
+ }
+
+ public Class<? super ConfirmUIModel> getModelClass() {
+ return ConfirmUIModel.class;
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ return getUi().getContentTable().getSelectionModel();
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ updateMessageUI();
+ return;
+ }
+
+ throw new IllegalStateException("unimplemented property changed : " + evt);
+ }
+
+ protected void updateUI() {
+ VCSAction action = getModel().getAction();
+ getUi().getAccept().setText(action.getLibelle());
+ getUi().getToolbar().setVisible(action.isCommit());
+ getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
+ }
+
+ protected void updateMessageUI() {
+ // update message history combo box ?
+ getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
+ }
+
+ public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
+
+ VCSAction action = getModel().getAction();
+
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
+
+ if (action.isCommit()) {
+ getModel().addCommitMessage(commitMessage);
+
+ } else {
+ commitMessage = null;
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
+ }
+
+ getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
+
+ // dispose ui
+ getUi().dispose();
+
+ }
+
+
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java (from rev 413, trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -0,0 +1,93 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+import org.codelutin.vcs.ui.AbstractDiffUI;
+
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
+
+ //protected AbstractDiffUI ui;
+
+ public DiffUIHandler() {
+ //this.ui = new JDiffUI(this);
+ }
+
+ /*public AbstractDiffUI getUi() {
+ return ui;
+ }*/
+
+ /*public void setUi(AbstractDiffUI ui) {
+ this.ui = ui;
+ }
+
+ public DiffUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ public Class<AbstractDiffUI> getUiClass() {
+ return AbstractDiffUI.class;
+ }
+
+ public Class<? super DiffUIModel> getModelClass() {
+ return DiffUIModel.class;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+
+ String action = evt.getPropertyName();
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
+ } else {
+ super.propertyChange(evt);
+ }
+ }
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+ super.doSelectLocation(location);
+
+ }
+
+ protected void initTab(VCSEntryLocation location) {
+ //TODO
+ }
+
+ public void doSelectFile(VCSEntry model) {
+ //TODO
+ }
+
+ public void doAction(VCSAction action, VCSEntry model) {
+ //TODO
+ }
+
+ public void gotoNextDiff() {
+ //TODO
+ }
+
+ public void gotoPreviousDiff() {
+ //TODO
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java (from rev 413, trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-06 17:39:09 UTC (rev 415)
@@ -0,0 +1,181 @@
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.handler.VCSAbsractAction;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+import org.codelutin.vcs.ui.AbstractSynchUI;
+import org.codelutin.vcs.ui.AbstractConfirmUI;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import org.codelutin.vcs.ui.AbstractVCSPopup;
+
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
+
+ //protected AbstractSynchUI ui;
+
+ public SynchUIHandler() {
+ //this.ui = new JSynchUI(this);
+ }
+
+ public Class<AbstractSynchUI> getUiClass() {
+ return AbstractSynchUI.class;
+ }
+
+ public Class<? super SynchUIModel> getModelClass() {
+ return SynchUIModel.class;
+ }
+
+ /*public void setUi(AbstractSynchUI ui) {
+ this.ui = ui;
+ }
+
+ public AbstractSynchUI getUi() {
+ return ui;
+ }*/
+
+ /*public SynchUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ /*public void doAllAction(VCSAction action) {
+ doAction(action, false);
+ }
+
+ public void doSelectAction(VCSAction action) {
+ doAction(action, true);
+ }*/
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
+ }
+
+ public void doAction(VCSAction action, boolean useSelection) {
+ AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
+ log.info(action + " : " + model);
+ ListSelectionModel selectionModel = getSelectionModel();
+ if (action == VCSAction.REFRESH) {
+ selectionModel.clearSelection();
+ // do refresh of all states
+ log.info("refresh :" + model.getRowCount());
+ model.refresh(model.getEntries(), System.nanoTime());
+ } else {
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
+ if (entries.isEmpty()) {
+ // nothing to do
+ return;
+ }
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ return;
+ }
+ log.info("files to treate :" + entries.size());
+
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+
+ confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
+
+ confirmUI.setVisible(true);
+ //TODO SynchModel should listener for modification on ActionManagerQueue thread
+ log.info("TODO refresh states for files...");
+ }
+ }
+
+ protected void initTab(VCSEntryLocation location) {
+ JTable table = getUi().getTable(location);
+ AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
+ table.setModel(fileStatesModel);
+ table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
+ AbstractVCSPopup popup = getUi().getPopup(location);
+
+ popup.setDispatchAction(new VCSAbsractAction() {
+ private static final long serialVersionUID = 8622118724992019898L;
+
+ public void actionPerformed(ActionEvent e) {
+ doAction(action, false);
+ }
+ });
+ }
+
+ protected static class ListMouseListener extends MouseAdapter {
+
+ private final AbstractVCSEntriesTableModel model;
+
+ private final ListSelectionModel selectionModel;
+
+ private final JTable jTable;
+ private final AbstractVCSPopup jPopupMenu;
+
+ public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
+ this.model = model;
+ jPopupMenu = ui.getPopup(modelName);
+ jTable = ui.getTable(modelName);
+ selectionModel = jTable.getSelectionModel();
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ super.mousePressed(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ super.mouseReleased(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ // nothing to do
+ }
+
+ protected void initPopup(int x, int y) {
+ if (!selectionModel.isSelectionEmpty()) {
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : model.getActions(selectionModel)) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = !acts.isEmpty();
+ jPopupMenu.getDiff().setEnabled(hasActions && acts.contains("diff"));
+ jPopupMenu.getUpdate().setEnabled(hasActions && acts.contains("update"));
+ jPopupMenu.getCommit().setEnabled(hasActions && acts.contains("commit"));
+ jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
+ jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
+ jPopupMenu.getRefresh().setEnabled(hasActions);
+ jPopupMenu.pack();
+ // display popup
+ jPopupMenu.show(jTable, x, y);
+ }
+ }
+ }
+}
1
0
[Buix-commits] r414 - trunk/lutinvcs/lutinvcs-ui/src/test/java
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:24:11 +0000 (Sun, 06 Apr 2008)
New Revision: 414
Removed:
trunk/lutinvcs/lutinvcs-ui/src/test/java/org/
Log:
move UITest to jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
1
0
[Buix-commits] r413 - in trunk/lutinvcs: lutinvcs-ui/src/test/java/org/codelutin/vcs/ui lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:22:37 +0000 (Sun, 06 Apr 2008)
New Revision: 413
Added:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java
Removed:
trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
Log:
move UITest to jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
Deleted: trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 17:19:12 UTC (rev 412)
+++ trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 17:22:37 UTC (rev 413)
@@ -1,95 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.i18n.I18n;
-import org.codelutin.vcs.VCSConnexion;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.type.VCSState;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.util.VCSConnexionConfigImpl;
-import org.codelutin.vcs.util.VCSEntryImpl;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/** @author chemit */
-public class UITest {
-
- /** The r. */
- static java.util.Random r = new java.util.Random();
-
- public static void main(String[] args) {
-
- I18n.init();
-
- VCSConnexion connexion = initVCS(new File(new File("").getAbsolutePath()));
-
- try {
- connexion.open();
-
- AbstractSynchUI ui = VCSUIFactory.newSynchUI();
-
- fillSynchModel(connexion, ui.getModel(), 20, "trunk", "local/", "remote/");
-
- ui.setVisible(true);
-
- } finally {
- connexion.close();
- }
- }
-
- public static VCSConnexion initVCS(File root) {
- VCSConnexionConfigImpl config = new VCSConnexionConfigImpl();
- config.setType("MOCK");
- config.setLocalDatabasePath(root);
- VCSConnexion connexion = VCSFactory.newConnexion(VCSConnexionMode.ANONYMOUS, config);
- connexion.init(config);
- return connexion;
- }
-
- protected static void fillSynchModel(VCSConnexion handler, SynchUIModel model, int max, String prefix, String localPRefix, String remotePrefix) {
- List<VCSEntry> datas = generateListFileStates(handler, max, prefix, localPRefix, remotePrefix);
- model.populate(VCSEntryLocation.UNKNOW, datas.toArray(new VCSEntry[datas.size()]));
- }
-
- protected static List<VCSEntry> generateListFileStates(VCSConnexion handler, int max, String prefix, String localPRefix, String remotePrefix) {
- List<VCSEntry> datas = generateLocalFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), localPRefix);
- datas.addAll(generateRemoteFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), remotePrefix));
- return datas;
- }
-
- protected static List<VCSEntry> generateLocalFileStates(VCSConnexion handler, int max, File root, String localPRefix) {
- return generateFileStates(handler, root, max, localPRefix, VCSState.MODIFIED, VCSState.UNVERSIONNED, VCSState.OUT_OF_DATE_AND_MODIFIED, VCSState.REMOVED);
- }
-
- protected static List<VCSEntry> generateRemoteFileStates(VCSConnexion handler, int max, File root, String remotePRefix) {
- return generateFileStates(handler, root, max, remotePRefix, VCSState.MISSING, VCSState.OUT_OF_DATE, VCSState.OUT_OF_DATE_AND_MODIFIED);
- }
-
- protected static List<VCSEntry> generateFileStates(VCSConnexion handler, File root, int max, String prefix, VCSState... states) {
- List<VCSEntry> datas = new ArrayList<VCSEntry>();
- for (int i = 0, nbFiles = 1 + r.nextInt(max), size = states.length; i < nbFiles; i++) {
- VCSEntry state = new VCSEntryImpl(handler, root.getName() + File.separator + prefix + "file" + i);
- state.setState(states[r.nextInt(size)]);
- datas.add(state);
- }
- return datas;
- }
-}
Copied: trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java (from rev 402, trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 17:22:37 UTC (rev 413)
@@ -0,0 +1,95 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.codelutin.i18n.I18n;
+import org.codelutin.vcs.VCSConnexion;
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSState;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+import org.codelutin.vcs.util.VCSConnexionConfigImpl;
+import org.codelutin.vcs.util.VCSEntryImpl;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public class UITest {
+
+ /** The r. */
+ static java.util.Random r = new java.util.Random();
+
+ public static void main(String[] args) {
+
+ I18n.init();
+
+ VCSConnexion connexion = initVCS(new File(new File("").getAbsolutePath()));
+
+ try {
+ connexion.open();
+
+ AbstractSynchUI ui = VCSUIFactory.newSynchUI();
+
+ fillSynchModel(connexion, ui.getModel(), 20, "trunk", "local/", "remote/");
+
+ ui.setVisible(true);
+
+ } finally {
+ connexion.close();
+ }
+ }
+
+ public static VCSConnexion initVCS(File root) {
+ VCSConnexionConfigImpl config = new VCSConnexionConfigImpl();
+ config.setType("MOCK");
+ config.setLocalDatabasePath(root);
+ VCSConnexion connexion = VCSFactory.newConnexion(VCSConnexionMode.ANONYMOUS, config);
+ connexion.init(config);
+ return connexion;
+ }
+
+ protected static void fillSynchModel(VCSConnexion handler, SynchUIModel model, int max, String prefix, String localPRefix, String remotePrefix) {
+ List<VCSEntry> datas = generateListFileStates(handler, max, prefix, localPRefix, remotePrefix);
+ model.populate(VCSEntryLocation.UNKNOW, datas.toArray(new VCSEntry[datas.size()]));
+ }
+
+ protected static List<VCSEntry> generateListFileStates(VCSConnexion handler, int max, String prefix, String localPRefix, String remotePrefix) {
+ List<VCSEntry> datas = generateLocalFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), localPRefix);
+ datas.addAll(generateRemoteFileStates(handler, max, new File(handler.getConfig().getLocalDatabasePath(), prefix), remotePrefix));
+ return datas;
+ }
+
+ protected static List<VCSEntry> generateLocalFileStates(VCSConnexion handler, int max, File root, String localPRefix) {
+ return generateFileStates(handler, root, max, localPRefix, VCSState.MODIFIED, VCSState.UNVERSIONNED, VCSState.OUT_OF_DATE_AND_MODIFIED, VCSState.REMOVED);
+ }
+
+ protected static List<VCSEntry> generateRemoteFileStates(VCSConnexion handler, int max, File root, String remotePRefix) {
+ return generateFileStates(handler, root, max, remotePRefix, VCSState.MISSING, VCSState.OUT_OF_DATE, VCSState.OUT_OF_DATE_AND_MODIFIED);
+ }
+
+ protected static List<VCSEntry> generateFileStates(VCSConnexion handler, File root, int max, String prefix, VCSState... states) {
+ List<VCSEntry> datas = new ArrayList<VCSEntry>();
+ for (int i = 0, nbFiles = 1 + r.nextInt(max), size = states.length; i < nbFiles; i++) {
+ VCSEntry state = new VCSEntryImpl(handler, root.getName() + File.separator + prefix + "file" + i);
+ state.setState(states[r.nextInt(size)]);
+ datas.add(state);
+ }
+ return datas;
+ }
+}
1
0
[Buix-commits] r412 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:19:12 +0000 (Sun, 06 Apr 2008)
New Revision: 412
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Removed:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
move ui-pre-jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,112 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.ConfirmUIModel;
-
-import javax.swing.ListSelectionModel;
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-/** @author chemit */
-public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
-
-
- public ConfirmUIHandler() {
- super();
- //this.ui = new JConfirmUI(this);
- }
-
- /*public void setUi(AbstractConfirmUI ui) {
- this.ui = ui;
- }*/
-
- /*public ConfirmUIModel getModel() {
- return getUi().getModel();
- }*/
-
-
- public Class<AbstractConfirmUI> getUiClass() {
- return AbstractConfirmUI.class;
- }
-
- public Class<? super ConfirmUIModel> getModelClass() {
- return ConfirmUIModel.class;
- }
-
- public ListSelectionModel getSelectionModel() {
- return getUi().getContentTable().getSelectionModel();
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
-
- if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
- updateUI();
- return;
- }
-
- if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
- updateMessageUI();
- return;
- }
-
- throw new IllegalStateException("unimplemented property changed : " + evt);
- }
-
- protected void updateUI() {
- VCSAction action = getModel().getAction();
- getUi().getAccept().setText(action.getLibelle());
- getUi().getToolbar().setVisible(action.isCommit());
- getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
- }
-
- protected void updateMessageUI() {
- // update message history combo box ?
- getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
- }
-
- public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
-
- VCSAction action = getModel().getAction();
-
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
-
- if (action.isCommit()) {
- getModel().addCommitMessage(commitMessage);
-
- } else {
- commitMessage = null;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
- }
-
- getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
-
- // dispose ui
- getUi().dispose();
-
- }
-
-
-}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,92 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
-
- //protected AbstractDiffUI ui;
-
- public DiffUIHandler() {
- //this.ui = new JDiffUI(this);
- }
-
- /*public AbstractDiffUI getUi() {
- return ui;
- }*/
-
- /*public void setUi(AbstractDiffUI ui) {
- this.ui = ui;
- }
-
- public DiffUIModel getModel() {
- return ui.getModel();
- }*/
-
- public Class<AbstractDiffUI> getUiClass() {
- return AbstractDiffUI.class;
- }
-
- public Class<? super DiffUIModel> getModelClass() {
- return DiffUIModel.class;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
-
- String action = evt.getPropertyName();
- if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSEntry) evt.getNewValue());
- } else {
- super.propertyChange(evt);
- }
- }
-
- @Override
- public void doSelectLocation(VCSEntryLocation location) {
- super.doSelectLocation(location);
-
- }
-
- protected void initTab(VCSEntryLocation location) {
- //TODO
- }
-
- public void doSelectFile(VCSEntry model) {
- //TODO
- }
-
- public void doAction(VCSAction action, VCSEntry model) {
- //TODO
- }
-
- public void gotoNextDiff() {
- //TODO
- }
-
- public void gotoPreviousDiff() {
- //TODO
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,177 +0,0 @@
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-/** @author chemit */
-public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
-
- //protected AbstractSynchUI ui;
-
- public SynchUIHandler() {
- //this.ui = new JSynchUI(this);
- }
-
- public Class<AbstractSynchUI> getUiClass() {
- return AbstractSynchUI.class;
- }
-
- public Class<? super SynchUIModel> getModelClass() {
- return SynchUIModel.class;
- }
-
- /*public void setUi(AbstractSynchUI ui) {
- this.ui = ui;
- }
-
- public AbstractSynchUI getUi() {
- return ui;
- }*/
-
- /*public SynchUIModel getModel() {
- return ui.getModel();
- }*/
-
- /*public void doAllAction(VCSAction action) {
- doAction(action, false);
- }
-
- public void doSelectAction(VCSAction action) {
- doAction(action, true);
- }*/
-
- @Override
- public void doSelectLocation(VCSEntryLocation location) {
-
- super.doSelectLocation(location);
-
- VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : actions) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = actions.length > 0;
- getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
- getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
- getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
- getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
- getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
- getUi().getRefreshAll().setEnabled(hasActions);
- }
-
- public void doAction(VCSAction action, boolean useSelection) {
- AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
- log.info(action + " : " + model);
- ListSelectionModel selectionModel = getSelectionModel();
- if (action == VCSAction.REFRESH) {
- selectionModel.clearSelection();
- // do refresh of all states
- log.info("refresh :" + model.getRowCount());
- model.refresh(model.getEntries(), System.nanoTime());
- } else {
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
- if (entries.isEmpty()) {
- // nothing to do
- return;
- }
- if (action == VCSAction.DIFF) {
- // show diff ui
- return;
- }
- log.info("files to treate :" + entries.size());
-
- AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
-
- confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
-
- confirmUI.setVisible(true);
- //TODO SynchModel should listener for modification on ActionManagerQueue thread
- log.info("TODO refresh states for files...");
- }
- }
-
- protected void initTab(VCSEntryLocation location) {
- JTable table = getUi().getTable(location);
- AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
- table.setModel(fileStatesModel);
- table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
- AbstractVCSPopup popup = getUi().getPopup(location);
-
- popup.setDispatchAction(new VCSAbsractAction() {
- private static final long serialVersionUID = 8622118724992019898L;
-
- public void actionPerformed(ActionEvent e) {
- doAction(action, false);
- }
- });
- }
-
- protected static class ListMouseListener extends MouseAdapter {
-
- private final AbstractVCSEntriesTableModel model;
-
- private final ListSelectionModel selectionModel;
-
- private final JTable jTable;
- private final AbstractVCSPopup jPopupMenu;
-
- public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
- this.model = model;
- jPopupMenu = ui.getPopup(modelName);
- jTable = ui.getTable(modelName);
- selectionModel = jTable.getSelectionModel();
- }
-
- @Override
- public void mousePressed(MouseEvent e) {
- super.mousePressed(e);
- if (e.isPopupTrigger()) {
- initPopup(e.getX(), e.getY());
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent e) {
- super.mouseReleased(e);
- if (e.isPopupTrigger()) {
- initPopup(e.getX(), e.getY());
- }
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- // nothing to do
- }
-
- protected void initPopup(int x, int y) {
- if (!selectionModel.isSelectionEmpty()) {
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : model.getActions(selectionModel)) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = !acts.isEmpty();
- jPopupMenu.getDiff().setEnabled(hasActions && acts.contains("diff"));
- jPopupMenu.getUpdate().setEnabled(hasActions && acts.contains("update"));
- jPopupMenu.getCommit().setEnabled(hasActions && acts.contains("commit"));
- jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
- jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
- jPopupMenu.getRefresh().setEnabled(hasActions);
- jPopupMenu.pack();
- // display popup
- jPopupMenu.show(jTable, x, y);
- }
- }
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:18:56 UTC (rev 411)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -1,156 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.util.StringUtil;
-import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.ui.handler.AbstractUIHandler;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-/**
- * Factory if VCS UI, using a cache.
- *
- * @author chemit
- */
-public class VCSUIFactory {
-
- static protected final Log log = LogFactory.getLog(VCSFactory.class);
-
- protected static VCSUIFactory instance;
-
- protected Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
- protected ServiceLoader<AbstractUI> loader;
-
-
- public static AbstractSynchUI newSynchUI() {
- SynchUIHandler result = getInstance().newHandler(SynchUIHandler.class);
- return result.getUi();
- }
-
- public static AbstractConfirmUI newConfirmUI() {
- ConfirmUIHandler result = getInstance().newHandler(ConfirmUIHandler.class);
- return result.getUi();
- }
-
- public static AbstractDiffUI newDiffUI() {
- DiffUIHandler result = getInstance().newHandler(DiffUIHandler.class);
- return result.getUi();
- }
-
- public void close() {
- if (cache != null) {
- cache.clear();
- cache = null;
- }
- if (loader != null) {
- loader.reload();
- loader = null;
- }
- }
-
- protected static VCSUIFactory getInstance() {
- if (instance == null) {
- instance = new VCSUIFactory();
- }
- return instance;
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- close();
- }
-
- protected synchronized Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
- if (cache == null) {
- cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
- }
- return cache;
- }
-
- protected synchronized ServiceLoader<AbstractUI> getLoader() {
- if (loader == null) {
- long t0 = System.nanoTime();
-
- loader = ServiceLoader.load(AbstractUI.class);
- int nb = 0;
- for (AbstractUI provider : loader) {
- log.info(provider.getName() + " [" + provider + ']');
- nb++;
- }
- log.info("found " + nb + " ui(s) in " + StringUtil.convertTime(t0, System.nanoTime()));
- }
- return loader;
- }
-
- @SuppressWarnings({"unchecked"})
- protected <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
- H result;
-
- result = (H) getInstance().getCache().get(klass);
-
- if (result == null) {
-
- try {
- // instance of handler
- result = klass.getConstructor().newInstance();
-
- // instance of model
- AbstractUIModel model = (AbstractUIModel) result.getModelClass().newInstance();
-
- // obtain intance of ui
- AbstractUI ui = getUI(result.getUiClass());
-
- // attach model to ui
- ui.setModel(model);
-
- // attach handler to ui
- ui.setHandler(result);
-
- // attach ui to handler
- result.setUi(ui);
-
- // init handler
- result.init();
-
- getCache().put(klass, result);
- } catch (Exception e) {
- throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
- }
- }
- return result;
- }
-
- @SuppressWarnings({"unchecked"})
- protected <U extends AbstractUI> U getUI(Class<U> klass) {
-
- for (AbstractUI ui : getLoader()) {
- if (klass.isAssignableFrom(ui.getClass())) {
- return (U) ui;
- }
- }
- throw new IllegalStateException("could not find ui " + klass);
- }
-
- protected VCSUIFactory() {
- }
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,112 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+
+/** @author chemit */
+public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
+
+
+ public ConfirmUIHandler() {
+ super();
+ //this.ui = new JConfirmUI(this);
+ }
+
+ /*public void setUi(AbstractConfirmUI ui) {
+ this.ui = ui;
+ }*/
+
+ /*public ConfirmUIModel getModel() {
+ return getUi().getModel();
+ }*/
+
+
+ public Class<AbstractConfirmUI> getUiClass() {
+ return AbstractConfirmUI.class;
+ }
+
+ public Class<? super ConfirmUIModel> getModelClass() {
+ return ConfirmUIModel.class;
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ return getUi().getContentTable().getSelectionModel();
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ updateMessageUI();
+ return;
+ }
+
+ throw new IllegalStateException("unimplemented property changed : " + evt);
+ }
+
+ protected void updateUI() {
+ VCSAction action = getModel().getAction();
+ getUi().getAccept().setText(action.getLibelle());
+ getUi().getToolbar().setVisible(action.isCommit());
+ getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
+ }
+
+ protected void updateMessageUI() {
+ // update message history combo box ?
+ getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
+ }
+
+ public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
+
+ VCSAction action = getModel().getAction();
+
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
+
+ if (action.isCommit()) {
+ getModel().addCommitMessage(commitMessage);
+
+ } else {
+ commitMessage = null;
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
+ }
+
+ getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
+
+ // dispose ui
+ getUi().dispose();
+
+ }
+
+
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,92 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
+
+ //protected AbstractDiffUI ui;
+
+ public DiffUIHandler() {
+ //this.ui = new JDiffUI(this);
+ }
+
+ /*public AbstractDiffUI getUi() {
+ return ui;
+ }*/
+
+ /*public void setUi(AbstractDiffUI ui) {
+ this.ui = ui;
+ }
+
+ public DiffUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ public Class<AbstractDiffUI> getUiClass() {
+ return AbstractDiffUI.class;
+ }
+
+ public Class<? super DiffUIModel> getModelClass() {
+ return DiffUIModel.class;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+
+ String action = evt.getPropertyName();
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
+ } else {
+ super.propertyChange(evt);
+ }
+ }
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+ super.doSelectLocation(location);
+
+ }
+
+ protected void initTab(VCSEntryLocation location) {
+ //TODO
+ }
+
+ public void doSelectFile(VCSEntry model) {
+ //TODO
+ }
+
+ public void doAction(VCSAction action, VCSEntry model) {
+ //TODO
+ }
+
+ public void gotoNextDiff() {
+ //TODO
+ }
+
+ public void gotoPreviousDiff() {
+ //TODO
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,177 @@
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.handler.VCSAbsractAction;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
+
+ //protected AbstractSynchUI ui;
+
+ public SynchUIHandler() {
+ //this.ui = new JSynchUI(this);
+ }
+
+ public Class<AbstractSynchUI> getUiClass() {
+ return AbstractSynchUI.class;
+ }
+
+ public Class<? super SynchUIModel> getModelClass() {
+ return SynchUIModel.class;
+ }
+
+ /*public void setUi(AbstractSynchUI ui) {
+ this.ui = ui;
+ }
+
+ public AbstractSynchUI getUi() {
+ return ui;
+ }*/
+
+ /*public SynchUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ /*public void doAllAction(VCSAction action) {
+ doAction(action, false);
+ }
+
+ public void doSelectAction(VCSAction action) {
+ doAction(action, true);
+ }*/
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
+ }
+
+ public void doAction(VCSAction action, boolean useSelection) {
+ AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
+ log.info(action + " : " + model);
+ ListSelectionModel selectionModel = getSelectionModel();
+ if (action == VCSAction.REFRESH) {
+ selectionModel.clearSelection();
+ // do refresh of all states
+ log.info("refresh :" + model.getRowCount());
+ model.refresh(model.getEntries(), System.nanoTime());
+ } else {
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
+ if (entries.isEmpty()) {
+ // nothing to do
+ return;
+ }
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ return;
+ }
+ log.info("files to treate :" + entries.size());
+
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+
+ confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
+
+ confirmUI.setVisible(true);
+ //TODO SynchModel should listener for modification on ActionManagerQueue thread
+ log.info("TODO refresh states for files...");
+ }
+ }
+
+ protected void initTab(VCSEntryLocation location) {
+ JTable table = getUi().getTable(location);
+ AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
+ table.setModel(fileStatesModel);
+ table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
+ AbstractVCSPopup popup = getUi().getPopup(location);
+
+ popup.setDispatchAction(new VCSAbsractAction() {
+ private static final long serialVersionUID = 8622118724992019898L;
+
+ public void actionPerformed(ActionEvent e) {
+ doAction(action, false);
+ }
+ });
+ }
+
+ protected static class ListMouseListener extends MouseAdapter {
+
+ private final AbstractVCSEntriesTableModel model;
+
+ private final ListSelectionModel selectionModel;
+
+ private final JTable jTable;
+ private final AbstractVCSPopup jPopupMenu;
+
+ public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
+ this.model = model;
+ jPopupMenu = ui.getPopup(modelName);
+ jTable = ui.getTable(modelName);
+ selectionModel = jTable.getSelectionModel();
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ super.mousePressed(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ super.mouseReleased(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ // nothing to do
+ }
+
+ protected void initPopup(int x, int y) {
+ if (!selectionModel.isSelectionEmpty()) {
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : model.getActions(selectionModel)) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = !acts.isEmpty();
+ jPopupMenu.getDiff().setEnabled(hasActions && acts.contains("diff"));
+ jPopupMenu.getUpdate().setEnabled(hasActions && acts.contains("update"));
+ jPopupMenu.getCommit().setEnabled(hasActions && acts.contains("commit"));
+ jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
+ jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
+ jPopupMenu.getRefresh().setEnabled(hasActions);
+ jPopupMenu.pack();
+ // display popup
+ jPopupMenu.show(jTable, x, y);
+ }
+ }
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java (from rev 410, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:19:12 UTC (rev 412)
@@ -0,0 +1,156 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.StringUtil;
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+/**
+ * Factory if VCS UI, using a cache.
+ *
+ * @author chemit
+ */
+public class VCSUIFactory {
+
+ static protected final Log log = LogFactory.getLog(VCSFactory.class);
+
+ protected static VCSUIFactory instance;
+
+ protected Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ protected ServiceLoader<AbstractUI> loader;
+
+
+ public static AbstractSynchUI newSynchUI() {
+ SynchUIHandler result = getInstance().newHandler(SynchUIHandler.class);
+ return result.getUi();
+ }
+
+ public static AbstractConfirmUI newConfirmUI() {
+ ConfirmUIHandler result = getInstance().newHandler(ConfirmUIHandler.class);
+ return result.getUi();
+ }
+
+ public static AbstractDiffUI newDiffUI() {
+ DiffUIHandler result = getInstance().newHandler(DiffUIHandler.class);
+ return result.getUi();
+ }
+
+ public void close() {
+ if (cache != null) {
+ cache.clear();
+ cache = null;
+ }
+ if (loader != null) {
+ loader.reload();
+ loader = null;
+ }
+ }
+
+ protected static VCSUIFactory getInstance() {
+ if (instance == null) {
+ instance = new VCSUIFactory();
+ }
+ return instance;
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ super.finalize();
+ close();
+ }
+
+ protected synchronized Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
+ if (cache == null) {
+ cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
+ }
+ return cache;
+ }
+
+ protected synchronized ServiceLoader<AbstractUI> getLoader() {
+ if (loader == null) {
+ long t0 = System.nanoTime();
+
+ loader = ServiceLoader.load(AbstractUI.class);
+ int nb = 0;
+ for (AbstractUI provider : loader) {
+ log.info(provider.getName() + " [" + provider + ']');
+ nb++;
+ }
+ log.info("found " + nb + " ui(s) in " + StringUtil.convertTime(t0, System.nanoTime()));
+ }
+ return loader;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ protected <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
+ H result;
+
+ result = (H) getInstance().getCache().get(klass);
+
+ if (result == null) {
+
+ try {
+ // instance of handler
+ result = klass.getConstructor().newInstance();
+
+ // instance of model
+ AbstractUIModel model = (AbstractUIModel) result.getModelClass().newInstance();
+
+ // obtain intance of ui
+ AbstractUI ui = getUI(result.getUiClass());
+
+ // attach model to ui
+ ui.setModel(model);
+
+ // attach handler to ui
+ ui.setHandler(result);
+
+ // attach ui to handler
+ result.setUi(ui);
+
+ // init handler
+ result.init();
+
+ getCache().put(klass, result);
+ } catch (Exception e) {
+ throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
+ }
+ }
+ return result;
+ }
+
+ @SuppressWarnings({"unchecked"})
+ protected <U extends AbstractUI> U getUI(Class<U> klass) {
+
+ for (AbstractUI ui : getLoader()) {
+ if (klass.isAssignableFrom(ui.getClass())) {
+ return (U) ui;
+ }
+ }
+ throw new IllegalStateException("could not find ui " + klass);
+ }
+
+ protected VCSUIFactory() {
+ }
+
+}
1
0
[Buix-commits] r411 - in trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java: . org org/codelutin org/codelutin/vcs
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:18:56 +0000 (Sun, 06 Apr 2008)
New Revision: 411
Added:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/test/java/org/codelutin/vcs/ui/
Log:
move UITest to jaxx module
TODO rename module ui-pre-jaxx to ui-common
TODO rename module ui-jaxx to ui
1
0
[Buix-commits] r410 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:14:57 +0000 (Sun, 06 Apr 2008)
New Revision: 410
Modified:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
use default constructor for ui since we use ServiceLoader
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -14,43 +14,99 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+import java.util.List;
/** @author chemit */
-public class ConfirmUIHandler extends AbstractConfirmUIHandler {
+public class ConfirmUIHandler extends org.codelutin.vcs.ui.handler.AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
- protected final AbstractConfirmUI ui;
public ConfirmUIHandler() {
- this.ui = new JConfirmUI(this);
+ super();
+ //this.ui = new JConfirmUI(this);
}
- public ConfirmUIModel getModel() {
- return ui.getModel();
+ /*public void setUi(AbstractConfirmUI ui) {
+ this.ui = ui;
+ }*/
+
+ /*public ConfirmUIModel getModel() {
+ return getUi().getModel();
+ }*/
+
+
+ public Class<AbstractConfirmUI> getUiClass() {
+ return AbstractConfirmUI.class;
}
- public AbstractConfirmUI getUi() {
- return ui;
+ public Class<? super ConfirmUIModel> getModelClass() {
+ return ConfirmUIModel.class;
}
public ListSelectionModel getSelectionModel() {
- return ui.getContentTable().getSelectionModel();
+ return getUi().getContentTable().getSelectionModel();
}
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ updateMessageUI();
+ return;
+ }
+
+ throw new IllegalStateException("unimplemented property changed : " + evt);
+ }
+
protected void updateUI() {
- VCSAction action = ui.getModel().getAction();
- ui.getAccept().setText(action.getLibelle());
- ui.getToolbar().setVisible(action.isCommit());
- ui.getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
+ VCSAction action = getModel().getAction();
+ getUi().getAccept().setText(action.getLibelle());
+ getUi().getToolbar().setVisible(action.isCommit());
+ getUi().getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
}
protected void updateMessageUI() {
// update message history combo box ?
- ui.getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
+ getUi().getLastMessages().setEnabled(!getModel().getCommitMessages().isEmpty());
}
+ public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
+
+ VCSAction action = getModel().getAction();
+
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
+
+ if (action.isCommit()) {
+ getModel().addCommitMessage(commitMessage);
+
+ } else {
+ commitMessage = null;
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
+ }
+
+ getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
+
+ // dispose ui
+ getUi().dispose();
+
+ }
+
+
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -17,26 +17,59 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.model.DiffUIModel;
+import java.beans.PropertyChangeEvent;
+
/** @author chemit */
-public class DiffUIHandler extends AbstractDiffUIHandler<JDiffUI> {
+public class DiffUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<DiffUIModel, AbstractDiffUI> {
- protected final AbstractDiffUI ui;
+ //protected AbstractDiffUI ui;
public DiffUIHandler() {
- this.ui = new JDiffUI(this);
+ //this.ui = new JDiffUI(this);
}
- public JDiffUI getUi() {
- return (JDiffUI) ui;
+ /*public AbstractDiffUI getUi() {
+ return ui;
+ }*/
+
+ /*public void setUi(AbstractDiffUI ui) {
+ this.ui = ui;
}
public DiffUIModel getModel() {
return ui.getModel();
+ }*/
+
+ public Class<AbstractDiffUI> getUiClass() {
+ return AbstractDiffUI.class;
}
+ public Class<? super DiffUIModel> getModelClass() {
+ return DiffUIModel.class;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+
+ String action = evt.getPropertyName();
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
+ } else {
+ super.propertyChange(evt);
+ }
+ }
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+ super.doSelectLocation(location);
+
+ }
+
protected void initTab(VCSEntryLocation location) {
//TODO
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -3,7 +3,6 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
@@ -17,28 +16,59 @@
import java.util.List;
/** @author chemit */
-public class SynchUIHandler extends AbstractSynchUIHandler<JSynchUI> {
+public class SynchUIHandler extends org.codelutin.vcs.ui.handler.AbstractTabUIHandler<SynchUIModel, AbstractSynchUI> {
- protected final JSynchUI ui;
+ //protected AbstractSynchUI ui;
public SynchUIHandler() {
- this.ui = new JSynchUI(this);
+ //this.ui = new JSynchUI(this);
}
- public JSynchUI getUi() {
- return ui;
+ public Class<AbstractSynchUI> getUiClass() {
+ return AbstractSynchUI.class;
}
- public SynchUIModel getModel() {
- return ui.getModel();
+ public Class<? super SynchUIModel> getModelClass() {
+ return SynchUIModel.class;
}
- public void doAllAction(VCSAction action) {
+ /*public void setUi(AbstractSynchUI ui) {
+ this.ui = ui;
+ }
+
+ public AbstractSynchUI getUi() {
+ return ui;
+ }*/
+
+ /*public SynchUIModel getModel() {
+ return ui.getModel();
+ }*/
+
+ /*public void doAllAction(VCSAction action) {
doAction(action, false);
}
public void doSelectAction(VCSAction action) {
doAction(action, true);
+ }*/
+
+ @Override
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
}
public void doAction(VCSAction action, boolean useSelection) {
@@ -61,6 +91,7 @@
return;
}
log.info("files to treate :" + entries.size());
+
AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
@@ -75,14 +106,14 @@
JTable table = getUi().getTable(location);
AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
table.setModel(fileStatesModel);
- table.addMouseListener(new ListMouseListener(ui, fileStatesModel, location));
- AbstractVCSPopup jvcsPopup = getUi().getPopup(location);
- //jvcsPopup.setDispatchAction(new VCSPopupAction(this, location));
- jvcsPopup.setDispatchAction(new VCSAbsractAction() {
+ table.addMouseListener(new ListMouseListener(getUi(), fileStatesModel, location));
+ AbstractVCSPopup popup = getUi().getPopup(location);
+
+ popup.setDispatchAction(new VCSAbsractAction() {
private static final long serialVersionUID = 8622118724992019898L;
public void actionPerformed(ActionEvent e) {
- doSelectAction(action);
+ doAction(action, false);
}
});
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -14,10 +14,16 @@
*/
package org.codelutin.vcs.ui;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.StringUtil;
+import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
import java.util.HashMap;
import java.util.Map;
+import java.util.ServiceLoader;
/**
* Factory if VCS UI, using a cache.
@@ -26,59 +32,125 @@
*/
public class VCSUIFactory {
- protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ static protected final Log log = LogFactory.getLog(VCSFactory.class);
- protected static AbstractTabUI synchUI;
- protected static AbstractDiffUI diffUI;
- protected static AbstractConfirmUI confirmUI;
+ protected static VCSUIFactory instance;
+ protected Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ protected ServiceLoader<AbstractUI> loader;
+
+
public static AbstractSynchUI newSynchUI() {
- SynchUIHandler result = newHandler(SynchUIHandler.class);
+ SynchUIHandler result = getInstance().newHandler(SynchUIHandler.class);
return result.getUi();
}
- public static AbstractDiffUI newDiffUI() {
- DiffUIHandler result = newHandler(DiffUIHandler.class);
+ public static AbstractConfirmUI newConfirmUI() {
+ ConfirmUIHandler result = getInstance().newHandler(ConfirmUIHandler.class);
return result.getUi();
}
- public static AbstractConfirmUI newConfirmUI() {
- ConfirmUIHandler result = newHandler(ConfirmUIHandler.class);
+ public static AbstractDiffUI newDiffUI() {
+ DiffUIHandler result = getInstance().newHandler(DiffUIHandler.class);
return result.getUi();
}
- public static void close() {
+ public void close() {
if (cache != null) {
cache.clear();
+ cache = null;
}
- cache = null;
+ if (loader != null) {
+ loader.reload();
+ loader = null;
+ }
}
- protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
+ protected static VCSUIFactory getInstance() {
+ if (instance == null) {
+ instance = new VCSUIFactory();
+ }
+ return instance;
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ super.finalize();
+ close();
+ }
+
+ protected synchronized Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
if (cache == null) {
cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
}
return cache;
}
+ protected synchronized ServiceLoader<AbstractUI> getLoader() {
+ if (loader == null) {
+ long t0 = System.nanoTime();
+
+ loader = ServiceLoader.load(AbstractUI.class);
+ int nb = 0;
+ for (AbstractUI provider : loader) {
+ log.info(provider.getName() + " [" + provider + ']');
+ nb++;
+ }
+ log.info("found " + nb + " ui(s) in " + StringUtil.convertTime(t0, System.nanoTime()));
+ }
+ return loader;
+ }
+
@SuppressWarnings({"unchecked"})
- protected static <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
+ protected <H extends AbstractUIHandler> H newHandler(Class<H> klass) {
H result;
- result = (H) getCache().get(klass);
+
+ result = (H) getInstance().getCache().get(klass);
+
if (result == null) {
+
try {
- result = klass.newInstance();
+ // instance of handler
+ result = klass.getConstructor().newInstance();
+
+ // instance of model
+ AbstractUIModel model = (AbstractUIModel) result.getModelClass().newInstance();
+
+ // obtain intance of ui
+ AbstractUI ui = getUI(result.getUiClass());
+
+ // attach model to ui
+ ui.setModel(model);
+
+ // attach handler to ui
+ ui.setHandler(result);
+
+ // attach ui to handler
+ result.setUi(ui);
+
+ // init handler
result.init();
+
getCache().put(klass, result);
- } catch (InstantiationException e) {
+ } catch (Exception e) {
throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
- } catch (IllegalAccessException e) {
- throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
}
}
return result;
}
+ @SuppressWarnings({"unchecked"})
+ protected <U extends AbstractUI> U getUI(Class<U> klass) {
+
+ for (AbstractUI ui : getLoader()) {
+ if (klass.isAssignableFrom(ui.getClass())) {
+ return (U) ui;
+ }
+ }
+ throw new IllegalStateException("could not find ui " + klass);
+ }
+
protected VCSUIFactory() {
}
+
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -17,6 +17,7 @@
import jaxx.runtime.swing.Table;
import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
import javax.swing.JButton;
import javax.swing.JLabel;
@@ -48,13 +49,7 @@
public abstract JButton getAccept();
- public AbstractConfirmUI() {
- }
- public AbstractConfirmUI(AbstractConfirmUIHandler handler) {
- super(handler, new ConfirmUIModel());
- }
-
@Override
protected AbstractConfirmUIHandler getHandler() {
return (AbstractConfirmUIHandler) super.getHandler();
@@ -65,14 +60,16 @@
return (ConfirmUIModel) super.getModel();
}
+ @Override
+ public void setModel(AbstractUIModel model) {
+ super.setModel(model);
+ getContentTable().setModel(model.getEntriesModel());
+ }
+
public void doAccept() {
getHandler().doAction(getCommitMessage().getText(), getModel().getEntriesModel());
}
- protected void showLastMessages() {
-
- }
-
@Override
public void setVisible(boolean b) {
if (b) {
@@ -80,4 +77,8 @@
}
super.setVisible(b);
}
+
+ protected void showLastMessages() {
+ //TODO
+ }
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -28,14 +28,6 @@
public abstract JButton getPreviousDiff();
- public AbstractDiffUI() {
- super();
- }
-
- public AbstractDiffUI(AbstractTabUIHandler handler) {
- super(handler, new DiffUIModel());
- }
-
@Override
public DiffUIModel getModel() {
return (DiffUIModel) model;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -43,14 +43,6 @@
public abstract AbstractVCSPopup getRemotePopup();
- public AbstractSynchUI() {
- super();
- }
-
- public AbstractSynchUI(AbstractSynchUIHandler handler) {
- super(handler, new SynchUIModel());
- }
-
@Override
public SynchUIModel getModel() {
return (SynchUIModel) model;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -20,13 +20,14 @@
/** @author chemit */
public class AbstractUI extends javax.swing.JDialog {
- protected final AbstractUIModel model;
+ protected AbstractUIModel model;
- protected final AbstractUIHandler handler;
+ protected AbstractUIHandler handler;
public AbstractUI() {
// Jaxx always generate the default constructor, so need it, but DO NOT USE IT!
- throw new IllegalStateException("the default constructor can NOT be used!");
+ //throw new IllegalStateException("the default constructor can NOT be used!");
+ UIHelper.setQuitAction(this);
}
public AbstractUI(AbstractUIHandler handler, AbstractUIModel model) {
@@ -43,5 +44,12 @@
return handler;
}
+ public void setModel(AbstractUIModel model) {
+ this.model = model;
+ }
+ public void setHandler(AbstractUIHandler handler) {
+ this.handler = handler;
+ }
+
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -21,7 +21,7 @@
import java.awt.event.ActionEvent;
/** @author chemit */
-public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
+public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {
protected VCSAbsractAction dispatchAction;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.AbstractUI;
+import org.codelutin.vcs.ui.AbstractConfirmUI;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
@@ -28,7 +28,7 @@
*
* @author chemit
*/
-public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractUI> {
+public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractConfirmUI> {
protected abstract void updateUI();
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 17:14:47 UTC (rev 409)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 17:14:57 UTC (rev 410)
@@ -30,12 +30,28 @@
protected static Log log = LogFactory.getLog(AbstractUIHandler.class);
- public abstract M getModel();
+ private U ui;
- public abstract U getUi();
+ public abstract Class<? super U> getUiClass();
+ public abstract Class<? super M> getModelClass();
+
public abstract ListSelectionModel getSelectionModel();
+ @SuppressWarnings({"unchecked"})
+ public M getModel() {
+ return (M) getUi().getModel();
+ }
+
+ public U getUi() {
+ return ui;
+ }
+
+ public void setUi(U ui) {
+ this.ui = ui;
+ }
+
+
public void init() {
if (getModel() == null) {
throw new IllegalStateException("no model was defined for " + this);
1
0
[Buix-commits] r409 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:14:47 +0000 (Sun, 06 Apr 2008)
New Revision: 409
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
Log:
use default constructor for ui since we use ServiceLoader
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 17:14:14 UTC (rev 408)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 17:14:47 UTC (rev 409)
@@ -1,11 +1,11 @@
<AbstractConfirmUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
resizable='false' height='300' width='400'>
<style source="common.css"/>
- <script>
+ <!--script>
public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
super(handler);
}
- </script>
+ </script-->
<Table>
<row fill='both'>
<cell fill='both'>
@@ -44,7 +44,8 @@
<row>
<cell fill='both' weightx='1' weighty='1'>
<JScrollPane id='content' styleClass='confirmScroll'>
- <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getEntriesModel()}"/>
+ <JTable id="contentTable" styleClass='confirmTable'/>
+ <!--JTable id="contentTable" styleClass='confirmTable' model="{getModel().getEntriesModel()}"/-->
</JScrollPane>
</cell>
</row>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 17:14:14 UTC (rev 408)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 17:14:47 UTC (rev 409)
@@ -1,14 +1,13 @@
<AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
- <script>
+ <!--script>
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
- public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
+ /*public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
super(handler);
- }
- </script>
-
+ }*/
+ </script-->
<java.awt.CardLayout id='cardLayout'/>
<Table>
@@ -18,42 +17,42 @@
<JToggleButton id='allTab' selected='true' buttonGroup='tabs' mnemonic="A"
toolTipText="lutinvcs.tabs.diff.tooltip.all"
icon='{createImageIcon("remote_vs_local.png")}'
- onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.ALL)'/>
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' mnemonic="L"
toolTipText="lutinvcs.tabs.diff.tooltip.local"
icon='{createImageIcon("local_vs_local.png")}'
- onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.LOCAL)'/>
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' mnemonic="R"
icon='{createImageIcon("remote_vs_remote.png")}'
toolTipText="lutinvcs.tabs.diff.tooltip.remote"
- onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.REMOTE)'/>
<JButton id='nextDiff' toolTipText="lutinvcs.action.tooltip.nextDiff"
icon='{createImageIcon("diff-next.png")}' onActionPerformed='gotoNextDiff()'/>
<JButton id='previousDiff' toolTipText="lutinvcs.action.tooltip.previousDiff"
- icon='{createImageIcon("diff-previous.png")}' onActionPerformed='gotoPreviousDiff()'/>
+ icon='{createImageIcon("diff-prev.png")}' onActionPerformed='gotoPreviousDiff()'/>
<JButton id='refresh' toolTipText="lutinvcs.action.tooltip.refresh"
icon='{createImageIcon("autoRefresh.png")}'
- onActionPerformed='doAction(VCSAction.REFRESH)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REFRESH)'/>
<JButton id='update' toolTipText="lutinvcs.action.tooltip.update"
icon='{createImageIcon("update.png")}'
- onActionPerformed='doAction(VCSAction.UPDATE)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.UPDATE)'/>
<JButton id='commit' toolTipText="lutinvcs.action.tooltip.commit"
icon='{createImageIcon("commit.png")}'
- onActionPerformed='doAction(VCSAction.COMMIT)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.COMMIT)'/>
<JButton id='revert' toolTipText="lutinvcs.action.tooltip.revert"
icon='{createImageIcon("rollback.png")}'
- onActionPerformed='doAction(VCSAction.REVERT)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REVERT)'/>
<JButton id='delete' toolTipText="lutinvcs.action.tooltip.delete"
icon='{createImageIcon("remove.png")}'
- onActionPerformed='doAction(VCSAction.DELETE)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.DELETE)'/>
</JToolBar>
</cell>
</row>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 17:14:14 UTC (rev 408)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 17:14:47 UTC (rev 409)
@@ -1,14 +1,13 @@
<AbstractSynchUI title='lutinvcs.synch.title' modal="true" defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
- <script>
+ <!--script>
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
- public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
+ /*public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
super(handler);
- }
- </script>
-
+ }*/
+ </script-->
<java.awt.CardLayout id='cardLayout'/>
<JVCSPopup id="allPopup"/>
@@ -22,38 +21,39 @@
<JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
- onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.ALL)'/>
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local'
mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local"
- onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.LOCAL)'/>
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote'
mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote"
- onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
+ onActionPerformed='setLocation(org.codelutin.vcs.type.VCSEntryLocation.REMOTE)'/>
<JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll"
icon='{createImageIcon("autoRefresh.png")}'
- onActionPerformed='doAction(VCSAction.REFRESH,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REFRESH,false)'/>
<JButton id='diffAll' toolTipText="lutinvcs.action.tooltip.diffAll"
- icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,false)'/>
+ icon='{createImageIcon("diff.png")}'
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.DIFF,false)'/>
<JButton id='updateAll' toolTipText="lutinvcs.action.tooltip.updateAll"
icon='{createImageIcon("update.png")}'
- onActionPerformed='doAction(VCSAction.UPDATE,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.UPDATE,false)'/>
<JButton id='commitAll' toolTipText="lutinvcs.action.tooltip.commitAll"
icon='{createImageIcon("commit.png")}'
- onActionPerformed='doAction(VCSAction.COMMIT,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.COMMIT,false)'/>
<JButton id='revertAll' toolTipText="lutinvcs.action.tooltip.revertAll"
icon='{createImageIcon("rollback.png")}'
- onActionPerformed='doAction(VCSAction.REVERT,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.REVERT,false)'/>
<JButton id='deleteAll' toolTipText="lutinvcs.action.tooltip.deleteAll"
icon='{createImageIcon("remove.png")}'
- onActionPerformed='doAction(VCSAction.DELETE,false)'/>
+ onActionPerformed='doAction(org.codelutin.vcs.type.VCSAction.DELETE,false)'/>
</JToolBar>
</cell>
</row>
1
0
[Buix-commits] r408 - in trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources: . META-INF META-INF/services
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 17:14:14 +0000 (Sun, 06 Apr 2008)
New Revision: 408
Added:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI
Log:
add ui from jaxx as service :)
Added: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/META-INF/services/org.codelutin.vcs.ui.AbstractUI 2008-04-06 17:14:14 UTC (rev 408)
@@ -0,0 +1,3 @@
+org.codelutin.vcs.ui.JConfirmUI
+org.codelutin.vcs.ui.JSynchUI
+org.codelutin.vcs.ui.JDiffUI
\ No newline at end of file
1
0