[Buix-commits] r532 - in trunk/lutinvcs/ui/common/src/main/java/org/codelutin/vcs/ui: . action model util util/model util/ui
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); + } +}
participants (1)
-
tchemit@users.labs.libre-entreprise.org