[Buix-commits] r311 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action
Author: tchemit Date: 2008-04-03 17:12:08 +0000 (Thu, 03 Apr 2008) New Revision: 311 Removed: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java Log: move to handler package Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java =================================================================== --- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 17:12:00 UTC (rev 310) +++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 17:12:08 UTC (rev 311) @@ -1,59 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.action; - -import org.codelutin.vcs.VCSAction; -import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel; -import org.codelutin.vcs.ui.model.SynchUIModel; - -import java.beans.PropertyChangeEvent; - -/** @author chemit */ -public abstract class AbstractSynchUIHandler extends AbstractUIHandler<SynchUIModel> { - - public void propertyChange(PropertyChangeEvent evt) { - //if (log.isDebugEnabled()) { - log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue()); - //} - String action = evt.getPropertyName(); - SimpleVCSFileStatesModel model = (SimpleVCSFileStatesModel) evt.getNewValue(); - if (SynchUIModel.TAB_PROPERTY_CHANGED.equals(action)) { - doSelectTabAction(model); - } else if (action.endsWith("All")) { - try { - String actionName = action.substring(0, action.length() - 3); - VCSAction vcsAction = VCSAction.valueOf(actionName.toUpperCase()); - doAllAction(vcsAction, model); - } catch (IllegalArgumentException e) { - // ignore it ? - } - } else { - try { - VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase()); - doSelectAction(vcsAction, model); - } catch (IllegalArgumentException e) { - // ignore it ? - } - - } - } - - public abstract void doSelectAction(VCSAction action, SimpleVCSFileStatesModel model); - - public abstract void doAllAction(VCSAction action, SimpleVCSFileStatesModel model); - - public abstract void doSelectTabAction(SimpleVCSFileStatesModel action); - -} Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java =================================================================== --- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java 2008-04-03 17:12:00 UTC (rev 310) +++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java 2008-04-03 17:12:08 UTC (rev 311) @@ -1,42 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.action; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.vcs.ui.model.AbstractUIModel; - -import javax.swing.ListSelectionModel; -import javax.swing.JDialog; -import java.beans.PropertyChangeListener; - -/** @author chemit */ -public abstract class AbstractUIHandler<M extends AbstractUIModel> implements PropertyChangeListener { - - protected static Log log = LogFactory.getLog(AbstractConfirmUIHandler.class); - - public abstract M getModel(); - - public abstract JDialog getUi(); - - public abstract ListSelectionModel getSelectionModel(); - - public void init() { - if (getModel() == null) { - throw new IllegalStateException("no model was defined for " + this); - } - getModel().addPropertyChangeListener(this); - } -}
participants (1)
-
tchemit@users.labs.libre-entreprise.org