Author: tchemit Date: 2008-04-11 01:46:42 +0000 (Fri, 11 Apr 2008) New Revision: 441 Removed: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java Log: old Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,84 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui; - -import jaxx.runtime.swing.Table; -import org.codelutin.vcs.ui.model.AbstractUIModel; -import org.codelutin.vcs.ui.model.ConfirmUIModel; -import org.codelutin.vcs.ui.handler.ConfirmUIHandler; - -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JToolBar; - -/** @author chemit */ -public abstract class AbstractConfirmUI extends AbstractUI { - - public abstract JLabel getActionLabel(); - - public abstract Table getToolbar(); - - public abstract JToolBar getTool(); - - public abstract JLabel getActionCommitLabel(); - - public abstract JButton getLastMessages(); - - public abstract JScrollPane getCommitScroll(); - - public abstract JTextArea getCommitMessage(); - - public abstract JScrollPane getContent(); - - public abstract JTable getContentTable(); - - public abstract JButton getAccept(); - - - @Override - public ConfirmUIHandler getHandler() { - return (ConfirmUIHandler) super.getHandler(); - } - - @Override - public ConfirmUIModel getModel() { - return (ConfirmUIModel) super.getModel(); - } - - @Override - public void setModel(AbstractUIModel model) { - super.setModel(model); - getContentTable().setModel(model.getEntriesModel()); - } - - public void doAccept() { - getHandler().doAction(getCommitMessage().getText(), getModel().getEntriesModel()); - } - - @Override - public void setVisible(boolean b) { - if (b) { - getAccept().setEnabled(getModel().getEntriesModel().getRowCount() > 0); - } - super.setVisible(b); - } - - protected void showLastMessages() { - //TODO - } -} Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,87 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui; - -import org.codelutin.vcs.VCSEntry; -import org.codelutin.vcs.type.VCSAction; -import org.codelutin.vcs.ui.handler.DiffUIHandler; -import org.codelutin.vcs.ui.model.DiffUIModel; - -import javax.swing.AbstractButton; -import javax.swing.JButton; -import java.util.List; - -/** @author chemit */ -public abstract class AbstractDiffUI extends AbstractTabUI { - - public abstract JButton getNextDiff(); - - public abstract JButton getPreviousDiff(); - - public abstract JButton getRefresh(); - - public abstract JButton getUpdate(); - - public abstract JButton getCommit(); - - public abstract JButton getRevert(); - - public abstract JButton getDelete(); - - @Override - public DiffUIModel getModel() { - return (DiffUIModel) model; - } - - @Override - protected DiffUIHandler getHandler() { - return (DiffUIHandler) handler; - } - - public void selectFile() { - List<VCSEntry> vcsEntryList = model.getEntriesModel().getDisplayedEntries(getHandler().getSelectionModel()); - if (!vcsEntryList.isEmpty()) { - getModel().setFileModel(vcsEntryList.get(0)); - } else { - getModel().setFileModel(null); - } - } - - @Override - public void setVisible(boolean b) { - if (b) { - AbstractButton button = getButton(handler.getLocation()); - if (button == null) { - button = getAllTab(); - } - button.doClick(); - if (getTable(getModel().getEntriesModel().getLocation()).getRowCount() > 0) - getHandler().getSelectionModel().setSelectionInterval(0, 0); - } - super.setVisible(b); - } - - protected void doAction(VCSAction action) { - getHandler().doAction(action, getModel().getFileModel()); - } - - protected void gotoNextDiff() { - getHandler().gotoNextDiff(); - } - - protected void gotoPreviousDiff() { - getHandler().gotoPreviousDiff(); - } -} Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,87 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui; - -import org.codelutin.vcs.type.VCSAction; -import org.codelutin.vcs.type.VCSEntryLocation; -import org.codelutin.vcs.ui.handler.SynchUIHandler; -import org.codelutin.vcs.ui.model.SynchUIModel; - -import javax.swing.JButton; -import javax.swing.AbstractButton; - -/** @author chemit */ -public abstract class AbstractSynchUI extends AbstractTabUI { - - public abstract JButton getRefreshAll(); - - public abstract JButton getDiffAll(); - - public abstract JButton getUpdateAll(); - - public abstract JButton getCommitAll(); - - public abstract JButton getRevertAll(); - - public abstract JButton getDeleteAll(); - - public abstract AbstractVCSPopup getAllPopup(); - - public abstract AbstractVCSPopup getLocalPopup(); - - public abstract AbstractVCSPopup getRemotePopup(); - - - @Override - public SynchUIModel getModel() { - return (SynchUIModel) model; - } - - @Override - protected SynchUIHandler getHandler() { - return (SynchUIHandler) handler; - } - - @Override - public void setVisible(boolean b) { - if (b) { - AbstractButton button = getButton(handler.getLocation()); - if (button == null) { - button = getAllTab(); - } - button.doClick(); - } - super.setVisible(b); - } - - public AbstractVCSPopup getPopup(VCSEntryLocation modelName) { - switch (modelName) { - case ALL: - return getAllPopup(); - case LOCAL: - return getLocalPopup(); - case REMOTE: - return getRemotePopup(); - case UNKNOW: - break; - } - throw new IllegalStateException("no popup found for " + modelName); - } - - - protected void doAction(VCSAction action, boolean useSelection) { - getHandler().doAction(action, useSelection); - } -} \ No newline at end of file Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,50 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui; - -import org.codelutin.vcs.type.VCSAction; - -import javax.swing.AbstractAction; -import javax.swing.JMenuItem; -import java.awt.event.ActionEvent; - -/** @author chemit */ -public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu { - - protected AbstractAction dispatchAction; - - public abstract JMenuItem getRefresh(); - - public abstract JMenuItem getDiff(); - - public abstract JMenuItem getUpdate(); - - public abstract JMenuItem getCommit(); - - public abstract JMenuItem getRevert(); - - public abstract JMenuItem getDelete(); - - public void setDispatchAction(javax.swing.AbstractAction action) { - this.dispatchAction = action; - } - - protected void doAction(VCSAction action, JMenuItem item) { - //dispatchAction.setAction(action); - ActionEvent e = new ActionEvent(item, 1, action.name()); - dispatchAction.actionPerformed(e); - } - -} Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -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.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 AbstractUIModel { - - 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/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,114 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.model; - -import org.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 java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.List; - -/** @author chemit */ -public abstract class AbstractUIModel { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static protected final Log log = LogFactory.getLog(AbstractUIModel.class); - - - /** support for change properties support */ - protected PropertyChangeSupport changeSupport; - - protected final AbstractVCSEntriesTableModel entriesModel; - - protected AbstractUIModel() { - 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, relativeLocalPaths, location, System.nanoTime()); - } - - public void populate(VCSEntryLocation location, VCSEntry[] datas) { - getEntriesModel().populate(location, datas); - } - - public void refresh(List<VCSEntry> entries) { - getEntriesModel().refresh(entries, System.nanoTime()); - } - - 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); - } -} Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,187 +0,0 @@ -/* -* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin, -* Benjamin Poussin, Tony Chemit -* -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* ##% */ -package org.codelutin.vcs.ui.model; - -import static org.codelutin.i18n.I18n._; -import org.codelutin.vcs.VCSConnexion; -import org.codelutin.vcs.VCSEntries; -import org.codelutin.vcs.VCSEntry; -import org.codelutin.vcs.VCSException; -import org.codelutin.vcs.type.VCSAction; -import org.codelutin.vcs.type.VCSEntryLocation; -import org.codelutin.vcs.type.VCSState; -import org.codelutin.vcs.util.VCSEntriesImpl; - -import javax.swing.ListSelectionModel; -import java.util.ArrayList; -import java.util.List; - -/** - * Simple Table model to display list of VCSFileState - * - * @author chemit - */ -public abstract class AbstractVCSEntriesTableModel extends javax.swing.table.AbstractTableModel implements VCSEntries { - - protected final String name; - - /** column names */ - protected final String[] columnNames; - - protected VCSEntryLocation location; - - /** delegate model */ - protected final transient VCSEntries delegate; - - /** displayed entries */ - protected final transient List<VCSEntry> displayedEntries; - - private static final long serialVersionUID = 4697917831388337369L; - - protected AbstractVCSEntriesTableModel(String name, String[] columnNames) { - super(); - this.name = name; - this.columnNames = columnNames; - this.displayedEntries = new ArrayList<VCSEntry>(); - this.delegate = new VCSEntriesImpl(); - } - - public String getName() { - return name; - } - - public VCSEntryLocation getLocation() { - return location; - } - - public List<VCSEntry> getDisplayedEntries(ListSelectionModel selectionModel) { - return selectionModel == null ? new ArrayList<VCSEntry>(displayedEntries) : filter(selectionModel, displayedEntries); - } - - public int getColumnCount() { - return columnNames.length; - } - - public int getRowCount() { - return displayedEntries.size(); - } - - @Override - public String getColumnName(int columnIndex) { - return _(columnNames[columnIndex]); - } - - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - // read only data - return false; - } - - @Override - public void setValueAt(Object aValue, int rowIndex, int columnIndex) { - // read only data - } - - public void setLocation(VCSEntryLocation location) { - this.location = location; - displayedEntries.clear(); - displayedEntries.addAll(filter(location, getEntries())); - fireTableDataChanged(); - } - - public VCSAction[] getActions(ListSelectionModel selectionModel) { - return getActions(getDisplayedEntries(selectionModel)); - } - - @Override - public String toString() { - return super.toString() + "<name:" + name + ", size:" + (getRowCount()) + '>'; - } - - //===================================================================================================// - // === delegate methods =============================================================================// - //===================================================================================================// - - public List<VCSEntry> getEntries() { - return delegate.getEntries(); - } - - public List<VCSEntry> filter(VCSAction action, List<VCSEntry> entries) { - return delegate.filter(action, entries); - } - - public List<VCSEntry> filter(VCSConnexion connexion, List<VCSEntry> entries) { - return delegate.filter(connexion, entries); - } - - public List<VCSEntry> filter(VCSEntryLocation location, List<VCSEntry> entries) { - return delegate.filter(location, entries); - } - - public List<VCSEntry> filter(VCSState state, List<VCSEntry> entries) { - return delegate.filter(state, entries); - } - - public List<VCSEntry> filter(ListSelectionModel selectionModel, List<VCSEntry> entries) { - return delegate.filter(selectionModel, entries); - } - - public void populate(VCSConnexion connexion, long timestamp) throws VCSException { - delegate.populate(connexion, timestamp); - updateEntries(); - } - - public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location, long timestamp) throws VCSException { - delegate.populate(connexion, relativeLocalPaths, location, timestamp); - updateEntries(); - } - - public void populate(VCSEntryLocation location, VCSEntry[] states) { - clear(); - this.location = location; - delegate.populate(location, states); - updateEntries(); - } - - public void refresh(List<VCSEntry> entries, long timestamp) throws IllegalStateException { - delegate.refresh(entries, timestamp); - updateEntries(); - } - - public VCSAction[] getActions(List<VCSEntry> entries) { - return delegate.getActions(entries); - } - - public VCSState[] getStates(List<VCSEntry> entries) { - return delegate.getStates(entries); - } - - public void clear() { - delegate.clear(); - displayedEntries.clear(); - fireTableDataChanged(); - } - - protected void updateEntries() { - displayedEntries.clear(); - displayedEntries.addAll(filter(location, delegate.getEntries())); - fireTableDataChanged(); - } -} \ No newline at end of file Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,70 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.model; - -import org.codelutin.vcs.VCSEntry; -import org.codelutin.vcs.type.VCSAction; -import org.codelutin.vcs.type.VCSEntryLocation; - -import java.util.ArrayList; -import java.util.List; - -/** - * Model of a a confirmation of action on entries (single type of action possible) - * - * @author chemit - */ -public class ConfirmUIModel extends AbstractUIModel { - - /** history of commit messages */ - protected List<String> commitMessages; - - /** current action to be fired */ - protected VCSAction action; - public static final String ACCEPT_PROPERTY_CHANGED = "action"; - public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage"; - - public List<String> getCommitMessages() { - if (commitMessages == null) { - commitMessages = new ArrayList<String>(); - } - return commitMessages; - } - - public VCSAction getAction() { - return action; - } - - public void addCommitMessage(String commitMessage) { - if (commitMessage != null && !commitMessage.isEmpty() && !getCommitMessages().contains(commitMessage)) { - // add message in history - getCommitMessages().add(commitMessage); - firePropertyChange(MESSAGE_HISTORY_PROPERTY_CHANGED, null, commitMessage); - } - } - - public void init(VCSAction action, VCSEntryLocation location, VCSEntry[] states) { - getEntriesModel().clear(); - getEntriesModel().populate(location, states); - setAction(action); - } - - public void setAction(VCSAction action) { - this.action = action; - // null oldValue to ensure propagation of changed - firePropertyChange(ACCEPT_PROPERTY_CHANGED, null, action); - } - -} \ No newline at end of file Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,156 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.model; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.vcs.VCSEntry; -import org.codelutin.vcs.VCSHandler; -import org.codelutin.vcs.type.VCSAction; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.net.URL; - -/** - * Model of a diff panel (remote content vs local content - * - * @author chemit - */ -public class DiffPanelUIModel { - - static protected final Log log = LogFactory.getLog(DiffPanelUIModel.class); - - /** local root : wroking copy */ - protected URL leftRoot; - - /** remote root : remote url */ - protected URL rightRoot; - - /** vcs handler to use (lazy instanciation) */ - protected VCSHandler handler; - - /** map of models */ - protected VCSEntry model; - - /** support for change properties support */ - protected PropertyChangeSupport changeSupport; - - /** local content */ - protected String leftContent; - - /** remote content */ - protected String rightContent; - - /** current action to fired */ - protected VCSAction action; - - public DiffPanelUIModel() { - } - - public DiffPanelUIModel(VCSHandler handler, URL leftRoot, URL rightRoot) { - this.handler = handler; - this.leftRoot = leftRoot; - this.rightRoot = rightRoot; - } - - public VCSHandler getHandler() { - return handler; - } - - public URL getLeftRoot() { - return leftRoot; - } - - public URL getRightRoot() { - return rightRoot; - } - - public String getLeftContent() { - return leftContent; - } - - public String getRightContent() { - return rightContent; - } - - public void setLeftContent(String leftContent) { - this.leftContent = leftContent; - } - - public void setLeftRoot(URL leftRoot) { - this.leftRoot = leftRoot; - } - - public void setRightContent(String rightContent) { - this.rightContent = rightContent; - } - - public void setRightRoot(URL rightRoot) { - this.rightRoot = rightRoot; - } - - public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { - if (listener == null) { - return; - } - if (changeSupport == null) { - changeSupport = new PropertyChangeSupport(this); - } - changeSupport.addPropertyChangeListener(propertyName, listener); - } - - public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { - if (listener == null) { - return; - } - if (changeSupport == null) { - changeSupport = new PropertyChangeSupport(this); - } - changeSupport.addPropertyChangeListener(listener); - } - - public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { - if (listener == null || changeSupport == null) { - return; - } - changeSupport.removePropertyChangeListener(listener); - } - - public synchronized void removePropertyChangeListeners() { - if (changeSupport == null) { - return; - } - for (PropertyChangeListener listener : getPropertyChangeListeners()) { - changeSupport.removePropertyChangeListener(listener); - } - } - - public synchronized PropertyChangeListener[] getPropertyChangeListeners() { - if (changeSupport == null) { - return new PropertyChangeListener[0]; - } - return changeSupport.getPropertyChangeListeners(); - } - - public void firePropertyChange(String propertyName, Object oldValue, Object newValue) { - if (changeSupport == null || (oldValue == null && newValue == null) || - (oldValue != null && oldValue.equals(newValue))) { - return; - } - changeSupport.firePropertyChange(propertyName, oldValue, newValue); - } - -} \ No newline at end of file Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,48 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.model; - -import org.codelutin.vcs.VCSEntry; -import org.codelutin.vcs.type.VCSEntryLocation; - -/** - * Model of a repository - * - * @author chemit - */ -public class DiffUIModel extends AbstractTabUIModel { - - public static final String FILE_PROPERTY_CHANGED = "file"; - - /** current file displayed */ - protected VCSEntry fileModel; - - public void setFileModel(VCSEntry fileModel) { - VCSEntry oldFileModel = this.fileModel; - this.fileModel = fileModel; - firePropertyChange(FILE_PROPERTY_CHANGED, oldFileModel, fileModel); - } - - public VCSEntry getFileModel() { - return fileModel; - } - - public void init(VCSEntryLocation location, VCSEntry[] states) { - getEntriesModel().clear(); - getEntriesModel().populate(VCSEntryLocation.ALL, states); - setFileModel(null); - setLocation(location); - } -} \ No newline at end of file Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,57 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.model; - -import org.codelutin.vcs.VCSEntry; -import org.codelutin.vcs.type.VCSState; - -/** @author chemit */ -public class SimpleVCSEntriesTableModelImpl extends AbstractVCSEntriesTableModel { - - private static final long serialVersionUID = -6397327068709720165L; - - /** columns names for a simple table model with module, file and status */ - public static final String[] SIMPLE_COLUMNS_NAMES = new String[]{ - org.codelutin.i18n.I18n.n_("lutinvcs.module"), - org.codelutin.i18n.I18n.n_("lutinvcs.file"), - org.codelutin.i18n.I18n.n_("lutinvcs.status") - }; - - public SimpleVCSEntriesTableModelImpl(String name) { - super(name, SIMPLE_COLUMNS_NAMES); - } - - public Object getValueAt(int rowIndex, int columnIndex) { - if (getRowCount() == 0) { - return null; - } - VCSEntry item = displayedEntries.get(rowIndex); - Object result = null; - if (columnIndex == 0) { - // get module - result = item.getRelativeLocalPath(); - } else if (columnIndex == 1) { - // get file - result = item.getFile().getName(); - } else if (columnIndex == 2) { - // get status - VCSState state = item.getState(); - result = state == null ? null : state.libelle(); - } - return result; - } - - -} Deleted: trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java =================================================================== --- trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 23:12:13 UTC (rev 440) +++ trunk/lutinvcs/lutinvcs-ui-common/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-11 01:46:42 UTC (rev 441) @@ -1,25 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs.ui.model; - -/** - * Model of a repository - * - * @author chemit - */ -public class SynchUIModel extends AbstractTabUIModel { - - -}