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] r537 - in trunk/lutinvcs: core/src/main/java/org/codelutin/vcs ui/common/src/main/java/org/codelutin/vcs/ui ui/common/src/main/java/org/codelutin/vcs/ui/action ui/common/src/main/java/org/codelutin/vcs/ui/handler ui/common/src/main/java/org/codelutin/vcs/ui/util/handler
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 22:43:18 +0000 (Wed, 16 Apr 2008)
New Revision: 537
Modified:
trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java
Log:
add config in handler
add generic window in VCSUIFactory to close vcs when no more ui are visible.
Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java
===================================================================
--- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -57,7 +57,7 @@
/** action manager */
protected VCSActionManager actionManager;
- protected static VCSFactory getInstance() {
+ public static VCSFactory getInstance() {
if (instance == null) {
instance = new VCSFactory();
}
@@ -139,8 +139,10 @@
providers.add(provider);
}
log.info("found " + providers.size() + " provider(s) " + providers.toString() + " in " + StringUtil.convertTime(t0, System.nanoTime()));
- for (VCSProvider provider : providers) {
- log.info(provider.getName() + " [" + provider + ']');
+ if (log.isDebugEnabled()) {
+ for (VCSProvider provider : providers) {
+ log.debug(provider.getName() + " [" + provider + ']');
+ }
}
actionManager = new VCSActionManager();
connexions = new ArrayList<VCSConnexion>();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -17,9 +17,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.StringUtil;
+import org.codelutin.vcs.VCSConnexion;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.ui.util.ui.AbstractUI;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
@@ -40,6 +45,17 @@
protected ServiceLoader<VCSUIProvider> loader;
+ protected VCSConnexionConfig config;
+
+ protected WindowListener defaultWindowListener;
+
+ protected WindowListener windowListener;
+
+ public static void initFactory(VCSConnexionConfig config, VCSWindowListener myWindowAdapter) {
+ getInstance().setConfig(config);
+ getInstance().setWindowListener(myWindowAdapter);
+ }
+
public static SynchUI newSynchUI() {
return (SynchUI) getInstance().newUI(VCSUI.synch);
}
@@ -91,7 +107,6 @@
return cache;
}
-
protected synchronized ServiceLoader<VCSUIProvider> getProviders() {
if (loader == null) {
long t0 = System.nanoTime();
@@ -112,10 +127,11 @@
AbstractUI result = getInstance().getCache().get(uiType);
if (result == null) {
try {
- // instance of handler
- result = newUI0(uiType);
-
- getCache().put(uiType, result);
+ getCache().put(uiType, result = newUI0(uiType));
+ result.addWindowListener(defaultWindowListener);
+ if (windowListener != null) {
+ result.addWindowListener(windowListener);
+ }
} catch (Exception e) {
throw new IllegalStateException("could not instanciate ui handler " + uiType + " for reason : " + e.getMessage());
}
@@ -128,8 +144,7 @@
AbstractUI ui = provider.newUI(uiType);
if (ui != null) {
- uiType.getHandlerClass().getConstructor(ui.getClass().getSuperclass()).newInstance(ui);
-
+ uiType.getHandlerClass().getConstructor(ui.getClass().getSuperclass(), VCSConnexionConfig.class).newInstance(ui, config);
ui.getHandler().init();
return ui;
}
@@ -138,5 +153,64 @@
}
protected VCSUIFactory() {
+ defaultWindowListener = new VCSWindowListener() {
+ protected void allWindowsClosed() {
+ }
+
+ protected void closeConnexion(VCSConnexion connexion) {
+ log.info(connexion);
+ connexion.close();
+ }
+ };
}
+
+ protected void setConfig(VCSConnexionConfig config) {
+ this.config = config;
+ }
+
+ protected void setWindowListener(WindowListener windowListener) {
+ this.windowListener = windowListener;
+ }
+
+ public static abstract class VCSWindowListener extends WindowAdapter {
+
+ protected abstract void allWindowsClosed();
+
+ protected abstract void closeConnexion(VCSConnexion connexion);
+
+ private boolean wasClosed;
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ if (log.isDebugEnabled()) {
+ log.debug(e.getSource());
+ }
+ if (e.getWindow().isVisible()) {
+ // only deal with real closed and none visible windows...
+ return;
+ }
+ for (AbstractUI vcsui : VCSUIFactory.getInstance().cache.values()) {
+ if (vcsui.isVisible()) {
+ // at least one ui visible, do not kill connexions
+ return;
+ }
+ }
+ if (wasClosed) {
+ // make sure to process once
+ return;
+ }
+ log.info("kill connexions... (last ui : " + e.getSource() + ")");
+ synchronized (this) {
+ try {
+ // all ui are down, kill all connexions
+ for (VCSConnexion connexion : VCSFactory.getInstance().getConnexions()) {
+ closeConnexion(connexion);
+ }
+ allWindowsClosed();
+ } finally {
+ wasClosed = true;
+ }
+ }
+ }
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -15,10 +15,11 @@
package org.codelutin.vcs.ui.action;
import static org.codelutin.i18n.I18n._;
+import org.codelutin.vcs.ui.ConfigUI;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import org.codelutin.vcs.ui.util.ui.AbstractUI;
-import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
-import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
-import org.codelutin.vcs.ui.VCSUIFactory;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
@@ -36,8 +37,10 @@
public void actionPerformed(ActionEvent e) {
checkInit();
- ui = VCSUIFactory.newConfigUI();
- ui.setVisible(true);
+ ConfigUI i = VCSUIFactory.newConfigUI();
+ // populate with common config
+ i.getHandler().getModel().populate(i.getHandler().getConfig());
+ i.setVisible(true);
}
protected ShowConfigAction() {
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -15,6 +15,7 @@
package org.codelutin.vcs.ui.handler;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.event.VCSActionThreadEvent;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSState;
@@ -32,8 +33,8 @@
/** @author chemit */
public class ChangelogUIHandler extends AbstractTabOneFileUIHandler<ChangelogUIModel, ChangelogUI> {
- public ChangelogUIHandler(ChangelogUI ui) {
- super(ui, new ChangelogUIModel(), true);
+ public ChangelogUIHandler(ChangelogUI ui, VCSConnexionConfig config) {
+ super(ui, new ChangelogUIModel(),config, true);
ui.setHandler(this);
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -39,8 +39,8 @@
protected List<Element> errors;
- public ConfigUIHandler(ConfigUI ui) {
- super(ui, new ConfigUIModel());
+ public ConfigUIHandler(ConfigUI ui,VCSConnexionConfig config) {
+ super(ui, new ConfigUIModel(),config);
ui.setHandler(this);
errors = new ArrayList<Element>();
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -16,6 +16,7 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.event.VCSActionThreadEvent;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.ConfirmUI;
@@ -41,8 +42,8 @@
public class ConfirmUIHandler extends AbstractBasicUIHandler<ConfirmUIModel, ConfirmUI> {
- public ConfirmUIHandler(ConfirmUI ui) {
- super(ui, new ConfirmUIModel(), false);
+ public ConfirmUIHandler(ConfirmUI ui, VCSConnexionConfig config) {
+ super(ui, new ConfirmUIModel(),config, false);
ui.setHandler(this);
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -17,6 +17,7 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.util.FileUtil;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.event.VCSActionThreadEvent;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSState;
@@ -35,8 +36,8 @@
/** @author chemit */
public class DiffUIHandler extends AbstractTabOneFileUIHandler<DiffUIModel, DiffUI> {
- public DiffUIHandler(DiffUI ui) {
- super(ui, new DiffUIModel(), true);
+ public DiffUIHandler(DiffUI ui, VCSConnexionConfig config) {
+ super(ui, new DiffUIModel(), config,true);
ui.setHandler(this);
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -2,6 +2,7 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.event.VCSActionThreadEvent;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSState;
@@ -23,8 +24,8 @@
/** @author chemit */
public class SynchUIHandler extends AbstractTabUIHandler<SynchUIModel, SynchUI> {
- public SynchUIHandler(SynchUI ui) {
- super(ui, new SynchUIModel(), true);
+ public SynchUIHandler(SynchUI ui,VCSConnexionConfig config) {
+ super(ui, new SynchUIModel(), config,true);
ui.setHandler(this);
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -15,6 +15,7 @@
package org.codelutin.vcs.ui.util.handler;
import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.ui.util.model.AbstractBasicUIModel;
import org.codelutin.vcs.ui.util.ui.AbstractBasicUI;
import org.codelutin.vcs.ui.util.UIHelper;
@@ -34,8 +35,8 @@
protected abstract void afterSelectionChanged();
- protected AbstractBasicUIHandler(U ui, M model, boolean useThreadListener) {
- super(ui, model);
+ protected AbstractBasicUIHandler(U ui, M model, VCSConnexionConfig config, boolean useThreadListener) {
+ super(ui, model,config);
this.useThreadListener = useThreadListener;
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -16,6 +16,7 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.model.DiffUIModel;
@@ -31,8 +32,8 @@
/** @author chemit */
public abstract class AbstractTabOneFileUIHandler<M extends AbstractTabOneFileUIModel, U extends AbstractTabOneFileUI<? extends AbstractTabUIHandler>> extends AbstractTabUIHandler<M, U> {
- protected AbstractTabOneFileUIHandler(U ui, M model,boolean useThreadListener) {
- super(ui, model,useThreadListener);
+ protected AbstractTabOneFileUIHandler(U ui, M model, VCSConnexionConfig config,boolean useThreadListener) {
+ super(ui, model,config,useThreadListener);
}
@Override
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -16,6 +16,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.ChangelogUI;
import org.codelutin.vcs.ui.ConfirmUI;
@@ -35,8 +36,8 @@
/** @author chemit */
public abstract class AbstractTabUIHandler<M extends AbstractTabUIModel, U extends AbstractTabUI<? extends AbstractTabUIHandler>> extends AbstractBasicUIHandler<M, U> implements TableModelListener {
- protected AbstractTabUIHandler(U ui, M model,boolean useThreadListener) {
- super(ui, model,useThreadListener);
+ protected AbstractTabUIHandler(U ui, M model, VCSConnexionConfig config,boolean useThreadListener) {
+ super(ui, model,config, useThreadListener);
}
public void propertyChange(PropertyChangeEvent evt) {
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java 2008-04-16 21:30:00 UTC (rev 536)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java 2008-04-16 22:43:18 UTC (rev 537)
@@ -16,6 +16,7 @@
import org.codelutin.vcs.ui.util.model.AbstractUIModel;
import org.codelutin.vcs.ui.util.ui.AbstractUI;
+import org.codelutin.vcs.VCSConnexionConfig;
/**
* TODO Move this classe in jaxx
@@ -24,7 +25,18 @@
*/
public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI<? extends AbstractUIHandler>> extends jaxx.DialogUIHandler<M, U> {
- protected AbstractUIHandler(U ui, M model) {
+ private VCSConnexionConfig config;
+
+ protected AbstractUIHandler(U ui, M model,VCSConnexionConfig config) {
super(ui, model);
+ this.config=config;
}
+
+ public VCSConnexionConfig getConfig() {
+ return config;
+ }
+
+ public void setConfig(VCSConnexionConfig config) {
+ this.config = config;
+ }
}
1
0
[Buix-commits] r536 - trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:30:00 +0000 (Wed, 16 Apr 2008)
New Revision: 536
Modified:
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css
Log:
add vertical scrollbar
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css 2008-04-16 21:17:24 UTC (rev 535)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css 2008-04-16 21:30:00 UTC (rev 536)
@@ -26,17 +26,12 @@
}
JSeparator {
- border: { null
+ border: { null};
+opaque:false;
}
-;
-opaque:false
-
-;
-}
-
.updateScroll, .diffScroll, .confirmScroll {
- verticalScrollBarPolicy: 21;
+ verticalScrollBarPolicy: 20;
horizontalScrollBarPolicy: 31;
}
@@ -46,6 +41,7 @@
rowSelectionAllowed: true;
rowMargin: 0;
}
+
#localEditorScroll,#remoteEditorScroll{
font-size:10;
}
1
0
[Buix-commits] r535 - in trunk/lutinvcs/ui: common/src/main/java/org/codelutin/vcs/ui/util/handler common/src/main/java/org/codelutin/vcs/ui/util/model jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:17:24 +0000 (Wed, 16 Apr 2008)
New Revision: 535
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java
trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx
Log:
refactor util package
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 21:11:34 UTC (rev 534)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 21:17:24 UTC (rev 535)
@@ -89,14 +89,14 @@
public void gotoPreviousFile() {
Integer index = getModel().getFileIndex();
- if (index != null && getModel().hasPreviousFile) {
+ if (index != null && getModel().isHasPreviousFile()) {
getSelectionModel().setSelectionInterval(index - 1, index - 1);
}
}
public void gotoNextFile() {
Integer index = getModel().getFileIndex();
- if (index != null && getModel().hasNextFile) {
+ if (index != null && getModel().isHasNextFile()) {
getSelectionModel().setSelectionInterval(index + 1, index + 1);
}
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java 2008-04-16 21:11:34 UTC (rev 534)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java 2008-04-16 21:17:24 UTC (rev 535)
@@ -73,4 +73,12 @@
public Integer getFileIndex() {
return fileIndex;
}
+
+ public boolean isHasPreviousFile() {
+ return hasPreviousFile;
+ }
+
+ public boolean isHasNextFile() {
+ return hasNextFile;
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx
===================================================================
--- trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx 2008-04-16 21:11:34 UTC (rev 534)
+++ trunk/lutinvcs/ui/jaxx/src/main/uimodel/org/codelutin/vcs/ui/JaxxConfigUI.jaxx 2008-04-16 21:17:24 UTC (rev 535)
@@ -63,7 +63,7 @@
<JLabel id='sshLoginLabel'/>
</cell>
<cell>
- <JTextField id='sshLogin' onKeyReleased="doCheck(Element.sshlogin)"/>
+ <JTextField id='sshLogin' onKeyReleased="doCheck(Element.sshLogin)"/>
</cell>
</row>
<row fill='horizontal'>
@@ -84,7 +84,7 @@
</cell>
<cell>
<JToolBar opaque='false' borderPainted='false' height="24">
- <JTextField id='privateKeyFile' onKeyReleased="doCheck(Element.privatekey)"/>
+ <JTextField id='privateKeyFile' onKeyReleased="doCheck(Element.privateKeyFile)"/>
<JButton id='changePrivateKeyFile' icon='{createActionIcon("filechooser")}'
onActionPerformed="changePrivateKeyFile()"/>
</JToolBar>
1
0
[Buix-commits] r534 - trunk/lutinvcs/all/src/test/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:11:34 +0000 (Wed, 16 Apr 2008)
New Revision: 534
Modified:
trunk/lutinvcs/all/src/test/java/org/codelutin/vcs/ui/UITest.java
Log:
refactor util package
Modified: trunk/lutinvcs/all/src/test/java/org/codelutin/vcs/ui/UITest.java
===================================================================
--- trunk/lutinvcs/all/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-16 21:11:27 UTC (rev 533)
+++ trunk/lutinvcs/all/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-16 21:11:34 UTC (rev 534)
@@ -20,7 +20,7 @@
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.type.VCSConnexionMode;
-import org.codelutin.vcs.ui.util.AbstractTabUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractTabUIModel;
import org.codelutin.vcs.util.VCSConnexionConfigImpl;
import java.awt.event.WindowAdapter;
1
0
[Buix-commits] r533 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util: . handler
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:11:27 +0000 (Wed, 16 Apr 2008)
New Revision: 533
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java
Log:
refactor util package
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java 2008-04-16 21:11:09 UTC (rev 532)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java 2008-04-16 21:11:27 UTC (rev 533)
@@ -17,6 +17,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
/** @author chemit */
public abstract class AbstractUIAction<H extends AbstractUIHandler<?, ?>> extends javax.swing.AbstractAction {
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java 2008-04-16 21:11:09 UTC (rev 532)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java 2008-04-16 21:11:27 UTC (rev 533)
@@ -15,8 +15,8 @@
package org.codelutin.vcs.ui.util.handler;
import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.ui.util.AbstractBasicUIModel;
-import org.codelutin.vcs.ui.util.AbstractBasicUI;
+import org.codelutin.vcs.ui.util.model.AbstractBasicUIModel;
+import org.codelutin.vcs.ui.util.ui.AbstractBasicUI;
import org.codelutin.vcs.ui.util.UIHelper;
import org.codelutin.vcs.event.VCSActionThreadEventListener;
import org.codelutin.vcs.runner.VCSActionManager;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 21:11:09 UTC (rev 532)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 21:11:27 UTC (rev 533)
@@ -19,8 +19,8 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.model.DiffUIModel;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUIModel;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUI;
+import org.codelutin.vcs.ui.util.model.AbstractTabOneFileUIModel;
+import org.codelutin.vcs.ui.util.ui.AbstractTabOneFileUI;
import javax.swing.AbstractButton;
import javax.swing.ListSelectionModel;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java 2008-04-16 21:11:09 UTC (rev 532)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java 2008-04-16 21:11:27 UTC (rev 533)
@@ -21,8 +21,8 @@
import org.codelutin.vcs.ui.ConfirmUI;
import org.codelutin.vcs.ui.DiffUI;
import org.codelutin.vcs.ui.VCSUIFactory;
-import org.codelutin.vcs.ui.util.AbstractTabUIModel;
-import org.codelutin.vcs.ui.util.AbstractTabUI;
+import org.codelutin.vcs.ui.util.model.AbstractTabUIModel;
+import org.codelutin.vcs.ui.util.ui.AbstractTabUI;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import javax.swing.AbstractButton;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java 2008-04-16 21:11:09 UTC (rev 532)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java 2008-04-16 21:11:27 UTC (rev 533)
@@ -14,8 +14,8 @@
*/
package org.codelutin.vcs.ui.util.handler;
-import org.codelutin.vcs.ui.util.AbstractUIModel;
-import org.codelutin.vcs.ui.util.AbstractUI;
+import org.codelutin.vcs.ui.util.model.AbstractUIModel;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
/**
* TODO Move this classe in jaxx
1
0
[Buix-commits] r532 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . action model util util/model util/ui
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:11:09 +0000 (Wed, 16 Apr 2008)
New Revision: 532
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractBasicUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractBasicUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractUI.java
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ChangelogUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfirmUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/DiffUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIProvider.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ChangelogUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
Log:
refactor util package
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ChangelogUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ChangelogUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ChangelogUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,8 +14,11 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.ui.handler.ChangelogUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractTabOneFileUI;
+
/** @author chemit */
-public abstract class ChangelogUI extends org.codelutin.vcs.ui.util.AbstractTabOneFileUI<org.codelutin.vcs.ui.handler.ChangelogUIHandler> {
+public abstract class ChangelogUI extends AbstractTabOneFileUI<ChangelogUIHandler> {
public abstract javax.swing.JTextArea getChangelogContent();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfigUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -17,6 +17,8 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.util.FileUtil;
import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.ui.handler.ConfigUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
@@ -30,7 +32,7 @@
import java.io.File;
/** @author chemit */
-public abstract class ConfigUI extends org.codelutin.vcs.ui.util.AbstractUI<org.codelutin.vcs.ui.handler.ConfigUIHandler> {
+public abstract class ConfigUI extends AbstractUI<ConfigUIHandler> {
public enum Element {
firstname,
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfirmUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfirmUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/ConfirmUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -15,6 +15,8 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.ui.action.ShowMessagesAction;
+import org.codelutin.vcs.ui.handler.ConfirmUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractBasicUI;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
@@ -29,7 +31,7 @@
import javax.swing.JToolBar;
/** @author chemit */
-public abstract class ConfirmUI extends org.codelutin.vcs.ui.util.AbstractBasicUI<org.codelutin.vcs.ui.handler.ConfirmUIHandler> {
+public abstract class ConfirmUI extends AbstractBasicUI<ConfirmUIHandler> {
public abstract JLabel getActionLabel();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/DiffUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/DiffUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/DiffUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,13 +14,16 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.ui.handler.DiffUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractTabOneFileUI;
+
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
/** @author chemit */
-public abstract class DiffUI extends org.codelutin.vcs.ui.util.AbstractTabOneFileUI<org.codelutin.vcs.ui.handler.DiffUIHandler> {
+public abstract class DiffUI extends AbstractTabOneFileUI<DiffUIHandler> {
public abstract AbstractButton getNextDiff();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/SynchUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,12 +14,15 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.ui.handler.SynchUIHandler;
+import org.codelutin.vcs.ui.util.ui.AbstractTabUI;
+
import javax.swing.AbstractButton;
import javax.swing.JPopupMenu;
import java.awt.event.WindowEvent;
/** @author chemit */
-public abstract class SynchUI extends org.codelutin.vcs.ui.util.AbstractTabUI<org.codelutin.vcs.ui.handler.SynchUIHandler> {
+public abstract class SynchUI extends AbstractTabUI<SynchUIHandler> {
public abstract AbstractButton getRefreshAll();
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,13 +14,13 @@
*/
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.ui.util.AbstractUI;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
-import org.codelutin.vcs.ui.util.AbstractUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractUIModel;
/**
* @author chemit
- * @see AbstractUI
+ * @see org.codelutin.vcs.ui.util.ui.AbstractUI
* @see AbstractUIModel
* @see org.codelutin.vcs.ui.util.handler.AbstractUIHandler
*/
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -18,7 +18,7 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.StringUtil;
import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.ui.util.AbstractUI;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIProvider.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIProvider.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUIProvider.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.ui.util.AbstractUI;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
/** @author chemit */
public abstract class VCSUIProvider {
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui.action;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUI;
+import org.codelutin.vcs.ui.util.ui.AbstractTabOneFileUI;
import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.action;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.util.AbstractTabUI;
+import org.codelutin.vcs.ui.util.ui.AbstractTabUI;
import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
import org.codelutin.vcs.ui.util.UIHelper;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.action;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.ui.util.AbstractUI;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.action;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.ui.util.AbstractUI;
+import org.codelutin.vcs.ui.util.ui.AbstractUI;
import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
import org.codelutin.vcs.ui.VCSUIFactory;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.util.AbstractTabUI;
+import org.codelutin.vcs.ui.util.ui.AbstractTabUI;
import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.util.UIHelper;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ChangelogUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ChangelogUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ChangelogUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractTabOneFileUIModel;
/**
* Model of a repository
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfigUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -24,7 +24,7 @@
import static org.codelutin.vcs.ui.ConfigUI.Element.password;
import static org.codelutin.vcs.ui.ConfigUI.Element.privateKeyFile;
import static org.codelutin.vcs.ui.ConfigUI.Element.sshLogin;
-import org.codelutin.vcs.ui.util.AbstractUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractUIModel;
import java.io.File;
import java.util.ArrayList;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -17,7 +17,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.util.AbstractBasicUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractBasicUIModel;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractTabOneFileUIModel;
/**
* Model of a repository
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.ui.util.AbstractTabUIModel;
+import org.codelutin.vcs.ui.util.model.AbstractTabUIModel;
/**
* Model of a repository
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,29 +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.util;
-
-import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-
-/** @author chemit */
-public abstract class AbstractBasicUI<H extends AbstractUIHandler> extends AbstractUI<H> {
-
- public abstract JScrollPane getContentScroll();
-
- public abstract JTable getContentTable();
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,64 +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.util;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.VCSConnexion;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.model.SimpleVCSEntriesTableModelImpl;
-
-import java.util.List;
-
-/**
- * Basic ui model, with a {@link AbstractVCSEntriesTableModel} model.
- * <p/>
- * Encapsulate an {@link org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel}.
- *
- * @author chemit
- */
-public abstract class AbstractBasicUIModel extends AbstractUIModel {
-
- static protected final Log log = LogFactory.getLog(AbstractBasicUIModel.class);
-
- protected final AbstractVCSEntriesTableModel entriesModel;
-
- protected AbstractBasicUIModel() {
- entriesModel = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
- }
-
- public AbstractVCSEntriesTableModel getEntriesModel() {
- return entriesModel;
- }
-
- public void populate(VCSConnexion connexion) throws VCSException {
- getEntriesModel().populate(connexion, System.nanoTime());
- }
-
- public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location) throws VCSException {
- getEntriesModel().populate(connexion, System.nanoTime(), location, relativeLocalPaths);
- }
-
- public void populate(VCSEntryLocation location, VCSEntry[] datas) {
- getEntriesModel().populate(location, datas);
- }
-
- public void refresh(List<VCSEntry> entries) throws VCSException {
- getEntriesModel().refresh(System.nanoTime(), entries);
- }
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,55 +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.util;
-
-import org.codelutin.vcs.ui.action.ChangeFileAction;
-import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
-
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import java.awt.event.WindowEvent;
-
-/** @author chemit */
-public abstract class AbstractTabOneFileUI<H extends AbstractTabOneFileUIHandler<?, ?>> extends AbstractTabUI<H> {
-
- public abstract AbstractButton getNextFile();
-
- public abstract AbstractButton getPreviousFile();
-
- protected AbstractAction createFileAction(boolean goPrevious) {
- return ChangeFileAction.createAction(goPrevious, this);
- }
-
- protected boolean hasListener;
-
- @Override
- public synchronized void windowActivated(WindowEvent e) {
- if (!hasListener && getHandler().isUseThreadListener()) {
- // add action manager listener
- getHandler().getActionManager().addVCSActionThreadEventListener(getHandler());
- hasListener = true;
- }
- super.windowActivated(e);
- }
-
- @Override
- public synchronized void windowDeactivated(WindowEvent e) {
- if (!isVisible() && getHandler().isUseThreadListener() && hasListener) {
- // remove action manager listener
- getHandler().getActionManager().removeVCSActionThreadEventListener(getHandler());
- hasListener = false;
- }
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,76 +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.util;
-
-import org.codelutin.vcs.VCSEntry;
-
-/**
- * Abstract for a dialog with location information (says one tab by location type (except UNKNOW type of course...)
- *
- * @author chemit
- */
-public class AbstractTabOneFileUIModel extends AbstractTabUIModel {
-
- public static final String FILE_PROPERTY_CHANGED = "file";
-
- /** current file displayed */
- protected VCSEntry fileModel;
-
- protected boolean hasNextFile;
- protected boolean hasPreviousFile;
-
- protected Integer fileIndex;
-
- public VCSEntry getFileModel() {
- if (fileIndex == null) {
- return null;
- }
- return getEntriesModel().getDisplayedEntry(fileIndex);
- }
-
- public void setFileModel(Integer fileIndex) {
- VCSEntry oldFileModel = this.fileModel;
- this.fileIndex = fileIndex;
-
- int size = getEntriesModel().getRowCount();
- if (fileIndex == null || size < 2) {
- hasNextFile = hasPreviousFile = false;
- } else {
- hasNextFile = hasPreviousFile = true;
- if (fileIndex == 0) {
- // first row : no previous file
- hasPreviousFile = false;
- } else {
- if (fileIndex == size - 1) {
- // last row : no next file
- hasNextFile = false;
- }
- }
- }
- firePropertyChange(FILE_PROPERTY_CHANGED, oldFileModel, fileIndex);
- }
-
- public boolean hasPreviousFile() {
- return hasPreviousFile;
- }
-
- public boolean hasNextFile() {
- return hasNextFile;
- }
-
- public Integer getFileIndex() {
- return fileIndex;
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,85 +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.util;
-
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
-
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.ButtonGroup;
-
-/** @author chemit */
-public abstract class AbstractTabUI<H extends AbstractTabUIHandler<?, ?>> extends AbstractBasicUI<H> {
-
- public abstract ButtonGroup getTabs();
-
- public abstract AbstractButton getAllTab();
-
- public abstract AbstractButton getLocalTab();
-
- public abstract AbstractButton getRemoteTab();
-
- public abstract AbstractButton getRefresh();
-
- public abstract AbstractButton getUpdate();
-
- public abstract AbstractButton getRevert();
-
- @Override
- public void setVisible(boolean b) {
- if (b) {
- VCSEntryLocation vcsEntryLocation = getHandler().getLocation();
- AbstractButton button = getButton(vcsEntryLocation);
- if (button == null) {
- button = getAllTab();
- }
- getHandler().getModel().setLocation(VCSEntryLocation.UNKNOW);
- button.doClick();
- }
- super.setVisible(b);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- // clean model
- getHandler().getModel().getEntriesModel().clear();
- }
-
- public AbstractButton getButton(VCSEntryLocation modelName) {
- switch (modelName) {
- case ALL:
- return getAllTab();
- case LOCAL:
- return getLocalTab();
- case REMOTE:
- return getRemoteTab();
- case UNKNOW:
- return null;
- }
- throw new IllegalStateException("no button found for " + modelName);
- }
-
- protected AbstractAction createLocationAction(VCSEntryLocation location) {
- return org.codelutin.vcs.ui.action.ChangeLocationAction.createAction(location, this);
- }
-
- protected AbstractAction createAction(VCSAction action, boolean useSelection) {
- return org.codelutin.vcs.ui.action.TabUIAction.createAction(action, useSelection, this);
- }
-
-}
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,34 +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.util;
-
-import org.codelutin.vcs.type.VCSEntryLocation;
-
-/**
- * Abstract for a dialog with location information (says one tab by location type (except UNKNOW type of course...)
- *
- * @author chemit
- */
-public class AbstractTabUIModel extends AbstractBasicUIModel {
-
- public static final String LOCATION_PROPERTY_CHANGED = "location";
-
- public void setLocation(VCSEntryLocation location) {
- VCSEntryLocation oldLocation = getEntriesModel().getLocation();
- getEntriesModel().setLocation(location);
- firePropertyChange(LOCATION_PROPERTY_CHANGED, oldLocation, location);
- }
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,35 +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.util;
-
-import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
-
-/**
- * A abstract dialog contract to be realised by a dialog
- * <p/>
- * TODO : make jaxx authorized implementing interface for root tag :)
- *
- * @author chemit
- */
-public abstract class AbstractUI<H extends AbstractUIHandler> extends jaxx.DialogUI<H> {
-
- protected javax.swing.AbstractAction createHelpAction() {
- return org.codelutin.vcs.ui.action.HelpAction.createAction(this);
- }
-
- protected javax.swing.AbstractAction createShowConfigAction() {
- return org.codelutin.vcs.ui.action.ShowConfigAction.createAction(this);
- }
-}
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java 2008-04-16 21:09:36 UTC (rev 531)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -1,27 +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.util;
-
-import jaxx.DialogUIModel;
-
-/**
- * TODO Move this classe in jaxx
- * Abstract ui model, with property change support.
- *
- * @author chemit
- */
-public abstract class AbstractUIModel extends DialogUIModel {
-
-}
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractBasicUIModel.java (from rev 524, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIModel.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractBasicUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractBasicUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,65 @@
+/**
+ * ##% 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.util.model;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.VCSConnexion;
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.model.SimpleVCSEntriesTableModelImpl;
+import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
+
+import java.util.List;
+
+/**
+ * Basic ui model, with a {@link org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel} model.
+ * <p/>
+ * Encapsulate an {@link org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel}.
+ *
+ * @author chemit
+ */
+public abstract class AbstractBasicUIModel extends AbstractUIModel {
+
+ static protected final Log log = LogFactory.getLog(AbstractBasicUIModel.class);
+
+ protected final AbstractVCSEntriesTableModel entriesModel;
+
+ protected AbstractBasicUIModel() {
+ entriesModel = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
+ }
+
+ public AbstractVCSEntriesTableModel getEntriesModel() {
+ return entriesModel;
+ }
+
+ public void populate(VCSConnexion connexion) throws VCSException {
+ getEntriesModel().populate(connexion, System.nanoTime());
+ }
+
+ public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location) throws VCSException {
+ getEntriesModel().populate(connexion, System.nanoTime(), location, relativeLocalPaths);
+ }
+
+ public void populate(VCSEntryLocation location, VCSEntry[] datas) {
+ getEntriesModel().populate(location, datas);
+ }
+
+ public void refresh(List<VCSEntry> entries) throws VCSException {
+ getEntriesModel().refresh(System.nanoTime(), entries);
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java (from rev 524, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIModel.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabOneFileUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,76 @@
+/**
+ * ##% 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.util.model;
+
+import org.codelutin.vcs.VCSEntry;
+
+/**
+ * Abstract for a dialog with location information (says one tab by location type (except UNKNOW type of course...)
+ *
+ * @author chemit
+ */
+public class AbstractTabOneFileUIModel extends AbstractTabUIModel {
+
+ public static final String FILE_PROPERTY_CHANGED = "file";
+
+ /** current file displayed */
+ protected VCSEntry fileModel;
+
+ protected boolean hasNextFile;
+ protected boolean hasPreviousFile;
+
+ protected Integer fileIndex;
+
+ public VCSEntry getFileModel() {
+ if (fileIndex == null) {
+ return null;
+ }
+ return getEntriesModel().getDisplayedEntry(fileIndex);
+ }
+
+ public void setFileModel(Integer fileIndex) {
+ VCSEntry oldFileModel = this.fileModel;
+ this.fileIndex = fileIndex;
+
+ int size = getEntriesModel().getRowCount();
+ if (fileIndex == null || size < 2) {
+ hasNextFile = hasPreviousFile = false;
+ } else {
+ hasNextFile = hasPreviousFile = true;
+ if (fileIndex == 0) {
+ // first row : no previous file
+ hasPreviousFile = false;
+ } else {
+ if (fileIndex == size - 1) {
+ // last row : no next file
+ hasNextFile = false;
+ }
+ }
+ }
+ firePropertyChange(FILE_PROPERTY_CHANGED, oldFileModel, fileIndex);
+ }
+
+ public boolean hasPreviousFile() {
+ return hasPreviousFile;
+ }
+
+ public boolean hasNextFile() {
+ return hasNextFile;
+ }
+
+ public Integer getFileIndex() {
+ return fileIndex;
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabUIModel.java (from rev 524, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIModel.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractTabUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,34 @@
+/**
+ * ##% 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.util.model;
+
+import org.codelutin.vcs.type.VCSEntryLocation;
+
+/**
+ * Abstract for a dialog with location information (says one tab by location type (except UNKNOW type of course...)
+ *
+ * @author chemit
+ */
+public class AbstractTabUIModel extends AbstractBasicUIModel {
+
+ public static final String LOCATION_PROPERTY_CHANGED = "location";
+
+ public void setLocation(VCSEntryLocation location) {
+ VCSEntryLocation oldLocation = getEntriesModel().getLocation();
+ getEntriesModel().setLocation(location);
+ firePropertyChange(LOCATION_PROPERTY_CHANGED, oldLocation, location);
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractUIModel.java (from rev 530, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractUIModel.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/model/AbstractUIModel.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,27 @@
+/**
+ * ##% 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.util.model;
+
+import jaxx.DialogUIModel;
+
+/**
+ * TODO Move this classe in jaxx
+ * Abstract ui model, with property change support.
+ *
+ * @author chemit
+ */
+public abstract class AbstractUIModel extends DialogUIModel {
+
+}
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractBasicUI.java (from rev 531, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractBasicUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractBasicUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,29 @@
+/**
+ * ##% 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.util.ui;
+
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+
+/** @author chemit */
+public abstract class AbstractBasicUI<H extends AbstractUIHandler> extends AbstractUI<H> {
+
+ public abstract JScrollPane getContentScroll();
+
+ public abstract JTable getContentTable();
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java (from rev 531, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabOneFileUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,55 @@
+/**
+ * ##% 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.util.ui;
+
+import org.codelutin.vcs.ui.action.ChangeFileAction;
+import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import java.awt.event.WindowEvent;
+
+/** @author chemit */
+public abstract class AbstractTabOneFileUI<H extends AbstractTabOneFileUIHandler<?, ?>> extends AbstractTabUI<H> {
+
+ public abstract AbstractButton getNextFile();
+
+ public abstract AbstractButton getPreviousFile();
+
+ protected AbstractAction createFileAction(boolean goPrevious) {
+ return ChangeFileAction.createAction(goPrevious, this);
+ }
+
+ protected boolean hasListener;
+
+ @Override
+ public synchronized void windowActivated(WindowEvent e) {
+ if (!hasListener && getHandler().isUseThreadListener()) {
+ // add action manager listener
+ getHandler().getActionManager().addVCSActionThreadEventListener(getHandler());
+ hasListener = true;
+ }
+ super.windowActivated(e);
+ }
+
+ @Override
+ public synchronized void windowDeactivated(WindowEvent e) {
+ if (!isVisible() && getHandler().isUseThreadListener() && hasListener) {
+ // remove action manager listener
+ getHandler().getActionManager().removeVCSActionThreadEventListener(getHandler());
+ hasListener = false;
+ }
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java (from rev 531, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractTabUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,85 @@
+/**
+ * ##% 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.util.ui;
+
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+
+/** @author chemit */
+public abstract class AbstractTabUI<H extends AbstractTabUIHandler<?, ?>> extends AbstractBasicUI<H> {
+
+ public abstract ButtonGroup getTabs();
+
+ public abstract AbstractButton getAllTab();
+
+ public abstract AbstractButton getLocalTab();
+
+ public abstract AbstractButton getRemoteTab();
+
+ public abstract AbstractButton getRefresh();
+
+ public abstract AbstractButton getUpdate();
+
+ public abstract AbstractButton getRevert();
+
+ @Override
+ public void setVisible(boolean b) {
+ if (b) {
+ VCSEntryLocation vcsEntryLocation = getHandler().getLocation();
+ AbstractButton button = getButton(vcsEntryLocation);
+ if (button == null) {
+ button = getAllTab();
+ }
+ getHandler().getModel().setLocation(VCSEntryLocation.UNKNOW);
+ button.doClick();
+ }
+ super.setVisible(b);
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ // clean model
+ getHandler().getModel().getEntriesModel().clear();
+ }
+
+ public AbstractButton getButton(VCSEntryLocation modelName) {
+ switch (modelName) {
+ case ALL:
+ return getAllTab();
+ case LOCAL:
+ return getLocalTab();
+ case REMOTE:
+ return getRemoteTab();
+ case UNKNOW:
+ return null;
+ }
+ throw new IllegalStateException("no button found for " + modelName);
+ }
+
+ protected AbstractAction createLocationAction(VCSEntryLocation location) {
+ return org.codelutin.vcs.ui.action.ChangeLocationAction.createAction(location, this);
+ }
+
+ protected AbstractAction createAction(VCSAction action, boolean useSelection) {
+ return org.codelutin.vcs.ui.action.TabUIAction.createAction(action, useSelection, this);
+ }
+
+}
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractUI.java (from rev 531, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractUI.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/ui/AbstractUI.java 2008-04-16 21:11:09 UTC (rev 532)
@@ -0,0 +1,35 @@
+/**
+ * ##% 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.util.ui;
+
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
+
+/**
+ * A abstract dialog contract to be realised by a dialog
+ * <p/>
+ * TODO : make jaxx authorized implementing interface for root tag :)
+ *
+ * @author chemit
+ */
+public abstract class AbstractUI<H extends AbstractUIHandler> extends jaxx.DialogUI<H> {
+
+ protected javax.swing.AbstractAction createHelpAction() {
+ return org.codelutin.vcs.ui.action.HelpAction.createAction(this);
+ }
+
+ protected javax.swing.AbstractAction createShowConfigAction() {
+ return org.codelutin.vcs.ui.action.ShowConfigAction.createAction(this);
+ }
+}
1
0
[Buix-commits] r531 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . action handler util util/handler
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:09:36 +0000 (Wed, 16 Apr 2008)
New Revision: 531
Added:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java
Removed:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java
Log:
refactor util package
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/VCSUI.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -15,14 +15,14 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.ui.util.AbstractUI;
-import org.codelutin.vcs.ui.util.AbstractUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import org.codelutin.vcs.ui.util.AbstractUIModel;
/**
* @author chemit
* @see AbstractUI
* @see AbstractUIModel
- * @see AbstractUIHandler
+ * @see org.codelutin.vcs.ui.util.handler.AbstractUIHandler
*/
public enum VCSUI {
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeFileAction.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.action;
import org.codelutin.vcs.ui.util.AbstractTabOneFileUI;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
import javax.swing.AbstractAction;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ChangeLocationAction.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.util.AbstractTabUI;
-import org.codelutin.vcs.ui.util.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
import org.codelutin.vcs.ui.util.UIHelper;
import javax.swing.AbstractAction;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/HelpAction.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -16,7 +16,7 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.ui.util.AbstractUI;
-import org.codelutin.vcs.ui.util.AbstractUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
import javax.swing.AbstractAction;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/ShowConfigAction.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -16,7 +16,7 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.ui.util.AbstractUI;
-import org.codelutin.vcs.ui.util.AbstractUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import static org.codelutin.vcs.ui.util.UIHelper.createActionIcon;
import org.codelutin.vcs.ui.VCSUIFactory;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/action/TabUIAction.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -17,7 +17,7 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.util.AbstractTabUI;
-import org.codelutin.vcs.ui.util.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.util.UIHelper;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ChangelogUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -20,7 +20,7 @@
import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.ui.ChangelogUI;
import org.codelutin.vcs.ui.model.ChangelogUIModel;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import javax.swing.SwingUtilities;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfigUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -20,7 +20,7 @@
import org.codelutin.vcs.ui.ConfigUI.Element;
import static org.codelutin.vcs.ui.ConfigUI.Element.*;
import org.codelutin.vcs.ui.model.ConfigUIModel;
-import org.codelutin.vcs.ui.util.AbstractUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
import javax.swing.JComponent;
import javax.swing.JPanel;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/ConfirmUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -20,7 +20,7 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.ConfirmUI;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
-import org.codelutin.vcs.ui.util.AbstractBasicUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractBasicUIHandler;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.util.UIHelper;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/DiffUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -22,7 +22,7 @@
import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.ui.DiffUI;
import org.codelutin.vcs.ui.model.DiffUIModel;
-import org.codelutin.vcs.ui.util.AbstractTabOneFileUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import javax.swing.SwingUtilities;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/handler/SynchUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -7,7 +7,7 @@
import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.ui.SynchUI;
import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.ui.util.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
import javax.swing.AbstractButton;
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUI.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -14,6 +14,8 @@
*/
package org.codelutin.vcs.ui.util;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
+
import javax.swing.JScrollPane;
import javax.swing.JTable;
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -1,72 +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.util;
-
-import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.event.VCSActionThreadEventListener;
-import org.codelutin.vcs.runner.VCSActionManager;
-import org.codelutin.vcs.type.VCSEntryLocation;
-
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-/** @author chemit */
-public abstract class AbstractBasicUIHandler<M extends AbstractBasicUIModel, U extends AbstractBasicUI<? extends AbstractBasicUIHandler>> extends AbstractUIHandler<M, U> implements ListSelectionListener, VCSActionThreadEventListener {
-
- private final boolean useThreadListener;
-
- protected abstract void afterSelectionChanged();
-
- protected AbstractBasicUIHandler(U ui, M model, boolean useThreadListener) {
- super(ui, model);
- this.useThreadListener = useThreadListener;
- }
-
- public final ListSelectionModel getSelectionModel() {
- return getUi().getContentTable().getSelectionModel();
- }
-
- public boolean isUseThreadListener() {
- return useThreadListener;
- }
-
- public void valueChanged(ListSelectionEvent e) {
- if (!e.getValueIsAdjusting()) {
- // update popup states
- afterSelectionChanged();
- }
- }
-
- @Override
- public void init() {
- super.init();
- getUi().getContentTable().getSelectionModel().addListSelectionListener(this);
- JTable table = getUi().getContentTable();
- table.setModel(getModel().getEntriesModel());
- // init table renderer
- UIHelper.installVCSTableUI(table);
- }
-
- public VCSEntryLocation getLocation() {
- return getModel().getEntriesModel().getLocation();
- }
-
- public VCSActionManager getActionManager() {
- return VCSFactory.getActionManager();
- }
-
-}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUI.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -15,6 +15,7 @@
package org.codelutin.vcs.ui.util;
import org.codelutin.vcs.ui.action.ChangeFileAction;
+import org.codelutin.vcs.ui.util.handler.AbstractTabOneFileUIHandler;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -1,111 +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.util;
-
-import static org.codelutin.i18n.I18n._;
-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 javax.swing.AbstractButton;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import java.beans.PropertyChangeEvent;
-import java.util.EnumMap;
-
-/** @author chemit */
-public abstract class AbstractTabOneFileUIHandler<M extends AbstractTabOneFileUIModel, U extends AbstractTabOneFileUI<? extends AbstractTabUIHandler>> extends AbstractTabUIHandler<M, U> {
-
- protected AbstractTabOneFileUIHandler(U ui, M model,boolean useThreadListener) {
- super(ui, model,useThreadListener);
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(evt.getPropertyName())) {
- afterSelectionChanged();
- return;
- }
- super.propertyChange(evt);
- }
-
- @Override
- public void valueChanged(ListSelectionEvent e) {
- if (!e.getValueIsAdjusting()) {
-
- ListSelectionModel selectionModel = (ListSelectionModel) e.getSource();
-
- Integer selectionIndex = selectionModel.isSelectionEmpty() ? null : selectionModel.getMinSelectionIndex();
-
- getModel().setFileModel(selectionIndex);
- }
- }
-
- protected void afterSelectionChanged() {
- U ui = getUi();
- boolean hasNext = getModel().hasNextFile();
- boolean hasPrevious = getModel().hasPreviousFile();
- ui.getNextFile().setEnabled(hasNext);
- ui.getPreviousFile().setEnabled(hasPrevious);
- ui.getNextFile().setToolTipText(hasNext ? _("lutinvcs.action.nextfile.tip") : null);
- ui.getPreviousFile().setToolTipText(hasPrevious ? _("lutinvcs.action.previousfile.tip") : null);
- // always scroll to selected
- Integer selectedRow = getModel().getFileIndex();
- if (selectedRow != null) {
- ui.getContentTable().scrollRectToVisible(ui.getContentTable().getCellRect(selectedRow, 0, true));
- }
- }
-
- public void afterLocationChanged() {
- if (getLocation() == VCSEntryLocation.UNKNOW) {
- return;
- }
- if (getModel().getEntriesModel().getRowCount() > 0) {
- // select first row
- getSelectionModel().setSelectionInterval(0, 0);
- } else {
- // disable all actions
- afterSelectionChanged();
- }
- }
-
- public void gotoPreviousFile() {
- Integer index = getModel().getFileIndex();
- if (index != null && getModel().hasPreviousFile) {
- getSelectionModel().setSelectionInterval(index - 1, index - 1);
- }
- }
-
- public void gotoNextFile() {
- Integer index = getModel().getFileIndex();
- if (index != null && getModel().hasNextFile) {
- getSelectionModel().setSelectionInterval(index + 1, index + 1);
- }
- }
-
- protected void updateAction(EnumMap<VCSAction, Integer> actions, boolean hasActions, AbstractButton ui, VCSAction action, VCSEntry vcsEntry) {
- super.updateAction(actions, hasActions, ui, action);
- boolean useAction = hasActions && actions.containsKey(action) && actions.get(action) > 0;
- String tip = null;
- if (useAction) {
- tip = _("lutinvcs.action.single.tip", action.getLibelle(), vcsEntry.getFile().getName());
- }
- ui.setToolTipText(tip);
- }
-}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUI.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -16,6 +16,7 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.util.handler.AbstractTabUIHandler;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -1,115 +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.util;
-
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.ChangelogUI;
-import org.codelutin.vcs.ui.ConfirmUI;
-import org.codelutin.vcs.ui.DiffUI;
-import org.codelutin.vcs.ui.VCSUIFactory;
-
-import javax.swing.AbstractButton;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.TableModelListener;
-import java.beans.PropertyChangeEvent;
-import java.util.EnumMap;
-import java.util.List;
-
-/** @author chemit */
-public abstract class AbstractTabUIHandler<M extends AbstractTabUIModel, U extends AbstractTabUI<? extends AbstractTabUIHandler>> extends AbstractBasicUIHandler<M, U> implements TableModelListener {
-
- protected AbstractTabUIHandler(U ui, M model,boolean useThreadListener) {
- super(ui, model,useThreadListener);
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
- if (AbstractTabUIModel.LOCATION_PROPERTY_CHANGED.equals(action)) {
- afterLocationChanged();
- }
- }
-
- @Override
- public void init() {
- super.init();
- getUi().getContentTable().getModel().addTableModelListener(this);
- }
-
- protected abstract void afterLocationChanged();
-
-
- protected void updateAction(EnumMap<VCSAction, Integer> actions, boolean hasActions, AbstractButton ui, VCSAction action) {
- ui.setEnabled(hasActions && actions.containsKey(action) && actions.get(action) > 0);
- }
-
- public void showConfirmUI(VCSAction action, AbstractVCSEntriesTableModel model, List<VCSEntry> entries) {
- ConfirmUI ui = VCSUIFactory.newConfirmUI();
- if (log.isDebugEnabled()) {
- log.debug("nb entries:" + entries.size());
- }
- ui.getHandler().getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
- ui.getContentScroll().setEnabled(entries.size() > 1);
- ui.setVisible(true);
- }
-
- public void showDiffUI(boolean useSelection, AbstractVCSEntriesTableModel model, List<VCSEntry> entries) {
- DiffUI ui = VCSUIFactory.newDiffUI();
- if (!useSelection) {
- // take all entries
- entries = model.filter(VCSAction.DIFF, model.getEntries());
- }
- if (log.isDebugEnabled()) {
- log.debug("nb entries:" + entries.size());
- }
- ui.getButton(model.getLocation()).setSelected(false);
- ui.getHandler().getModel().init(model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
- ui.getContentScroll().setEnabled(entries.size() > 1);
- ui.setVisible(true);
- }
-
- public void showChangelogUI(boolean useSelection, AbstractVCSEntriesTableModel model, List<VCSEntry> entries) {
- ChangelogUI ui = VCSUIFactory.newChangelogUI();
- if (!useSelection) {
- // take all entries
- entries = model.filter(VCSAction.CHANGELOG, model.getEntries());
- }
- if (log.isDebugEnabled()) {
- log.debug("nb entries:" + entries.size());
- }
- ui.getHandler().getModel().init(model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
- ui.getContentScroll().setEnabled(entries.size() > 1);
- ui.setVisible(true);
- }
-
- public void doRefresh(AbstractVCSEntriesTableModel model, List<VCSEntry> entries, ListSelectionModel selectionModel) {
- log.info(selectionModel);
- selectionModel.clearSelection();
- if (log.isDebugEnabled()) {
- log.debug("nb entries:" + entries.size());
- }
- // do refresh of all states
- try {
- model.refresh(System.nanoTime(), entries);
- } catch (VCSException e) {
- log.error(e);
- }
- }
-
-}
\ No newline at end of file
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -14,6 +14,8 @@
*/
package org.codelutin.vcs.ui.util;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
+
/**
* A abstract dialog contract to be realised by a dialog
* <p/>
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIAction.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -16,6 +16,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.ui.util.handler.AbstractUIHandler;
/** @author chemit */
public abstract class AbstractUIAction<H extends AbstractUIHandler<?, ?>> extends javax.swing.AbstractAction {
Deleted: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -1,27 +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.util;
-
-/**
- * TODO Move this classe in jaxx
- *
- * @author chemit
- */
-public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI<? extends AbstractUIHandler>> extends jaxx.DialogUIHandler<M, U> {
-
- protected AbstractUIHandler(U ui, M model) {
- super(ui, model);
- }
-}
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java (from rev 524, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractBasicUIHandler.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractBasicUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -0,0 +1,75 @@
+/**
+ * ##% 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.util.handler;
+
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.ui.util.AbstractBasicUIModel;
+import org.codelutin.vcs.ui.util.AbstractBasicUI;
+import org.codelutin.vcs.ui.util.UIHelper;
+import org.codelutin.vcs.event.VCSActionThreadEventListener;
+import org.codelutin.vcs.runner.VCSActionManager;
+import org.codelutin.vcs.type.VCSEntryLocation;
+
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+/** @author chemit */
+public abstract class AbstractBasicUIHandler<M extends AbstractBasicUIModel, U extends AbstractBasicUI<? extends AbstractBasicUIHandler>> extends AbstractUIHandler<M, U> implements ListSelectionListener, VCSActionThreadEventListener {
+
+ private final boolean useThreadListener;
+
+ protected abstract void afterSelectionChanged();
+
+ protected AbstractBasicUIHandler(U ui, M model, boolean useThreadListener) {
+ super(ui, model);
+ this.useThreadListener = useThreadListener;
+ }
+
+ public final ListSelectionModel getSelectionModel() {
+ return getUi().getContentTable().getSelectionModel();
+ }
+
+ public boolean isUseThreadListener() {
+ return useThreadListener;
+ }
+
+ public void valueChanged(ListSelectionEvent e) {
+ if (!e.getValueIsAdjusting()) {
+ // update popup states
+ afterSelectionChanged();
+ }
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ getUi().getContentTable().getSelectionModel().addListSelectionListener(this);
+ JTable table = getUi().getContentTable();
+ table.setModel(getModel().getEntriesModel());
+ // init table renderer
+ UIHelper.installVCSTableUI(table);
+ }
+
+ public VCSEntryLocation getLocation() {
+ return getModel().getEntriesModel().getLocation();
+ }
+
+ public VCSActionManager getActionManager() {
+ return VCSFactory.getActionManager();
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java (from rev 524, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabOneFileUIHandler.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabOneFileUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -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.util.handler;
+
+import static org.codelutin.i18n.I18n._;
+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.util.AbstractTabOneFileUIModel;
+import org.codelutin.vcs.ui.util.AbstractTabOneFileUI;
+
+import javax.swing.AbstractButton;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import java.beans.PropertyChangeEvent;
+import java.util.EnumMap;
+
+/** @author chemit */
+public abstract class AbstractTabOneFileUIHandler<M extends AbstractTabOneFileUIModel, U extends AbstractTabOneFileUI<? extends AbstractTabUIHandler>> extends AbstractTabUIHandler<M, U> {
+
+ protected AbstractTabOneFileUIHandler(U ui, M model,boolean useThreadListener) {
+ super(ui, model,useThreadListener);
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(evt.getPropertyName())) {
+ afterSelectionChanged();
+ return;
+ }
+ super.propertyChange(evt);
+ }
+
+ @Override
+ public void valueChanged(ListSelectionEvent e) {
+ if (!e.getValueIsAdjusting()) {
+
+ ListSelectionModel selectionModel = (ListSelectionModel) e.getSource();
+
+ Integer selectionIndex = selectionModel.isSelectionEmpty() ? null : selectionModel.getMinSelectionIndex();
+
+ getModel().setFileModel(selectionIndex);
+ }
+ }
+
+ protected void afterSelectionChanged() {
+ U ui = getUi();
+ boolean hasNext = getModel().hasNextFile();
+ boolean hasPrevious = getModel().hasPreviousFile();
+ ui.getNextFile().setEnabled(hasNext);
+ ui.getPreviousFile().setEnabled(hasPrevious);
+ ui.getNextFile().setToolTipText(hasNext ? _("lutinvcs.action.nextfile.tip") : null);
+ ui.getPreviousFile().setToolTipText(hasPrevious ? _("lutinvcs.action.previousfile.tip") : null);
+ // always scroll to selected
+ Integer selectedRow = getModel().getFileIndex();
+ if (selectedRow != null) {
+ ui.getContentTable().scrollRectToVisible(ui.getContentTable().getCellRect(selectedRow, 0, true));
+ }
+ }
+
+ public void afterLocationChanged() {
+ if (getLocation() == VCSEntryLocation.UNKNOW) {
+ return;
+ }
+ if (getModel().getEntriesModel().getRowCount() > 0) {
+ // select first row
+ getSelectionModel().setSelectionInterval(0, 0);
+ } else {
+ // disable all actions
+ afterSelectionChanged();
+ }
+ }
+
+ public void gotoPreviousFile() {
+ Integer index = getModel().getFileIndex();
+ if (index != null && getModel().hasPreviousFile) {
+ getSelectionModel().setSelectionInterval(index - 1, index - 1);
+ }
+ }
+
+ public void gotoNextFile() {
+ Integer index = getModel().getFileIndex();
+ if (index != null && getModel().hasNextFile) {
+ getSelectionModel().setSelectionInterval(index + 1, index + 1);
+ }
+ }
+
+ protected void updateAction(EnumMap<VCSAction, Integer> actions, boolean hasActions, AbstractButton ui, VCSAction action, VCSEntry vcsEntry) {
+ super.updateAction(actions, hasActions, ui, action);
+ boolean useAction = hasActions && actions.containsKey(action) && actions.get(action) > 0;
+ String tip = null;
+ if (useAction) {
+ tip = _("lutinvcs.action.single.tip", action.getLibelle(), vcsEntry.getFile().getName());
+ }
+ ui.setToolTipText(tip);
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java (from rev 524, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractTabUIHandler.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractTabUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -0,0 +1,118 @@
+/**
+ * ##% 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.util.handler;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.ui.ChangelogUI;
+import org.codelutin.vcs.ui.ConfirmUI;
+import org.codelutin.vcs.ui.DiffUI;
+import org.codelutin.vcs.ui.VCSUIFactory;
+import org.codelutin.vcs.ui.util.AbstractTabUIModel;
+import org.codelutin.vcs.ui.util.AbstractTabUI;
+import org.codelutin.vcs.ui.util.AbstractVCSEntriesTableModel;
+
+import javax.swing.AbstractButton;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.TableModelListener;
+import java.beans.PropertyChangeEvent;
+import java.util.EnumMap;
+import java.util.List;
+
+/** @author chemit */
+public abstract class AbstractTabUIHandler<M extends AbstractTabUIModel, U extends AbstractTabUI<? extends AbstractTabUIHandler>> extends AbstractBasicUIHandler<M, U> implements TableModelListener {
+
+ protected AbstractTabUIHandler(U ui, M model,boolean useThreadListener) {
+ super(ui, model,useThreadListener);
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+ if (AbstractTabUIModel.LOCATION_PROPERTY_CHANGED.equals(action)) {
+ afterLocationChanged();
+ }
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ getUi().getContentTable().getModel().addTableModelListener(this);
+ }
+
+ protected abstract void afterLocationChanged();
+
+
+ protected void updateAction(EnumMap<VCSAction, Integer> actions, boolean hasActions, AbstractButton ui, VCSAction action) {
+ ui.setEnabled(hasActions && actions.containsKey(action) && actions.get(action) > 0);
+ }
+
+ public void showConfirmUI(VCSAction action, AbstractVCSEntriesTableModel model, List<VCSEntry> entries) {
+ ConfirmUI ui = VCSUIFactory.newConfirmUI();
+ if (log.isDebugEnabled()) {
+ log.debug("nb entries:" + entries.size());
+ }
+ ui.getHandler().getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
+ ui.getContentScroll().setEnabled(entries.size() > 1);
+ ui.setVisible(true);
+ }
+
+ public void showDiffUI(boolean useSelection, AbstractVCSEntriesTableModel model, List<VCSEntry> entries) {
+ DiffUI ui = VCSUIFactory.newDiffUI();
+ if (!useSelection) {
+ // take all entries
+ entries = model.filter(VCSAction.DIFF, model.getEntries());
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("nb entries:" + entries.size());
+ }
+ ui.getButton(model.getLocation()).setSelected(false);
+ ui.getHandler().getModel().init(model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
+ ui.getContentScroll().setEnabled(entries.size() > 1);
+ ui.setVisible(true);
+ }
+
+ public void showChangelogUI(boolean useSelection, AbstractVCSEntriesTableModel model, List<VCSEntry> entries) {
+ ChangelogUI ui = VCSUIFactory.newChangelogUI();
+ if (!useSelection) {
+ // take all entries
+ entries = model.filter(VCSAction.CHANGELOG, model.getEntries());
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("nb entries:" + entries.size());
+ }
+ ui.getHandler().getModel().init(model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
+ ui.getContentScroll().setEnabled(entries.size() > 1);
+ ui.setVisible(true);
+ }
+
+ public void doRefresh(AbstractVCSEntriesTableModel model, List<VCSEntry> entries, ListSelectionModel selectionModel) {
+ log.info(selectionModel);
+ selectionModel.clearSelection();
+ if (log.isDebugEnabled()) {
+ log.debug("nb entries:" + entries.size());
+ }
+ // do refresh of all states
+ try {
+ model.refresh(System.nanoTime(), entries);
+ } catch (VCSException e) {
+ log.error(e);
+ }
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java (from rev 530, trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java)
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java (rev 0)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/handler/AbstractUIHandler.java 2008-04-16 21:09:36 UTC (rev 531)
@@ -0,0 +1,30 @@
+/**
+ * ##% 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.util.handler;
+
+import org.codelutin.vcs.ui.util.AbstractUIModel;
+import org.codelutin.vcs.ui.util.AbstractUI;
+
+/**
+ * TODO Move this classe in jaxx
+ *
+ * @author chemit
+ */
+public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI<? extends AbstractUIHandler>> extends jaxx.DialogUIHandler<M, U> {
+
+ protected AbstractUIHandler(U ui, M model) {
+ super(ui, model);
+ }
+}
1
0
[Buix-commits] r530 - trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 21:07:57 +0000 (Wed, 16 Apr 2008)
New Revision: 530
Modified:
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java
trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java
Log:
using jaxx class
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java 2008-04-16 20:57:35 UTC (rev 529)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUI.java 2008-04-16 21:07:57 UTC (rev 530)
@@ -14,15 +14,6 @@
*/
package org.codelutin.vcs.ui.util;
-import org.codelutin.vcs.ui.action.HelpAction;
-import org.codelutin.vcs.ui.action.ShowConfigAction;
-
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.JDialog;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
/**
* A abstract dialog contract to be realised by a dialog
* <p/>
@@ -30,51 +21,13 @@
*
* @author chemit
*/
-public abstract class AbstractUI<H extends AbstractUIHandler> extends JDialog implements WindowListener {
+public abstract class AbstractUI<H extends AbstractUIHandler> extends jaxx.DialogUI<H> {
- private H handler;
-
- public abstract AbstractButton getHelp();
-
- protected AbstractUI() {
- UIHelper.setQuitAction(this);
- addWindowListener(this);
+ protected javax.swing.AbstractAction createHelpAction() {
+ return org.codelutin.vcs.ui.action.HelpAction.createAction(this);
}
- public H getHandler() {
- return handler;
+ protected javax.swing.AbstractAction createShowConfigAction() {
+ return org.codelutin.vcs.ui.action.ShowConfigAction.createAction(this);
}
-
- public void setHandler(H handler) {
- this.handler = handler;
- }
-
- protected AbstractAction createHelpAction() {
- return HelpAction.createAction(this);
- }
-
- protected AbstractAction createShowConfigAction() {
- return ShowConfigAction.createAction(this);
- }
-
- public void windowOpened(WindowEvent e) {
- }
-
- public void windowClosed(WindowEvent e) {
- }
-
- public void windowClosing(WindowEvent e) {
- }
-
- public void windowIconified(WindowEvent e) {
- }
-
- public void windowDeiconified(WindowEvent e) {
- }
-
- public void windowActivated(WindowEvent e) {
- }
-
- public void windowDeactivated(WindowEvent e) {
- }
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java 2008-04-16 20:57:35 UTC (rev 529)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIHandler.java 2008-04-16 21:07:57 UTC (rev 530)
@@ -14,47 +14,14 @@
*/
package org.codelutin.vcs.ui.util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.beans.PropertyChangeListener;
-
/**
* TODO Move this classe in jaxx
*
* @author chemit
*/
-public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI<? extends AbstractUIHandler>> implements PropertyChangeListener {
+public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI<? extends AbstractUIHandler>> extends jaxx.DialogUIHandler<M, U> {
- protected static Log log = LogFactory.getLog(AbstractUIHandler.class);
-
- /** ui handled */
- private U ui;
-
- /** model handled */
- private M model;
-
protected AbstractUIHandler(U ui, M model) {
- this.ui = ui;
- this.model = model;
+ super(ui, model);
}
-
- public final U getUi() {
- return ui;
- }
-
- public final M getModel() {
- return model;
- }
-
- public void init() {
- if (model == null) {
- throw new IllegalStateException("no model was defined for " + this);
- }
- model.addPropertyChangeListener(this);
- }
-
- public void dispose() {
- model.removePropertyChangeListener(this);
- }
}
Modified: trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java 2008-04-16 20:57:35 UTC (rev 529)
+++ trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui/util/AbstractUIModel.java 2008-04-16 21:07:57 UTC (rev 530)
@@ -14,77 +14,14 @@
*/
package org.codelutin.vcs.ui.util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import jaxx.DialogUIModel;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
/**
* TODO Move this classe in jaxx
* Abstract ui model, with property change support.
*
* @author chemit
*/
-public abstract class AbstractUIModel {
+public abstract class AbstractUIModel extends DialogUIModel {
- static protected final Log log = LogFactory.getLog(AbstractUIModel.class);
-
- /** support for change properties support */
- protected PropertyChangeSupport changeSupport;
-
- protected AbstractUIModel() {
-
- }
-
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (listener == null) {
- return;
- }
- if (changeSupport == null) {
- changeSupport = new PropertyChangeSupport(this);
- }
- changeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- if (listener == null) {
- return;
- }
- if (changeSupport == null) {
- changeSupport = new PropertyChangeSupport(this);
- }
- changeSupport.addPropertyChangeListener(listener);
- }
-
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- if (listener == null || changeSupport == null) {
- return;
- }
- changeSupport.removePropertyChangeListener(listener);
- }
-
- public synchronized void removePropertyChangeListeners() {
- if (changeSupport == null) {
- return;
- }
- for (PropertyChangeListener listener : getPropertyChangeListeners()) {
- changeSupport.removePropertyChangeListener(listener);
- }
- }
-
- public synchronized PropertyChangeListener[] getPropertyChangeListeners() {
- if (changeSupport == null) {
- return new PropertyChangeListener[0];
- }
- return changeSupport.getPropertyChangeListeners();
- }
-
- public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
- if (changeSupport == null || (oldValue == null && newValue == null) ||
- (oldValue != null && oldValue.equals(newValue))) {
- return;
- }
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
}
1
0
[Buix-commits] r529 - in trunk/jaxx: . src/main/java/jaxx
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 20:57:35 +0000 (Wed, 16 Apr 2008)
New Revision: 529
Added:
trunk/jaxx/src/main/java/jaxx/DialogUI.java
trunk/jaxx/src/main/java/jaxx/DialogUIHandler.java
trunk/jaxx/src/main/java/jaxx/DialogUIModel.java
Modified:
trunk/jaxx/changelog
Log:
add methods
Modified: trunk/jaxx/changelog
===================================================================
--- trunk/jaxx/changelog 2008-04-16 20:56:45 UTC (rev 528)
+++ trunk/jaxx/changelog 2008-04-16 20:57:35 UTC (rev 529)
@@ -1,3 +1,5 @@
+ver-1-0-6 chemit add dialogUI mini-framework 04-2008
+
ver-1-0-5 chemit clean code, migrate to java 1.5 01-2008
ver-1-0-4 chemit initial import from project jaxx-1.0.3-beta2 (svn:sourceforce rev 48) 01-2008
Added: trunk/jaxx/src/main/java/jaxx/DialogUI.java
===================================================================
--- trunk/jaxx/src/main/java/jaxx/DialogUI.java (rev 0)
+++ trunk/jaxx/src/main/java/jaxx/DialogUI.java 2008-04-16 20:57:35 UTC (rev 529)
@@ -0,0 +1,79 @@
+/**
+ * ##% 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 jaxx;
+
+import jaxx.runtime.UIHelper;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.ImageIcon;
+import javax.swing.JDialog;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+
+/**
+ * A abstract dialog contract to be realised by a dialogUI (WindowEvent adapter)
+ * <p/>
+ * TODO : make jaxx authorized implementing interface for root tag :)
+ *
+ * @author chemit
+ */
+public abstract class DialogUI<H extends DialogUIHandler> extends JDialog implements WindowListener {
+
+ private H handler;
+
+ public abstract AbstractButton getHelp();
+
+ //TODO will be handled by jaxx with javax.help...
+ protected abstract AbstractAction createHelpAction();
+
+ protected DialogUI() {
+ UIHelper.setQuitAction(this);
+ addWindowListener(this);
+ }
+
+ public H getHandler() {
+ return handler;
+ }
+
+ public void setHandler(H handler) {
+ this.handler = handler;
+ }
+
+ protected ImageIcon createActionIcon(String name) {
+ return UIHelper.createActionIcon(name);
+ }
+
+ public void windowOpened(WindowEvent e) {
+ }
+
+ public void windowClosed(WindowEvent e) {
+ }
+
+ public void windowClosing(WindowEvent e) {
+ }
+
+ public void windowIconified(WindowEvent e) {
+ }
+
+ public void windowDeiconified(WindowEvent e) {
+ }
+
+ public void windowActivated(WindowEvent e) {
+ }
+
+ public void windowDeactivated(WindowEvent e) {
+ }
+}
\ No newline at end of file
Added: trunk/jaxx/src/main/java/jaxx/DialogUIHandler.java
===================================================================
--- trunk/jaxx/src/main/java/jaxx/DialogUIHandler.java (rev 0)
+++ trunk/jaxx/src/main/java/jaxx/DialogUIHandler.java 2008-04-16 20:57:35 UTC (rev 529)
@@ -0,0 +1,60 @@
+/**
+ * ##% 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 jaxx;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.beans.PropertyChangeListener;
+
+/**
+ * DialogUI handler
+ *
+ * @author chemit
+ */
+public abstract class DialogUIHandler<M extends DialogUIModel, U extends DialogUI<? extends DialogUIHandler>> implements PropertyChangeListener {
+
+ protected static Log log = LogFactory.getLog(DialogUIHandler.class);
+
+ /** ui handled */
+ private U ui;
+
+ /** model handled */
+ private M model;
+
+ protected DialogUIHandler(U ui, M model) {
+ this.ui = ui;
+ this.model = model;
+ }
+
+ public U getUi() {
+ return ui;
+ }
+
+ public M getModel() {
+ return model;
+ }
+
+ public void init() {
+ if (model == null) {
+ throw new IllegalStateException("no model was defined for " + this);
+ }
+ model.addPropertyChangeListener(this);
+ }
+
+ public void dispose() {
+ model.removePropertyChangeListener(this);
+ }
+}
\ No newline at end of file
Added: trunk/jaxx/src/main/java/jaxx/DialogUIModel.java
===================================================================
--- trunk/jaxx/src/main/java/jaxx/DialogUIModel.java (rev 0)
+++ trunk/jaxx/src/main/java/jaxx/DialogUIModel.java 2008-04-16 20:57:35 UTC (rev 529)
@@ -0,0 +1,85 @@
+/**
+ * ##% 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 jaxx;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/**
+ * Abstract ui model, with property change support.
+ *
+ * @author chemit
+ */
+public abstract class DialogUIModel {
+
+ static protected final Log log = LogFactory.getLog(DialogUIModel.class);
+
+ /** support for change properties support */
+ protected PropertyChangeSupport changeSupport;
+
+ public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ if (listener == null) {
+ return;
+ }
+ if (changeSupport == null) {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+ changeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
+ if (listener == null) {
+ return;
+ }
+ if (changeSupport == null) {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+ changeSupport.addPropertyChangeListener(listener);
+ }
+
+ public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
+ if (listener == null || changeSupport == null) {
+ return;
+ }
+ changeSupport.removePropertyChangeListener(listener);
+ }
+
+ public synchronized void removePropertyChangeListeners() {
+ if (changeSupport == null) {
+ return;
+ }
+ for (PropertyChangeListener listener : getPropertyChangeListeners()) {
+ changeSupport.removePropertyChangeListener(listener);
+ }
+ }
+
+ public synchronized PropertyChangeListener[] getPropertyChangeListeners() {
+ if (changeSupport == null) {
+ return new PropertyChangeListener[0];
+ }
+ return changeSupport.getPropertyChangeListeners();
+ }
+
+ public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ if (changeSupport == null || (oldValue == null && newValue == null) ||
+ (oldValue != null && oldValue.equals(newValue))) {
+ return;
+ }
+ changeSupport.firePropertyChange(propertyName, oldValue, newValue);
+ }
+}
\ No newline at end of file
1
0
[Buix-commits] r528 - trunk/jaxx/src/main/java/jaxx/runtime
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
by tchemit@users.labs.libre-entreprise.org 16 Apr '08
16 Apr '08
Author: tchemit
Date: 2008-04-16 20:56:45 +0000 (Wed, 16 Apr 2008)
New Revision: 528
Modified:
trunk/jaxx/src/main/java/jaxx/runtime/UIHelper.java
Log:
add methods
Modified: trunk/jaxx/src/main/java/jaxx/runtime/UIHelper.java
===================================================================
--- trunk/jaxx/src/main/java/jaxx/runtime/UIHelper.java 2008-04-16 20:46:32 UTC (rev 527)
+++ trunk/jaxx/src/main/java/jaxx/runtime/UIHelper.java 2008-04-16 20:56:45 UTC (rev 528)
@@ -19,6 +19,13 @@
package jaxx.runtime;
import javax.swing.ImageIcon;
+import javax.swing.JDialog;
+import javax.swing.JRootPane;
+import javax.swing.Action;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+import java.awt.event.ActionEvent;
/** @author tony */
public class UIHelper {
@@ -32,4 +39,27 @@
}
}
+ /**
+ * Attach to <code>ui</code> an abort action,accessible by <code>ESC</code> key.
+ *
+ * @param ui ui
+ */
+ public static void setQuitAction(final JDialog ui) {
+ JRootPane rootPane = ui.getRootPane();
+
+ Action quitAction = new AbstractAction("quit") {
+ private static final long serialVersionUID = -869095664995763057L;
+
+ public void actionPerformed(ActionEvent e) {
+ ui.dispose();
+ }
+ };
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "quit");
+ rootPane.getActionMap().put("quit", quitAction);
+ }
+
+ public static ImageIcon createActionIcon(String name) {
+ return createImageIcon("action-" + name + ".png");
+ }
+
}
1
0