Jaxx-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- 3898 discussions
[Buix-commits] r407 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 15:16:51 +0000 (Sun, 06 Apr 2008)
New Revision: 407
Removed:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
Log:
improve ui design
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -45,7 +45,7 @@
VCSAction action = ui.getModel().getAction();
ui.getAccept().setText(action.getLibelle());
ui.getToolbar().setVisible(action.isCommit());
- ui.getHandler().getSelectionModel().setSelectionInterval(0, getModel().getModel().getRowCount() - 1);
+ ui.getHandler().getSelectionModel().setSelectionInterval(0, getModel().getEntriesModel().getRowCount() - 1);
}
protected void updateMessageUI() {
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -4,11 +4,13 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
+import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@@ -32,7 +34,15 @@
}
public void doAllAction(VCSAction action) {
- AbstractVCSEntriesTableModel model = getModel().getModel();
+ doAction(action, false);
+ }
+
+ public void doSelectAction(VCSAction action) {
+ doAction(action, true);
+ }
+
+ public void doAction(VCSAction action, boolean useSelection) {
+ AbstractVCSEntriesTableModel model = getModel().getEntriesModel();
log.info(action + " : " + model);
ListSelectionModel selectionModel = getSelectionModel();
if (action == VCSAction.REFRESH) {
@@ -41,7 +51,7 @@
log.info("refresh :" + model.getRowCount());
model.refresh(model.getEntries(), System.nanoTime());
} else {
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(null));
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(useSelection ? selectionModel : null));
if (entries.isEmpty()) {
// nothing to do
return;
@@ -63,11 +73,18 @@
protected void initTab(VCSEntryLocation location) {
JTable table = getUi().getTable(location);
- AbstractVCSEntriesTableModel fileStatesModel = getModel().getModel();
+ AbstractVCSEntriesTableModel fileStatesModel = getModel().getEntriesModel();
table.setModel(fileStatesModel);
table.addMouseListener(new ListMouseListener(ui, fileStatesModel, location));
AbstractVCSPopup jvcsPopup = getUi().getPopup(location);
- jvcsPopup.setDispatchAction(new VCSPopupAction(ui, location));
+ //jvcsPopup.setDispatchAction(new VCSPopupAction(this, location));
+ jvcsPopup.setDispatchAction(new VCSAbsractAction() {
+ private static final long serialVersionUID = 8622118724992019898L;
+
+ public void actionPerformed(ActionEvent e) {
+ doSelectAction(action);
+ }
+ });
}
protected static class ListMouseListener extends MouseAdapter {
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -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;
-
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-import java.util.List;
-
-/**
- * Action of a clik inside the popup menu
- *
- * @author chemit
- */
-public class VCSPopupAction extends VCSAbsractAction {
- private static final long serialVersionUID = -1983061535956510913L;
-
- protected VCSEntryLocation location;
- protected transient ListSelectionModel selectionModel;
-
- protected transient AbstractTabUI ui;
-
- protected AbstractVCSEntriesTableModel tableModel;
-
- public VCSPopupAction(AbstractTabUI ui, VCSEntryLocation location) {
- super();
- this.ui = ui;
- this.location = location;
- //this.selectionModel = ui.getHandler().getSelectionModel();
- this.selectionModel = ui.getTable(location).getSelectionModel();
- tableModel = ui.getModel().getModel();
- }
-
- public void actionPerformed(ActionEvent e) {
- // select only lines for this action inside already selected lines
- List<VCSEntry> entries = tableModel.filter(action, tableModel.getDisplayedEntries(selectionModel));
- log.info("action: " + action + ", files to treate :" + entries.size() + " " + selectionModel);
- if (action == VCSAction.DIFF) {
- // show diff ui
- ui.getModel().refresh(entries);
-
- } else if (action == VCSAction.REFRESH) {
- // refresh ui, and update list if needed
-
- } else {
- // show confirm action ui
- AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
- confirmUI.getModel().init(action, tableModel.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
- confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, entries.size() - 1);
- confirmUI.setVisible(true);
- }
- }
-}
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 15:16:51 UTC (rev 407)
@@ -2,12 +2,9 @@
resizable='false' height='300' width='400'>
<style source="common.css"/>
<script>
- import org.codelutin.vcs.type.VCSAction;
-
public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
super(handler);
}
-
</script>
<Table>
<row fill='both'>
@@ -27,8 +24,7 @@
<cell fill='both'/>
</row>
</Table>
- <JButton id='lastMessages'
- toolTipText="lutinvcs.action.tooltip.lastMessages"
+ <JButton id='lastMessages' toolTipText="lutinvcs.action.tooltip.lastMessages"
icon='{createImageIcon("recent_msgs.png")}'
onActionPerformed='showLastMessages()'/>
</JToolBar>
@@ -48,7 +44,7 @@
<row>
<cell fill='both' weightx='1' weighty='1'>
<JScrollPane id='content' styleClass='confirmScroll'>
- <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getModel()}"/>
+ <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getEntriesModel()}"/>
</JScrollPane>
</cell>
</row>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 15:16:51 UTC (rev 407)
@@ -60,17 +60,14 @@
<row fill='both'>
<cell fill='both' weighty='1' weightx='2'>
<JPanel id='preview' layout='{cardLayout}'>
- <JScrollPane id='allContent' styleClass='diffScroll' constraints='"modelSynchAll"'>
- <JTable id="allTable" styleClass='diffTable'
- onMouseClicked="selectFile(allTable)"/>
+ <JScrollPane id='allContent' styleClass='diffScroll' constraints='"taball"'>
+ <JTable id="allTable" styleClass='diffTable' onMouseClicked="selectFile()"/>
</JScrollPane>
- <JScrollPane id='localContent' styleClass='diffScroll' constraints='"modelSynchLocal"'>
- <JTable id="localTable" styleClass='diffTable'
- onMouseClicked="selectFile(localTable)"/>
+ <JScrollPane id='localContent' styleClass='diffScroll' constraints='"tablocal"'>
+ <JTable id="localTable" styleClass='diffTable' onMouseClicked="selectFile()"/>
</JScrollPane>
- <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"modelSynchRemote"'
- onMouseClicked="selectFile(remoteTable)">
- <JTable id="remoteTable" styleClass='diffTable'/>
+ <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"tabremote"'>
+ <JTable id="remoteTable" styleClass='diffTable' onMouseClicked="selectFile()"/>
</JScrollPane>
</JPanel>
</cell>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 15:16:51 UTC (rev 407)
@@ -1,5 +1,4 @@
-<AbstractSynchUI title='lutinvcs.synch.title' modal="true" id='synchui'
- defaultCloseOperation='DISPOSE_ON_CLOSE'>
+<AbstractSynchUI title='lutinvcs.synch.title' modal="true" defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
@@ -8,65 +7,66 @@
public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
super(handler);
}
- //add(table);
</script>
<java.awt.CardLayout id='cardLayout'/>
+ <JVCSPopup id="allPopup"/>
+ <JVCSPopup id="localPopup"/>
+ <JVCSPopup id="remotePopup"/>
<Table id='table'>
<row fill='both'>
<cell fill='both' weightx='1'>
<JToolBar>
- <!--JPopupMenu enabled='false'/-->
- <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
+
<JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
+
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local'
mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local"
onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
+
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote'
mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote"
onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
<JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll"
icon='{createImageIcon("autoRefresh.png")}'
- onActionPerformed='doAllAction(VCSAction.REFRESH)'/>
+ onActionPerformed='doAction(VCSAction.REFRESH,false)'/>
<JButton id='diffAll' toolTipText="lutinvcs.action.tooltip.diffAll"
- icon='{createImageIcon("diff.png")}' onActionPerformed='doAllAction(VCSAction.DIFF)'/>
+ icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,false)'/>
<JButton id='updateAll' toolTipText="lutinvcs.action.tooltip.updateAll"
icon='{createImageIcon("update.png")}'
- onActionPerformed='doAllAction(VCSAction.UPDATE)'/>
+ onActionPerformed='doAction(VCSAction.UPDATE,false)'/>
<JButton id='commitAll' toolTipText="lutinvcs.action.tooltip.commitAll"
icon='{createImageIcon("commit.png")}'
- onActionPerformed='doAllAction(VCSAction.COMMIT)'/>
+ onActionPerformed='doAction(VCSAction.COMMIT,false)'/>
<JButton id='revertAll' toolTipText="lutinvcs.action.tooltip.revertAll"
icon='{createImageIcon("rollback.png")}'
- onActionPerformed='doAllAction(VCSAction.REVERT)'/>
+ onActionPerformed='doAction(VCSAction.REVERT,false)'/>
<JButton id='deleteAll' toolTipText="lutinvcs.action.tooltip.deleteAll"
icon='{createImageIcon("remove.png")}'
- onActionPerformed='doAllAction(VCSAction.DELETE)'/>
+ onActionPerformed='doAction(VCSAction.DELETE,false)'/>
</JToolBar>
</cell>
</row>
<row fill='both'>
<cell fill='both' weighty='1' weightx='2'>
<JPanel id='preview' layout='{cardLayout}'>
- <JScrollPane id='allContent' styleClass='updateScroll' constraints='"modelSynchAll"'>
+ <JScrollPane id='allContent' styleClass='updateScroll' constraints='"taball"'>
<JTable id="allTable" styleClass='updateTable'/>
</JScrollPane>
- <JScrollPane id='localContent' styleClass='updateScroll' constraints='"modelSynchLocal"'>
+ <JScrollPane id='localContent' styleClass='updateScroll' constraints='"tablocal"'>
<JTable id="localTable" styleClass='updateTable'/>
</JScrollPane>
- <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"modelSynchRemote"'>
+ <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"tabremote"'>
<JTable id="remoteTable" styleClass='updateTable'/>
</JScrollPane>
</JPanel>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,8 +16,6 @@
import jaxx.runtime.swing.Table;
import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
-import org.codelutin.vcs.ui.handler.AbstractUIHandler;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
import javax.swing.JButton;
@@ -68,10 +66,18 @@
}
public void doAccept() {
- getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
+ getHandler().doAction(getCommitMessage().getText(), getModel().getEntriesModel());
}
protected void showLastMessages() {
}
+
+ @Override
+ public void setVisible(boolean b) {
+ if (b) {
+ getAccept().setEnabled(getModel().getEntriesModel().getRowCount() > 0);
+ }
+ super.setVisible(b);
+ }
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -20,7 +20,6 @@
import org.codelutin.vcs.ui.model.DiffUIModel;
import javax.swing.JButton;
-import javax.swing.JTable;
/** @author chemit */
public abstract class AbstractDiffUI extends AbstractTabUI {
@@ -37,16 +36,18 @@
super(handler, new DiffUIModel());
}
+ @Override
public DiffUIModel getModel() {
return (DiffUIModel) model;
}
+ @Override
protected AbstractDiffUIHandler getHandler() {
return (AbstractDiffUIHandler) handler;
}
- protected void selectFile(JTable table) {
- getModel().setFileModel(model.getModel().getDisplayedEntries(table.getSelectionModel()).get(0));
+ protected void selectFile() {
+ getModel().setFileModel(model.getEntriesModel().getDisplayedEntries(getHandler().getSelectionModel()).get(0));
}
protected void doAction(VCSAction action) {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -20,7 +20,6 @@
import org.codelutin.vcs.ui.model.SynchUIModel;
import javax.swing.JButton;
-import java.awt.CardLayout;
/** @author chemit */
public abstract class AbstractSynchUI extends AbstractTabUI {
@@ -52,18 +51,16 @@
super(handler, new SynchUIModel());
}
+ @Override
public SynchUIModel getModel() {
return (SynchUIModel) model;
}
+ @Override
protected AbstractSynchUIHandler getHandler() {
return (AbstractSynchUIHandler) handler;
}
- protected void doAllAction(VCSAction action) {
- getModel().doAllAction(action);
- }
-
public AbstractVCSPopup getPopup(VCSEntryLocation modelName) {
switch (modelName) {
case ALL:
@@ -77,4 +74,8 @@
}
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
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -49,15 +49,14 @@
public abstract CardLayout getCardLayout();
- public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
- super(handler, model);
- }
-
public AbstractTabUI() {
- // for jaxx but never used
super();
}
+ public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
+ super(handler, model);
+ }
+
public AbstractTabUIModel getModel() {
return (AbstractTabUIModel) model;
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -14,8 +14,8 @@
*/
package org.codelutin.vcs.ui;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.type.VCSAction;
import javax.swing.JMenuItem;
import java.awt.event.ActionEvent;
@@ -46,4 +46,5 @@
ActionEvent e = new ActionEvent(item, 1, action.name());
dispatchAction.actionPerformed(e);
}
+
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -14,11 +14,11 @@
*/
package org.codelutin.vcs.ui;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JRootPane;
-import javax.swing.Action;
-import javax.swing.AbstractAction;
-import javax.swing.JComponent;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
@@ -28,9 +28,9 @@
* @author chemit
*/
public class UIHelper {
+
public static void setQuitAction(final JDialog ui) {
JRootPane rootPane = ui.getRootPane();
- //rootPane.setDefaultButton(accept);
Action quitAction = new AbstractAction("quit") {
private static final long serialVersionUID = -869095664995763057L;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -34,6 +34,7 @@
TagManager.registerDefaultNamespace("AbstractSynchUI", "org.codelutin.vcs.ui.*");
TagManager.registerDefaultNamespace("AbstractDiffUI", "org.codelutin.vcs.ui.*");
TagManager.registerDefaultNamespace("AbstractVCSPopup", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("JVCSPopup", "org.codelutin.vcs.ui.*");
}
}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -1,67 +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 static org.codelutin.i18n.I18n.n_;
-
-/** @author chemit */
-public class VCSUIConstants {
-
- /** columns names for a simple table model with module, file and status */
- public static final String[] SIMPLE_COLUMNS_NAMES = new String[]{
- n_("lutinvcs.module"),
- n_("lutinvcs.file"),
- n_("lutinvcs.status")
- };
-
- /** model name for synchronize ui */
- public static final String SYNCH_MODEL_PROPERTY = "modelSynch";
-
- /** model name for confirm ui */
- public static final String CONFIRM_MODEL_PROPERTY = "modelConfirm";
-
- /** model name for diff ui */
- public static final String DIFF_MODEL_PROPERTY = "modelConfirm";
-
- public static final String ACTION_PROPERTY_CHANGED = "action";
-
- public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage";
-
- public static final String FILE_PROPERTY_CHANGED = "file";
-
- public static final String NEXT_DIFF_PROPERTY_CHANGED = "nextDiff";
-
- public static final String PREVIOUS_DIFF_PROPERTY_CHANGED = "previousDiff";
-
- public static final String REFRESH_PROPERTY_CHANGED = "refresh";
-
- public static final String TAB_PROPERTY_CHANGED = "tab";
-
- public static final String DIFF_ALL_PROPERTY_CHANGED = "diffAll";
-
- public static final String COMMIT_ALL_PROPERTY_CHANGED = "commitAll";
-
- public static final String UPDATE_ALL_PROPERTY_CHANGED = "updateAll";
-
- public static final String REVERT_ALL_PROPERTY_CHANGED = "revertAll";
-
- public static final String DIFF_PROPERTY_CHANGED = "diff";
-
- public static final String COMMIT_PROPERTY_CHANGED = "commit";
-
- public static final String UPDATE_PROPERTY_CHANGED = "update";
-
- public static final String REVERT_PROPERTY_CHANGED = "revert";
-}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -17,7 +17,6 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.AbstractUI;
-import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
@@ -41,12 +40,12 @@
}
String action = evt.getPropertyName();
- if (VCSUIConstants.ACTION_PROPERTY_CHANGED.equals(action)) {
+ if (ConfirmUIModel.ACCEPT_PROPERTY_CHANGED.equals(action)) {
updateUI();
return;
}
- if (VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ if (ConfirmUIModel.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
updateMessageUI();
return;
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -18,7 +18,6 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.AbstractDiffUI;
-import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.DiffUIModel;
import java.beans.PropertyChangeEvent;
@@ -32,7 +31,7 @@
//}
String action = evt.getPropertyName();
- if (VCSUIConstants.FILE_PROPERTY_CHANGED.equals(action)) {
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
doSelectFile((VCSEntry) evt.getNewValue());
} else {
super.propertyChange(evt);
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -26,13 +26,13 @@
/** @author chemit */
public abstract class AbstractSynchUIHandler<U extends AbstractSynchUI> extends AbstractTabUIHandler<SynchUIModel, U> {
- public abstract void doAllAction(VCSAction action);
+ public abstract void doAction(VCSAction action, boolean useSelect);
public void doSelectLocation(VCSEntryLocation location) {
super.doSelectLocation(location);
- VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
+ VCSAction[] actions = getModel().getEntriesModel().getActions((ListSelectionModel) null);
List<String> acts = new ArrayList<String>();
for (VCSAction action : actions) {
acts.add(action.name().toLowerCase());
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,7 +16,6 @@
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.AbstractTabUI;
-import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractTabUIModel;
import javax.swing.ListSelectionModel;
@@ -45,14 +44,14 @@
//}
String action = evt.getPropertyName();
- if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
+ if (AbstractTabUIModel.LOCATION_PROPERTY_CHANGED.equals(action)) {
doSelectLocation((VCSEntryLocation) evt.getNewValue());
}
}
public void doSelectLocation(VCSEntryLocation location) {
log.info(location);
- getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
+ getUi().getCardLayout().show(getUi().getPreview(), "tab" + location.name().toLowerCase());
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -44,7 +44,7 @@
}
public VCSEntryLocation getLocation() {
- return getModel().getModel().getLocation();
+ return getModel().getEntriesModel().getLocation();
}
protected VCSActionManager getActionManager() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -15,19 +15,20 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
/**
- * Model of a repository
+ * 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 = getModel().getLocation();
- getModel().setLocation(location);
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
+ VCSEntryLocation oldLocation = getEntriesModel().getLocation();
+ getEntriesModel().setLocation(location);
+ firePropertyChange(LOCATION_PROPERTY_CHANGED, oldLocation, location);
}
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -18,10 +18,8 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.type.VCSEntryLocation;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -33,48 +31,36 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log = LogFactory.getLog(AbstractUIModel.class);
- /** current action to be fired */
- protected VCSAction action;
/** support for change properties support */
protected PropertyChangeSupport changeSupport;
- protected final AbstractVCSEntriesTableModel model;
+ protected final AbstractVCSEntriesTableModel entriesModel;
protected AbstractUIModel() {
- model = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
+ entriesModel = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
}
- public AbstractVCSEntriesTableModel getModel() {
- return model;
+ public AbstractVCSEntriesTableModel getEntriesModel() {
+ return entriesModel;
}
public void populate(VCSConnexion connexion) throws VCSException {
- getModel().populate(connexion, System.nanoTime());
+ getEntriesModel().populate(connexion, System.nanoTime());
}
public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location) throws VCSException {
- getModel().populate(connexion, relativeLocalPaths, location, System.nanoTime());
+ getEntriesModel().populate(connexion, relativeLocalPaths, location, System.nanoTime());
}
public void populate(VCSEntryLocation location, VCSEntry[] datas) {
- getModel().populate(location, datas);
+ getEntriesModel().populate(location, datas);
}
public void refresh(List<VCSEntry> entries) {
- getModel().refresh(entries, System.nanoTime());
+ getEntriesModel().refresh(entries, System.nanoTime());
}
- public VCSAction getAction() {
- return action;
- }
-
- public void setAction(VCSAction action) {
- VCSAction oldAction = this.action;
- this.action = action;
- firePropertyChange(VCSUIConstants.ACTION_PROPERTY_CHANGED, oldAction, action);
- }
-
public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
if (listener == null) {
return;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -20,12 +20,12 @@
package org.codelutin.vcs.ui.model;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.type.VCSAction;
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.VCSException;
import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.util.VCSEntriesImpl;
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -17,13 +17,12 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import static org.codelutin.vcs.ui.VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED;
import java.util.ArrayList;
import java.util.List;
/**
- * Model of a repository
+ * Model of a a confirmation of action on entries (single type of action possible)
*
* @author chemit
*/
@@ -32,6 +31,10 @@
/** 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) {
@@ -40,6 +43,10 @@
return commitMessages;
}
+ public VCSAction getAction() {
+ return action;
+ }
+
public void addCommitMessage(String commitMessage) {
if (commitMessage != null && !commitMessage.isEmpty() && !getCommitMessages().contains(commitMessage)) {
// add message in history
@@ -49,11 +56,15 @@
}
public void init(VCSAction action, VCSEntryLocation location, VCSEntry[] states) {
- // always reset action in order to allow propagation of action changed
- this.action = null;
- model.clear();
- model.populate(location, 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
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,9 +16,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.VCSHandler;
+import org.codelutin.vcs.type.VCSAction;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -31,7 +31,6 @@
*/
public class DiffPanelUIModel {
- /** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log = LogFactory.getLog(DiffPanelUIModel.class);
/** local root : wroking copy */
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -15,7 +15,6 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.ui.VCSUIConstants;
/**
* Model of a repository
@@ -24,13 +23,15 @@
*/
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(VCSUIConstants.TAB_PROPERTY_CHANGED, oldFileModel, fileModel);
+ firePropertyChange(FILE_PROPERTY_CHANGED, oldFileModel, fileModel);
}
public VCSEntry getFileModel() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -16,16 +16,21 @@
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSState;
-import org.codelutin.vcs.ui.VCSUIConstants;
/** @author chemit */
public class SimpleVCSEntriesTableModelImpl extends AbstractVCSEntriesTableModel {
private static final long serialVersionUID = -6397327068709720165L;
- protected SimpleVCSEntriesTableModelImpl(String name) {
+ /** 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")
+ };
- super(name, VCSUIConstants.SIMPLE_COLUMNS_NAMES);
+ public SimpleVCSEntriesTableModelImpl(String name) {
+ super(name, SIMPLE_COLUMNS_NAMES);
}
public Object getValueAt(int rowIndex, int columnIndex) {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 13:54:13 UTC (rev 406)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 15:16:51 UTC (rev 407)
@@ -14,8 +14,6 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.type.VCSAction;
-
/**
* Model of a repository
*
@@ -23,10 +21,5 @@
*/
public class SynchUIModel extends AbstractTabUIModel {
- public void doAllAction(VCSAction action) {
- setAction(action);
- firePropertyChange(action.name().toLowerCase() + "All", null, model);
- }
-
}
1
0
[Buix-commits] r406 - in trunk/lutinvcs: lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:54:13 +0000 (Sun, 06 Apr 2008)
New Revision: 406
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
Log:
model is instanciate in AbstractXXXUI
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
@@ -5,16 +5,8 @@
import org.codelutin.vcs.type.VCSAction;
public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
- super(handler,new org.codelutin.vcs.ui.model.ConfirmUIModel());
- Action acceptAction = new AbstractAction("accept") {
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
+ super(handler);
}
- };
- getAccept().setAction((acceptAction));
- }
</script>
<Table>
@@ -62,7 +54,7 @@
</row>
<row>
<cell fill='both'>
- <JButton id='accept' text='lutinvcs.accept'/>
+ <JButton id='accept' text='lutinvcs.accept' onActionPerformed='doAccept()'/>
</cell>
</row>
</Table>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
@@ -5,7 +5,7 @@
import org.codelutin.vcs.type.VCSEntryLocation;
public JDiffUI(org.codelutin.vcs.ui.handler.AbstractDiffUIHandler handler) {
- super(handler,new org.codelutin.vcs.ui.model.DiffUIModel());
+ super(handler);
}
</script>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:54:13 UTC (rev 406)
@@ -6,9 +6,9 @@
import org.codelutin.vcs.type.VCSEntryLocation;
public JSynchUI(org.codelutin.vcs.ui.handler.AbstractSynchUIHandler handler) {
- super(handler,new org.codelutin.vcs.ui.model.SynchUIModel());
+ super(handler);
}
- add(table);
+ //add(table);
</script>
<java.awt.CardLayout id='cardLayout'/>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:54:13 UTC (rev 406)
@@ -53,8 +53,8 @@
public AbstractConfirmUI() {
}
- public AbstractConfirmUI(AbstractUIHandler handler, AbstractUIModel model) {
- super(handler, model);
+ public AbstractConfirmUI(AbstractConfirmUIHandler handler) {
+ super(handler, new ConfirmUIModel());
}
@Override
@@ -67,6 +67,10 @@
return (ConfirmUIModel) super.getModel();
}
+ public void doAccept() {
+ getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
+ }
+
protected void showLastMessages() {
}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:54:13 UTC (rev 406)
@@ -17,7 +17,6 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
-import org.codelutin.vcs.ui.model.AbstractTabUIModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
import javax.swing.JButton;
@@ -34,8 +33,8 @@
super();
}
- public AbstractDiffUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
- super(handler, model);
+ public AbstractDiffUI(AbstractTabUIHandler handler) {
+ super(handler, new DiffUIModel());
}
public DiffUIModel getModel() {
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:47:28 UTC (rev 405)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:54:13 UTC (rev 406)
@@ -48,8 +48,8 @@
super();
}
- public AbstractSynchUI(AbstractSynchUIHandler handler, SynchUIModel model) {
- super(handler, model);
+ public AbstractSynchUI(AbstractSynchUIHandler handler) {
+ super(handler, new SynchUIModel());
}
public SynchUIModel getModel() {
1
0
[Buix-commits] r405 - in trunk/lutinvcs: lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:47:28 +0000 (Sun, 06 Apr 2008)
New Revision: 405
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
Log:
new module : ui-pre-jaxx
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -23,7 +23,7 @@
/** @author chemit */
public class ConfirmUIHandler extends AbstractConfirmUIHandler {
- protected final JConfirmUI ui;
+ protected final AbstractConfirmUI ui;
public ConfirmUIHandler() {
this.ui = new JConfirmUI(this);
@@ -33,7 +33,7 @@
return ui.getModel();
}
- public JConfirmUI getUi() {
+ public AbstractConfirmUI getUi() {
return ui;
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -51,7 +51,7 @@
return;
}
log.info("files to treate :" + entries.size());
- JConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
confirmUI.getModel().init(action, model.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -61,7 +61,7 @@
} else {
// show confirm action ui
- JConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
+ AbstractConfirmUI confirmUI = VCSUIFactory.newConfirmUI();
confirmUI.getModel().init(action, tableModel.getLocation(), entries.toArray(new VCSEntry[entries.size()]));
confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, entries.size() - 1);
confirmUI.setVisible(true);
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -30,7 +30,7 @@
protected static AbstractTabUI synchUI;
protected static AbstractDiffUI diffUI;
- protected static JConfirmUI confirmUI;
+ protected static AbstractConfirmUI confirmUI;
public static AbstractSynchUI newSynchUI() {
SynchUIHandler result = newHandler(SynchUIHandler.class);
@@ -42,7 +42,7 @@
return result.getUi();
}
- public static JConfirmUI newConfirmUI() {
+ public static AbstractConfirmUI newConfirmUI() {
ConfirmUIHandler result = newHandler(ConfirmUIHandler.class);
return result.getUi();
}
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,37 +1,21 @@
-<org.codelutin.vcs.ui.AbstractUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
- resizable='false' height='300' width='400'>
+<AbstractConfirmUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'
+ resizable='false' height='300' width='400'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
- import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
- import org.codelutin.vcs.ui.model.ConfirmUIModel ;
- public JConfirmUI(AbstractConfirmUIHandler handler) {
-
- super(handler,new ConfirmUIModel());
-
- Action acceptAction= new AbstractAction("accept") {
+ public JConfirmUI(org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler handler) {
+ super(handler,new org.codelutin.vcs.ui.model.ConfirmUIModel());
+ Action acceptAction = new AbstractAction("accept") {
private static final long serialVersionUID = 1L;
+
public void actionPerformed(ActionEvent e) {
- getHandler().doAction(getCommitMessage().getText(),getModel().getModel());
+ getHandler().doAction(getCommitMessage().getText(), getModel().getModel());
}
};
- accept.setAction((acceptAction));
+ getAccept().setAction((acceptAction));
}
- @Override
- protected AbstractConfirmUIHandler getHandler() {
- return (AbstractConfirmUIHandler) super.getHandler();
- }
-
- @Override
- public ConfirmUIModel getModel() {
- return (ConfirmUIModel) super.getModel();
- }
-
- protected void showLastMessages() {
-
- }
</script>
<Table>
<row fill='both'>
@@ -82,5 +66,5 @@
</cell>
</row>
</Table>
-</org.codelutin.vcs.ui.AbstractUI>
+</AbstractConfirmUI>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,4 +1,4 @@
-<org.codelutin.vcs.ui.AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
+<AbstractDiffUI title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
@@ -76,4 +76,4 @@
</cell>
</row>
</Table>
-</org.codelutin.vcs.ui.AbstractDiffUI>
+</AbstractDiffUI>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,5 +1,5 @@
-<org.codelutin.vcs.ui.AbstractSynchUI title='lutinvcs.synch.title' modal="true" id='synchui'
- defaultCloseOperation='DISPOSE_ON_CLOSE'>
+<AbstractSynchUI title='lutinvcs.synch.title' modal="true" id='synchui'
+ defaultCloseOperation='DISPOSE_ON_CLOSE'>
<style source="common.css"/>
<script>
import org.codelutin.vcs.type.VCSAction;
@@ -13,14 +13,15 @@
<java.awt.CardLayout id='cardLayout'/>
- <!--JPopupMenu enabled='false'/-->
- <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
+
<Table id='table'>
<row fill='both'>
<cell fill='both' weightx='1'>
<JToolBar>
+ <!--JPopupMenu enabled='false'/-->
+ <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
<JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
@@ -72,4 +73,4 @@
</cell>
</row>
</Table>
-</org.codelutin.vcs.ui.AbstractSynchUI>
\ No newline at end of file
+</AbstractSynchUI>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-06 13:47:28 UTC (rev 405)
@@ -1,25 +1,13 @@
-<org.codelutin.vcs.ui.AbstractVCSPopup>
+<AbstractVCSPopup>
<script>
import org.codelutin.vcs.type.VCSAction;
- import org.codelutin.vcs.ui.handler.VCSAbsractAction;
- protected VCSAbsractAction dispatchAction;
-
- protected void setDispatchAction(VCSAbsractAction 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);
- }
- /*add(refresh);
+ add(refresh);
add(diff);
add(update);
add(commit);
add(revert);
- add(delete);*/
+ add(delete);
</script>
<JMenuItem id='refresh' text='{_("lutinvcs.action.refresh")}' toolTipText='{_("lutinvcs.action.tooltip.refresh")}'
icon='{createImageIcon("autoRefresh.png")}' onActionPerformed='doAction(VCSAction.REFRESH,refresh)'/>
@@ -33,4 +21,4 @@
icon='{createImageIcon("rollback.png")}' onActionPerformed='doAction(VCSAction.REVERT,revert)'/>
<JMenuItem id='delete' text='{_("lutinvcs.action.delete")}' toolTipText='{_("lutinvcs.action.tooltip.delete")}'
icon='{createImageIcon("remove.png")}' onActionPerformed='doAction(VCSAction.DELETE,delete)'/>
-</org.codelutin.vcs.ui.AbstractVCSPopup>
\ No newline at end of file
+</AbstractVCSPopup>
\ No newline at end of file
Added: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractConfirmUI.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -0,0 +1,73 @@
+/**
+ * # #% 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.handler.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+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();
+
+ public AbstractConfirmUI() {
+ }
+
+ public AbstractConfirmUI(AbstractUIHandler handler, AbstractUIModel model) {
+ super(handler, model);
+ }
+
+ @Override
+ protected AbstractConfirmUIHandler getHandler() {
+ return (AbstractConfirmUIHandler) super.getHandler();
+ }
+
+ @Override
+ public ConfirmUIModel getModel() {
+ return (ConfirmUIModel) super.getModel();
+ }
+
+ protected void showLastMessages() {
+
+ }
+}
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -22,6 +22,7 @@
/** @author chemit */
public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
+
protected VCSAbsractAction dispatchAction;
public abstract JMenuItem getRefresh();
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:19:28 UTC (rev 404)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:47:28 UTC (rev 405)
@@ -19,27 +19,21 @@
import jaxx.tags.swing.JPopupMenuHandler;
import jaxx.tags.swing.JWindowHandler;
-import java.beans.Introspector;
-
public class VCSInitializer implements jaxx.spi.Initializer {
public void initialize() {
- String[] searchPath = Introspector.getBeanInfoSearchPath();
- String[] newSearchPath = new String[searchPath.length + 1];
- System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
- newSearchPath[newSearchPath.length - 1] = "jaxx.beaninfos";
- Introspector.setBeanInfoSearchPath(newSearchPath);
-
- //TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new jaxx.tags.DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
-
+ //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JWindowHandler.class);
TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractVCSPopup.class), JPopupMenuHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractConfirmUI.class), JWindowHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractDiffUI.class), JWindowHandler.class);
TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
- //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JDialog.class);
+ TagManager.registerDefaultNamespace("AbstractConfirmUI", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("AbstractSynchUI", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("AbstractDiffUI", "org.codelutin.vcs.ui.*");
+ TagManager.registerDefaultNamespace("AbstractVCSPopup", "org.codelutin.vcs.ui.*");
- //TagManager.registerDefaultNamespace("AbstractUI", "javax.swing.*");
-
}
}
\ No newline at end of file
1
0
[Buix-commits] r404 - trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:19:28 +0000 (Sun, 06 Apr 2008)
New Revision: 404
Removed:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties
Log:
new module : ui-pre-jaxx
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties 2008-04-06 13:18:58 UTC (rev 403)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pref-jaxx-en_GB.properties 2008-04-06 13:19:28 UTC (rev 404)
@@ -1,4 +0,0 @@
-lutinvcs.error.thread.action=
-lutinvcs.file=File
-lutinvcs.module=Module
-lutinvcs.status=Status
1
0
[Buix-commits] r403 - in trunk/lutinvcs: lutinvcs-core/src/main/resources/i18n lutinvcs-ui-jaxx lutinvcs-ui-pre-jaxx lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/resources/i18n
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:18:58 +0000 (Sun, 06 Apr 2008)
New Revision: 403
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-en_GB.properties
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-en_GB.properties
trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-fr_FR.properties
trunk/lutinvcs/lutinvcs-ui-jaxx/pom.xml
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-fr_FR.properties
Log:
new module : ui-pre-jaxx
Modified: trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-en_GB.properties 2008-04-06 13:08:15 UTC (rev 402)
+++ trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-en_GB.properties 2008-04-06 13:18:58 UTC (rev 403)
@@ -1,4 +1 @@
lutinvcs.error.thread.action=
-lutinvcs.file=File
-lutinvcs.module=Module
-lutinvcs.status=Status
Modified: trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-fr_FR.properties 2008-04-06 13:08:15 UTC (rev 402)
+++ trunk/lutinvcs/lutinvcs-core/src/main/resources/i18n/lutinvcs-core-fr_FR.properties 2008-04-06 13:18:58 UTC (rev 403)
@@ -1,4 +1 @@
lutinvcs.error.thread.action=
-lutinvcs.file=Fichier
-lutinvcs.module=Module
-lutinvcs.status=Status
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/pom.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/pom.xml 2008-04-06 13:08:15 UTC (rev 402)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/pom.xml 2008-04-06 13:18:58 UTC (rev 403)
@@ -60,7 +60,7 @@
</dependency-->
<dependency>
<groupId>lutinlib.vcs</groupId>
- <artifactId>lutinvcs-core</artifactId>
+ <artifactId>lutinvcs-ui-pre-jaxx</artifactId>
<scope>compile</scope>
<version>${current.version}</version>
</dependency>
Property changes on: trunk/lutinvcs/lutinvcs-ui-pre-jaxx
___________________________________________________________________
Name: svn:ignore
+ target
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml 2008-04-06 13:08:15 UTC (rev 402)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/pom.xml 2008-04-06 13:18:58 UTC (rev 403)
@@ -39,7 +39,7 @@
<dependencies>
<dependency>
<groupId>lutinlib.vcs</groupId>
- <artifactId>lutinvcs-api</artifactId>
+ <artifactId>lutinvcs-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:08:15 UTC (rev 402)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:18:58 UTC (rev 403)
@@ -31,11 +31,12 @@
Introspector.setBeanInfoSearchPath(newSearchPath);
- TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
+ //TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new jaxx.tags.DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
- TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractVCSPopup.class), JPopupMenuHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
+
//TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JDialog.class);
//TagManager.registerDefaultNamespace("AbstractUI", "javax.swing.*");
Added: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-en_GB.properties (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-en_GB.properties 2008-04-06 13:18:58 UTC (rev 403)
@@ -0,0 +1,3 @@
+lutinvcs.file=File
+lutinvcs.module=Module
+lutinvcs.status=Status
Modified: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-fr_FR.properties 2008-04-06 13:08:15 UTC (rev 402)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/resources/i18n/lutinvcs-ui-pre-jaxx-fr_FR.properties 2008-04-06 13:18:58 UTC (rev 403)
@@ -1,4 +1,3 @@
-lutinvcs.error.thread.action=
lutinvcs.file=Fichier
lutinvcs.module=Module
lutinvcs.status=Status
1
0
[Buix-commits] r402 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:08:15 +0000 (Sun, 06 Apr 2008)
New Revision: 402
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/
Log:
new module : ui-pre-jaxx
1
0
[Buix-commits] r401 - in trunk/lutinvcs: lutinvcs-core/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:07:44 +0000 (Sun, 06 Apr 2008)
New Revision: 401
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/package.html
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/package.html
Log:
new module : ui-pre-jaxx
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/package.html
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/package.html 2008-04-06 13:07:15 UTC (rev 400)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/package.html 2008-04-06 13:07:44 UTC (rev 401)
@@ -1,6 +0,0 @@
-<html>
-<body>
-<h1>Lutin vcs ui package</h1>
-TODO
-</body>
-</html>
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/package.html (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/package.html)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/package.html (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/package.html 2008-04-06 13:07:44 UTC (rev 401)
@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>Lutin vcs ui package</h1>
+TODO
+</body>
+</html>
\ No newline at end of file
1
0
[Buix-commits] r400 - in trunk/lutinvcs: lutinvcs-core/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:07:15 +0000 (Sun, 06 Apr 2008)
New Revision: 400
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/UIHelper.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
Log:
new module : ui-pre-jaxx
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -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;
-
-import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
-import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
-import org.codelutin.vcs.ui.model.AbstractTabUIModel;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-
-import javax.swing.JButton;
-import javax.swing.JTable;
-
-/** @author chemit */
-public abstract class AbstractDiffUI extends AbstractTabUI {
-
- public abstract JButton getNextDiff();
-
- public abstract JButton getPreviousDiff();
-
- public AbstractDiffUI() {
- super();
- }
-
- public AbstractDiffUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
- super(handler, model);
- }
-
- public DiffUIModel getModel() {
- return (DiffUIModel) model;
- }
-
- protected AbstractDiffUIHandler getHandler() {
- return (AbstractDiffUIHandler) handler;
- }
-
- protected void selectFile(JTable table) {
- getModel().setFileModel(model.getModel().getDisplayedEntries(table.getSelectionModel()).get(0));
- }
-
- protected void doAction(VCSAction action) {
- getHandler().doAction(action, getModel().getFileModel());
- }
-
- protected void gotoNextDiff() {
- getHandler().gotoNextDiff();
- }
-
- protected void gotoPreviousDiff() {
- getHandler().gotoPreviousDiff();
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -1,80 +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.AbstractSynchUIHandler;
-import org.codelutin.vcs.ui.model.SynchUIModel;
-
-import javax.swing.JButton;
-import java.awt.CardLayout;
-
-/** @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();
-
-
- public AbstractSynchUI() {
- super();
- }
-
- public AbstractSynchUI(AbstractSynchUIHandler handler, SynchUIModel model) {
- super(handler, model);
- }
-
- public SynchUIModel getModel() {
- return (SynchUIModel) model;
- }
-
- protected AbstractSynchUIHandler getHandler() {
- return (AbstractSynchUIHandler) handler;
- }
-
- protected void doAllAction(VCSAction action) {
- getModel().doAllAction(action);
- }
-
- 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);
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -1,95 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui;
-
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
-import org.codelutin.vcs.ui.model.AbstractTabUIModel;
-
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JToggleButton;
-import java.awt.CardLayout;
-
-/** @author chemit */
-public abstract class AbstractTabUI extends AbstractUI {
-
- public abstract JToggleButton getAllTab();
-
- public abstract JToggleButton getLocalTab();
-
- public abstract JToggleButton getRemoteTab();
-
- public abstract JScrollPane getAllContent();
-
- public abstract JScrollPane getLocalContent();
-
- public abstract JScrollPane getRemoteContent();
-
- public abstract JTable getAllTable();
-
- public abstract JTable getLocalTable();
-
- public abstract JTable getRemoteTable();
-
- public abstract JPanel getPreview();
-
- public abstract CardLayout getCardLayout();
-
- public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
- super(handler, model);
- }
-
- public AbstractTabUI() {
- // for jaxx but never used
- super();
- }
-
- public AbstractTabUIModel getModel() {
- return (AbstractTabUIModel) model;
- }
-
- protected AbstractTabUIHandler getHandler() {
- return (AbstractTabUIHandler) handler;
- }
-
- @Override
- public void setVisible(boolean b) {
- if (handler.getLocation() == VCSEntryLocation.UNKNOW) {
- // first launch, no tab model selected,choose one
- getAllTab().doClick();
- }
- super.setVisible(b);
- }
-
- public JTable getTable(VCSEntryLocation modelName) {
- switch (modelName) {
- case ALL:
- return getAllTable();
- case LOCAL:
- return getLocalTable();
- case REMOTE:
- return getRemoteTable();
- case UNKNOW:
- break;
- }
- throw new IllegalStateException("no table found for " + modelName);
- }
-
- protected void setLocation(VCSEntryLocation location) {
- getModel().setLocation(location);
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -1,47 +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.ui.handler.AbstractUIHandler;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
-
-/** @author chemit */
-public class AbstractUI extends javax.swing.JDialog {
-
- protected final AbstractUIModel model;
-
- protected final AbstractUIHandler handler;
-
- public AbstractUI() {
- // Jaxx always generate the default constructor, so need it, but DO NOT USE IT!
- throw new IllegalStateException("the default constructor can NOT be used!");
- }
-
- public AbstractUI(AbstractUIHandler handler, AbstractUIModel model) {
- this.handler = handler;
- this.model = model;
- UIHelper.setQuitAction(this);
- }
-
- public AbstractUIModel getModel() {
- return model;
- }
-
- protected AbstractUIHandler getHandler() {
- return handler;
- }
-
-
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -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;
-
-import org.codelutin.vcs.ui.handler.VCSAbsractAction;
-import org.codelutin.vcs.type.VCSAction;
-
-import javax.swing.JMenuItem;
-import java.awt.event.ActionEvent;
-
-/** @author chemit */
-public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
- protected VCSAbsractAction 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();
-
- protected void setDispatchAction(VCSAbsractAction 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-core/src/main/java/org/codelutin/vcs/ui/UIHelper.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -1,45 +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 javax.swing.JDialog;
-import javax.swing.JRootPane;
-import javax.swing.Action;
-import javax.swing.AbstractAction;
-import javax.swing.JComponent;
-import javax.swing.KeyStroke;
-import java.awt.event.ActionEvent;
-
-/**
- * UI Helper methods
- *
- * @author chemit
- */
-public class UIHelper {
- public static void setQuitAction(final JDialog ui) {
- JRootPane rootPane = ui.getRootPane();
- //rootPane.setDefaultButton(accept);
-
- Action quitAction = new AbstractAction("quit") {
- private static final long serialVersionUID = -869095664995763057L;
-
- public void actionPerformed(ActionEvent e) {
- ui.dispose();
- }
- };
- rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "quit");
- rootPane.getActionMap().put("quit", quitAction);
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -1,44 +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.reflect.ClassDescriptorLoader;
-import jaxx.tags.TagManager;
-import jaxx.tags.swing.JPopupMenuHandler;
-import jaxx.tags.swing.JWindowHandler;
-
-import java.beans.Introspector;
-
-public class VCSInitializer implements jaxx.spi.Initializer {
-
- public void initialize() {
- String[] searchPath = Introspector.getBeanInfoSearchPath();
- String[] newSearchPath = new String[searchPath.length + 1];
- System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
- newSearchPath[newSearchPath.length - 1] = "jaxx.beaninfos";
-
- Introspector.setBeanInfoSearchPath(newSearchPath);
-
- TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
-
- TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
- TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractVCSPopup.class), JPopupMenuHandler.class);
-
- //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JDialog.class);
-
- //TagManager.registerDefaultNamespace("AbstractUI", "javax.swing.*");
-
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:06:51 UTC (rev 399)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -1,67 +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 static org.codelutin.i18n.I18n.n_;
-
-/** @author chemit */
-public class VCSUIConstants {
-
- /** columns names for a simple table model with module, file and status */
- public static final String[] SIMPLE_COLUMNS_NAMES = new String[]{
- n_("lutinvcs.module"),
- n_("lutinvcs.file"),
- n_("lutinvcs.status")
- };
-
- /** model name for synchronize ui */
- public static final String SYNCH_MODEL_PROPERTY = "modelSynch";
-
- /** model name for confirm ui */
- public static final String CONFIRM_MODEL_PROPERTY = "modelConfirm";
-
- /** model name for diff ui */
- public static final String DIFF_MODEL_PROPERTY = "modelConfirm";
-
- public static final String ACTION_PROPERTY_CHANGED = "action";
-
- public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage";
-
- public static final String FILE_PROPERTY_CHANGED = "file";
-
- public static final String NEXT_DIFF_PROPERTY_CHANGED = "nextDiff";
-
- public static final String PREVIOUS_DIFF_PROPERTY_CHANGED = "previousDiff";
-
- public static final String REFRESH_PROPERTY_CHANGED = "refresh";
-
- public static final String TAB_PROPERTY_CHANGED = "tab";
-
- public static final String DIFF_ALL_PROPERTY_CHANGED = "diffAll";
-
- public static final String COMMIT_ALL_PROPERTY_CHANGED = "commitAll";
-
- public static final String UPDATE_ALL_PROPERTY_CHANGED = "updateAll";
-
- public static final String REVERT_ALL_PROPERTY_CHANGED = "revertAll";
-
- public static final String DIFF_PROPERTY_CHANGED = "diff";
-
- public static final String COMMIT_PROPERTY_CHANGED = "commit";
-
- public static final String UPDATE_PROPERTY_CHANGED = "update";
-
- public static final String REVERT_PROPERTY_CHANGED = "revert";
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,64 @@
+/**
+ * # #% 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.ui.handler.AbstractDiffUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.model.AbstractTabUIModel;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+
+import javax.swing.JButton;
+import javax.swing.JTable;
+
+/** @author chemit */
+public abstract class AbstractDiffUI extends AbstractTabUI {
+
+ public abstract JButton getNextDiff();
+
+ public abstract JButton getPreviousDiff();
+
+ public AbstractDiffUI() {
+ super();
+ }
+
+ public AbstractDiffUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
+ super(handler, model);
+ }
+
+ public DiffUIModel getModel() {
+ return (DiffUIModel) model;
+ }
+
+ protected AbstractDiffUIHandler getHandler() {
+ return (AbstractDiffUIHandler) handler;
+ }
+
+ protected void selectFile(JTable table) {
+ getModel().setFileModel(model.getModel().getDisplayedEntries(table.getSelectionModel()).get(0));
+ }
+
+ protected void doAction(VCSAction action) {
+ getHandler().doAction(action, getModel().getFileModel());
+ }
+
+ protected void gotoNextDiff() {
+ getHandler().gotoNextDiff();
+ }
+
+ protected void gotoPreviousDiff() {
+ getHandler().gotoPreviousDiff();
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,80 @@
+/**
+ * # #% 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.AbstractSynchUIHandler;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+
+import javax.swing.JButton;
+import java.awt.CardLayout;
+
+/** @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();
+
+
+ public AbstractSynchUI() {
+ super();
+ }
+
+ public AbstractSynchUI(AbstractSynchUIHandler handler, SynchUIModel model) {
+ super(handler, model);
+ }
+
+ public SynchUIModel getModel() {
+ return (SynchUIModel) model;
+ }
+
+ protected AbstractSynchUIHandler getHandler() {
+ return (AbstractSynchUIHandler) handler;
+ }
+
+ protected void doAllAction(VCSAction action) {
+ getModel().doAllAction(action);
+ }
+
+ 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);
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,95 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.model.AbstractTabUIModel;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JToggleButton;
+import java.awt.CardLayout;
+
+/** @author chemit */
+public abstract class AbstractTabUI extends AbstractUI {
+
+ public abstract JToggleButton getAllTab();
+
+ public abstract JToggleButton getLocalTab();
+
+ public abstract JToggleButton getRemoteTab();
+
+ public abstract JScrollPane getAllContent();
+
+ public abstract JScrollPane getLocalContent();
+
+ public abstract JScrollPane getRemoteContent();
+
+ public abstract JTable getAllTable();
+
+ public abstract JTable getLocalTable();
+
+ public abstract JTable getRemoteTable();
+
+ public abstract JPanel getPreview();
+
+ public abstract CardLayout getCardLayout();
+
+ public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
+ super(handler, model);
+ }
+
+ public AbstractTabUI() {
+ // for jaxx but never used
+ super();
+ }
+
+ public AbstractTabUIModel getModel() {
+ return (AbstractTabUIModel) model;
+ }
+
+ protected AbstractTabUIHandler getHandler() {
+ return (AbstractTabUIHandler) handler;
+ }
+
+ @Override
+ public void setVisible(boolean b) {
+ if (handler.getLocation() == VCSEntryLocation.UNKNOW) {
+ // first launch, no tab model selected,choose one
+ getAllTab().doClick();
+ }
+ super.setVisible(b);
+ }
+
+ public JTable getTable(VCSEntryLocation modelName) {
+ switch (modelName) {
+ case ALL:
+ return getAllTable();
+ case LOCAL:
+ return getLocalTable();
+ case REMOTE:
+ return getRemoteTable();
+ case UNKNOW:
+ break;
+ }
+ throw new IllegalStateException("no table found for " + modelName);
+ }
+
+ protected void setLocation(VCSEntryLocation location) {
+ getModel().setLocation(location);
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,47 @@
+/**
+ * # #% 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.ui.handler.AbstractUIHandler;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+
+/** @author chemit */
+public class AbstractUI extends javax.swing.JDialog {
+
+ protected final AbstractUIModel model;
+
+ protected final AbstractUIHandler handler;
+
+ public AbstractUI() {
+ // Jaxx always generate the default constructor, so need it, but DO NOT USE IT!
+ throw new IllegalStateException("the default constructor can NOT be used!");
+ }
+
+ public AbstractUI(AbstractUIHandler handler, AbstractUIModel model) {
+ this.handler = handler;
+ this.model = model;
+ UIHelper.setQuitAction(this);
+ }
+
+ public AbstractUIModel getModel() {
+ return model;
+ }
+
+ protected AbstractUIHandler getHandler() {
+ return handler;
+ }
+
+
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,48 @@
+/**
+ * # #% 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.ui.handler.VCSAbsractAction;
+import org.codelutin.vcs.type.VCSAction;
+
+import javax.swing.JMenuItem;
+import java.awt.event.ActionEvent;
+
+/** @author chemit */
+public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
+ protected VCSAbsractAction 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();
+
+ protected void setDispatchAction(VCSAbsractAction 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);
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/UIHelper.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/UIHelper.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,45 @@
+/**
+ * # #% 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 javax.swing.JDialog;
+import javax.swing.JRootPane;
+import javax.swing.Action;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+import java.awt.event.ActionEvent;
+
+/**
+ * UI Helper methods
+ *
+ * @author chemit
+ */
+public class UIHelper {
+ public static void setQuitAction(final JDialog ui) {
+ JRootPane rootPane = ui.getRootPane();
+ //rootPane.setDefaultButton(accept);
+
+ Action quitAction = new AbstractAction("quit") {
+ private static final long serialVersionUID = -869095664995763057L;
+
+ public void actionPerformed(ActionEvent e) {
+ ui.dispose();
+ }
+ };
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "quit");
+ rootPane.getActionMap().put("quit", quitAction);
+ }
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,44 @@
+/**
+ * # #% 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.reflect.ClassDescriptorLoader;
+import jaxx.tags.TagManager;
+import jaxx.tags.swing.JPopupMenuHandler;
+import jaxx.tags.swing.JWindowHandler;
+
+import java.beans.Introspector;
+
+public class VCSInitializer implements jaxx.spi.Initializer {
+
+ public void initialize() {
+ String[] searchPath = Introspector.getBeanInfoSearchPath();
+ String[] newSearchPath = new String[searchPath.length + 1];
+ System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
+ newSearchPath[newSearchPath.length - 1] = "jaxx.beaninfos";
+
+ Introspector.setBeanInfoSearchPath(newSearchPath);
+
+ TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
+
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractVCSPopup.class), JPopupMenuHandler.class);
+
+ //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JDialog.class);
+
+ //TagManager.registerDefaultNamespace("AbstractUI", "javax.swing.*");
+
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:07:15 UTC (rev 400)
@@ -0,0 +1,67 @@
+/**
+ * # #% 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 static org.codelutin.i18n.I18n.n_;
+
+/** @author chemit */
+public class VCSUIConstants {
+
+ /** columns names for a simple table model with module, file and status */
+ public static final String[] SIMPLE_COLUMNS_NAMES = new String[]{
+ n_("lutinvcs.module"),
+ n_("lutinvcs.file"),
+ n_("lutinvcs.status")
+ };
+
+ /** model name for synchronize ui */
+ public static final String SYNCH_MODEL_PROPERTY = "modelSynch";
+
+ /** model name for confirm ui */
+ public static final String CONFIRM_MODEL_PROPERTY = "modelConfirm";
+
+ /** model name for diff ui */
+ public static final String DIFF_MODEL_PROPERTY = "modelConfirm";
+
+ public static final String ACTION_PROPERTY_CHANGED = "action";
+
+ public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage";
+
+ public static final String FILE_PROPERTY_CHANGED = "file";
+
+ public static final String NEXT_DIFF_PROPERTY_CHANGED = "nextDiff";
+
+ public static final String PREVIOUS_DIFF_PROPERTY_CHANGED = "previousDiff";
+
+ public static final String REFRESH_PROPERTY_CHANGED = "refresh";
+
+ public static final String TAB_PROPERTY_CHANGED = "tab";
+
+ public static final String DIFF_ALL_PROPERTY_CHANGED = "diffAll";
+
+ public static final String COMMIT_ALL_PROPERTY_CHANGED = "commitAll";
+
+ public static final String UPDATE_ALL_PROPERTY_CHANGED = "updateAll";
+
+ public static final String REVERT_ALL_PROPERTY_CHANGED = "revertAll";
+
+ public static final String DIFF_PROPERTY_CHANGED = "diff";
+
+ public static final String COMMIT_PROPERTY_CHANGED = "commit";
+
+ public static final String UPDATE_PROPERTY_CHANGED = "update";
+
+ public static final String REVERT_PROPERTY_CHANGED = "revert";
+}
1
0
[Buix-commits] r399 - in trunk/lutinvcs: lutinvcs-core/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:06:51 +0000 (Sun, 06 Apr 2008)
New Revision: 399
Added:
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
Log:
new module : ui-pre-jaxx
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler (from rev 371, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler)
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,81 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui.handler;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.ui.VCSUIConstants;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.ConfirmUIModel;
-
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-/**
- * Abstract ConfirmUI handler
- *
- * @author chemit
- */
-public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel> {
-
- protected abstract void updateUI();
-
- protected abstract void updateMessageUI();
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()) {
- log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- }
- String action = evt.getPropertyName();
-
- if (VCSUIConstants.ACTION_PROPERTY_CHANGED.equals(action)) {
- updateUI();
- return;
- }
-
- if (VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
- updateMessageUI();
- return;
- }
-
- throw new IllegalStateException("unimplemented property changed : " + evt);
- }
-
- public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
-
- VCSAction action = getModel().getAction();
-
- List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
-
- if (action.isCommit()) {
- getModel().addCommitMessage(commitMessage);
-
- } else {
- commitMessage = null;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
- }
-
- getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
-
- // dispose ui
- getUi().dispose();
-
- }
-
-
-}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,82 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.ui.AbstractUI;
+import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import java.beans.PropertyChangeEvent;
+import java.util.List;
+
+/**
+ * Abstract ConfirmUI handler
+ *
+ * @author chemit
+ */
+public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractUI> {
+
+ protected abstract void updateUI();
+
+ protected abstract void updateMessageUI();
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ }
+ String action = evt.getPropertyName();
+
+ if (VCSUIConstants.ACTION_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+
+ if (VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED.equals(action)) {
+ updateMessageUI();
+ return;
+ }
+
+ throw new IllegalStateException("unimplemented property changed : " + evt);
+ }
+
+ public void doAction(String commitMessage, AbstractVCSEntriesTableModel model) {
+
+ VCSAction action = getModel().getAction();
+
+ List<VCSEntry> entries = model.filter(action, model.getDisplayedEntries(getSelectionModel()));
+
+ if (action.isCommit()) {
+ getModel().addCommitMessage(commitMessage);
+
+ } else {
+ commitMessage = null;
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("action:" + action + ", message:" + commitMessage + ", nb files:" + entries.size());
+ }
+
+ getActionManager().add(action, entries.toArray(new VCSEntry[entries.size()]), commitMessage);
+
+ // dispose ui
+ getUi().dispose();
+
+ }
+
+
+}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,60 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui.handler;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.ui.VCSUIConstants;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
-import org.codelutin.vcs.ui.model.DiffUIModel;
-
-import java.beans.PropertyChangeEvent;
-
-/** @author chemit */
-public abstract class AbstractDiffUIHandler extends AbstractUIHandler<DiffUIModel> {
-
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
- String action = evt.getPropertyName();
-
- if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
- doSelectTab((AbstractVCSEntriesTableModel) evt.getNewValue());
- } else {
- if (VCSUIConstants.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSEntry) evt.getNewValue());
- } else {
- try {
- VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
- doAction(vcsAction, (VCSEntry) evt.getNewValue());
- } catch (IllegalArgumentException e) {
- // ignore ite
- }
- }
- }
- }
-
- public abstract void doSelectTab(AbstractVCSEntriesTableModel action);
-
- public abstract void doSelectFile(VCSEntry model);
-
- public abstract void doAction(VCSAction action, VCSEntry model);
-
- public abstract void gotoNextDiff();
-
- public abstract void gotoPreviousDiff();
-
-}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,67 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractDiffUI;
+import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public abstract class AbstractDiffUIHandler<U extends AbstractDiffUI> extends AbstractTabUIHandler<DiffUIModel, U> {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+
+ String action = evt.getPropertyName();
+ if (VCSUIConstants.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
+ } else {
+ super.propertyChange(evt);
+ }
+ }
+
+ public abstract void doSelectFile(VCSEntry model);
+
+ public abstract void doAction(VCSAction action, VCSEntry model);
+
+ public abstract void gotoNextDiff();
+
+ public abstract void gotoPreviousDiff();
+
+ public void doSelectLocation(VCSEntryLocation location) {
+ log.info(location);
+
+ getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
+ //VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
+ /*List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ } */
+ /*boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);*/
+ }
+}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,52 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui.handler;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
-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();
-
- if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
- doSelectLocation((VCSEntryLocation) evt.getNewValue());
- } else if (action.endsWith("All")) {
- try {
- String actionName = action.substring(0, action.length() - 3);
- VCSAction vcsAction = VCSAction.valueOf(actionName.toUpperCase());
- doAllAction(vcsAction);
- } catch (IllegalArgumentException e) {
- // ignore it ?
- }
- }
- }
-
- //public abstract void doSelectAction(VCSAction action);
-
- public abstract void doAllAction(VCSAction action);
-
- public abstract void doSelectLocation(VCSEntryLocation action);
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,49 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractSynchUI;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.util.ArrayList;
+import java.util.List;
+
+/** @author chemit */
+public abstract class AbstractSynchUIHandler<U extends AbstractSynchUI> extends AbstractTabUIHandler<SynchUIModel, U> {
+
+ public abstract void doAllAction(VCSAction action);
+
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ }
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
+ }
+
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,59 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractTabUI;
+import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.ui.model.AbstractTabUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public abstract class AbstractTabUIHandler<M extends AbstractTabUIModel, U extends AbstractTabUI> extends AbstractUIHandler<M, U> {
+
+ protected abstract void initTab(VCSEntryLocation location);
+
+ @Override
+ public void init() {
+ super.init();
+ initTab(VCSEntryLocation.ALL);
+ initTab(VCSEntryLocation.LOCAL);
+ initTab(VCSEntryLocation.REMOTE);
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ return getUi().getTable(getLocation()).getSelectionModel();
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+ String action = evt.getPropertyName();
+
+ if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
+ doSelectLocation((VCSEntryLocation) evt.getNewValue());
+ }
+ }
+
+ public void doSelectLocation(VCSEntryLocation location) {
+ log.info(location);
+ getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
+
+ }
+
+}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -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.handler;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.runner.VCSActionManager;
-import org.codelutin.vcs.ui.model.AbstractUIModel;
-
-import javax.swing.JDialog;
-import javax.swing.ListSelectionModel;
-import java.beans.PropertyChangeListener;
-
-/** @author chemit */
-public abstract class AbstractUIHandler<M extends AbstractUIModel> implements PropertyChangeListener {
-
- protected static Log log = LogFactory.getLog(AbstractUIHandler.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);
- }
-
- protected VCSActionManager getActionManager() {
- return VCSFactory.getActionManager();
- }
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,53 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.VCSFactory;
+import org.codelutin.vcs.runner.VCSActionManager;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractUI;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeListener;
+
+/** @author chemit */
+public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI> implements PropertyChangeListener {
+
+ protected static Log log = LogFactory.getLog(AbstractUIHandler.class);
+
+ public abstract M getModel();
+
+ public abstract U getUi();
+
+ public abstract ListSelectionModel getSelectionModel();
+
+ public void init() {
+ if (getModel() == null) {
+ throw new IllegalStateException("no model was defined for " + this);
+ }
+ getModel().addPropertyChangeListener(this);
+ }
+
+ public VCSEntryLocation getLocation() {
+ return getModel().getModel().getLocation();
+ }
+
+ protected VCSActionManager getActionManager() {
+ return VCSFactory.getActionManager();
+ }
+}
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,39 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui.handler;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.VCSAction;
-
-import javax.swing.AbstractAction;
-
-/** @author chemit */
-public abstract class VCSAbsractAction extends AbstractAction {
-
- protected static Log log = LogFactory.getLog(VCSAbsractAction.class);
-
- protected VCSAction action;
-
- private static final long serialVersionUID = 1074145285171920255L;
-
- public VCSAbsractAction() {
- }
-
- public void setAction(VCSAction action) {
- this.action = action;
- }
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,39 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.type.VCSAction;
+
+import javax.swing.AbstractAction;
+
+/** @author chemit */
+public abstract class VCSAbsractAction extends AbstractAction {
+
+ protected static Log log = LogFactory.getLog(VCSAbsractAction.class);
+
+ protected VCSAction action;
+
+ private static final long serialVersionUID = 1074145285171920255L;
+
+ public VCSAbsractAction() {
+ }
+
+ public void setAction(VCSAction action) {
+ this.action = action;
+ }
+
+}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model (from rev 371, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model)
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,33 @@
+/**
+ * # #% 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;
+import org.codelutin.vcs.ui.VCSUIConstants;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class AbstractTabUIModel extends AbstractUIModel {
+
+ public void setLocation(VCSEntryLocation location) {
+ VCSEntryLocation oldLocation = getModel().getLocation();
+ getModel().setLocation(location);
+ firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
+ }
+
+}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,113 +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.VCSEntryLocation;
-import org.codelutin.vcs.VCSException;
-
-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 model;
-
- protected AbstractUIModel() {
- model = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
- }
-
- public AbstractVCSEntriesTableModel getModel() {
- return model;
- }
-
- public void populate(VCSConnexion connexion) throws VCSException {
- getModel().populate(connexion, System.nanoTime());
- }
-
- public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location) throws VCSException {
- getModel().populate(connexion, relativeLocalPaths, location, System.nanoTime());
- }
-
- public void populate(VCSEntryLocation location, VCSEntry[] datas) {
- getModel().populate(location, datas);
- }
-
- public void refresh(List<VCSEntry> entries) {
- getModel().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);
- }
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,128 @@
+/**
+ * # #% 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.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.ui.VCSUIConstants;
+
+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);
+
+ /** current action to be fired */
+ protected VCSAction action;
+
+ /** support for change properties support */
+ protected PropertyChangeSupport changeSupport;
+
+ protected final AbstractVCSEntriesTableModel model;
+
+ protected AbstractUIModel() {
+ model = new SimpleVCSEntriesTableModelImpl(getClass().getSimpleName());
+ }
+
+ public AbstractVCSEntriesTableModel getModel() {
+ return model;
+ }
+
+ public void populate(VCSConnexion connexion) throws VCSException {
+ getModel().populate(connexion, System.nanoTime());
+ }
+
+ public void populate(VCSConnexion connexion, List<String> relativeLocalPaths, VCSEntryLocation location) throws VCSException {
+ getModel().populate(connexion, relativeLocalPaths, location, System.nanoTime());
+ }
+
+ public void populate(VCSEntryLocation location, VCSEntry[] datas) {
+ getModel().populate(location, datas);
+ }
+
+ public void refresh(List<VCSEntry> entries) {
+ getModel().refresh(entries, System.nanoTime());
+ }
+
+ public VCSAction getAction() {
+ return action;
+ }
+
+ public void setAction(VCSAction action) {
+ VCSAction oldAction = this.action;
+ this.action = action;
+ firePropertyChange(VCSUIConstants.ACTION_PROPERTY_CHANGED, oldAction, action);
+ }
+
+ 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-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -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.VCSAction;
-import org.codelutin.vcs.VCSConnexion;
-import org.codelutin.vcs.VCSEntries;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.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
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,187 @@
+/*
+* ##% 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.type.VCSAction;
+import org.codelutin.vcs.VCSConnexion;
+import org.codelutin.vcs.VCSEntries;
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.VCSException;
+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-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,65 +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.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
-import static org.codelutin.vcs.ui.VCSUIConstants.ACTION_PROPERTY_CHANGED;
-import static org.codelutin.vcs.ui.VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Model of a repository
- *
- * @author chemit
- */
-public class ConfirmUIModel extends AbstractUIModel {
-
- /** history of commit messages */
- protected List<String> commitMessages;
-
- /** current action to fired */
- protected VCSAction action;
-
- public VCSAction getAction() {
- return action;
- }
-
- public List<String> getCommitMessages() {
- if (commitMessages == null) {
- commitMessages = new ArrayList<String>();
- }
- return commitMessages;
- }
-
- 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) {
- this.action = action;
- model.clear();
- model.populate(location, states);
- // never propagate old action, since need always the property changed
- firePropertyChange(ACTION_PROPERTY_CHANGED, null, action);
- }
-}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,59 @@
+/**
+ * # #% 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 static org.codelutin.vcs.ui.VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class ConfirmUIModel extends AbstractUIModel {
+
+ /** history of commit messages */
+ protected List<String> commitMessages;
+
+
+ public List<String> getCommitMessages() {
+ if (commitMessages == null) {
+ commitMessages = new ArrayList<String>();
+ }
+ return commitMessages;
+ }
+
+ 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) {
+ // always reset action in order to allow propagation of action changed
+ this.action = null;
+ model.clear();
+ model.populate(location, states);
+ setAction(action);
+ }
+
+}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,157 +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.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSHandler;
-
-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 {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- 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
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,157 @@
+/**
+ * # #% 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.type.VCSAction;
+import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.VCSHandler;
+
+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 {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ 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-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,65 +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.VCSAction;
-import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
-
-/**
- * Model of a repository
- *
- * @author chemit
- */
-public class DiffUIModel extends AbstractUIModel {
-
-
- /** current file displayed */
- protected VCSEntry fileModel;
-
- /** current action to fired */
- protected VCSAction action;
-
- private VCSEntryLocation location;
-
- public void setLocation(VCSEntryLocation location) {
- VCSEntryLocation oldLocation = this.location;
- getModel().setLocation(location);
- this.location = location;
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
- }
-
-
- public void setFileModel(VCSEntry fileModel) {
- VCSEntry oldFileModel = this.fileModel;
- this.fileModel = fileModel;
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldFileModel, fileModel);
- }
-
- public void doAllAction(VCSAction action) {
- this.action = action;
- firePropertyChange(action.name().toLowerCase() + "All", null, model);
- }
-
- public void doAction(VCSAction action) {
- this.action = action;
- firePropertyChange(action.name().toLowerCase(), null, model);
- }
-
- public VCSEntryLocation getLocation() {
- return location;
- }
-}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,39 @@
+/**
+ * # #% 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.ui.VCSUIConstants;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class DiffUIModel extends AbstractTabUIModel {
+
+ /** current file displayed */
+ protected VCSEntry fileModel;
+
+ public void setFileModel(VCSEntry fileModel) {
+ VCSEntry oldFileModel = this.fileModel;
+ this.fileModel = fileModel;
+ firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldFileModel, fileModel);
+ }
+
+ public VCSEntry getFileModel() {
+ return fileModel;
+ }
+}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -1,52 +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.VCSState;
-import org.codelutin.vcs.ui.VCSUIConstants;
-
-/** @author chemit */
-public class SimpleVCSEntriesTableModelImpl extends AbstractVCSEntriesTableModel {
-
- private static final long serialVersionUID = -6397327068709720165L;
-
- protected SimpleVCSEntriesTableModelImpl(String name) {
-
- super(name, VCSUIConstants.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;
- }
-
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,52 @@
+/**
+ * # #% 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;
+import org.codelutin.vcs.ui.VCSUIConstants;
+
+/** @author chemit */
+public class SimpleVCSEntriesTableModelImpl extends AbstractVCSEntriesTableModel {
+
+ private static final long serialVersionUID = -6397327068709720165L;
+
+ protected SimpleVCSEntriesTableModelImpl(String name) {
+
+ super(name, VCSUIConstants.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-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -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.model;
-
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
-
-/**
- * Model of a repository
- *
- * @author chemit
- */
-public class SynchUIModel extends AbstractUIModel {
-
- /** current action to be fired */
- protected VCSAction action;
-
- public void setLocation(VCSEntryLocation location) {
- VCSEntryLocation oldLocation = getModel().getLocation();
- getModel().setLocation(location);
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
- }
-
- public void doAllAction(VCSAction action) {
- this.action = action;
- firePropertyChange(action.name().toLowerCase() + "All", null, model);
- }
-
-}
Copied: trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java (from rev 398, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-pre-jaxx/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 13:06:51 UTC (rev 399)
@@ -0,0 +1,32 @@
+/**
+ * # #% 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.VCSAction;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class SynchUIModel extends AbstractTabUIModel {
+
+ public void doAllAction(VCSAction action) {
+
+ setAction(action);
+ firePropertyChange(action.name().toLowerCase() + "All", null, model);
+ }
+
+}
1
0
[Buix-commits] r398 - in trunk/lutinvcs: . lutinvcs-core/src/main/java/org/codelutin/vcs/ui lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model lutinvcs-ui/src/main/java/org/codelutin/vcs/ui lutinvcs-ui/src/test/java/org/codelutin/vcs/ui
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
by tchemitï¼ users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 13:05:53 +0000 (Sun, 06 Apr 2008)
New Revision: 398
Added:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
trunk/lutinvcs/pom.xml
Log:
new module : ui-pre-jaxx
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractDiffUI.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,64 @@
+/**
+ * # #% 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.ui.handler.AbstractDiffUIHandler;
+import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.model.AbstractTabUIModel;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+
+import javax.swing.JButton;
+import javax.swing.JTable;
+
+/** @author chemit */
+public abstract class AbstractDiffUI extends AbstractTabUI {
+
+ public abstract JButton getNextDiff();
+
+ public abstract JButton getPreviousDiff();
+
+ public AbstractDiffUI() {
+ super();
+ }
+
+ public AbstractDiffUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
+ super(handler, model);
+ }
+
+ public DiffUIModel getModel() {
+ return (DiffUIModel) model;
+ }
+
+ protected AbstractDiffUIHandler getHandler() {
+ return (AbstractDiffUIHandler) handler;
+ }
+
+ protected void selectFile(JTable table) {
+ getModel().setFileModel(model.getModel().getDisplayedEntries(table.getSelectionModel()).get(0));
+ }
+
+ protected void doAction(VCSAction action) {
+ getHandler().doAction(action, getModel().getFileModel());
+ }
+
+ protected void gotoNextDiff() {
+ getHandler().gotoNextDiff();
+ }
+
+ protected void gotoPreviousDiff() {
+ getHandler().gotoPreviousDiff();
+ }
+}
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractSynchUI.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,80 @@
+/**
+ * # #% 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.AbstractSynchUIHandler;
+import org.codelutin.vcs.ui.model.SynchUIModel;
+
+import javax.swing.JButton;
+import java.awt.CardLayout;
+
+/** @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();
+
+
+ public AbstractSynchUI() {
+ super();
+ }
+
+ public AbstractSynchUI(AbstractSynchUIHandler handler, SynchUIModel model) {
+ super(handler, model);
+ }
+
+ public SynchUIModel getModel() {
+ return (SynchUIModel) model;
+ }
+
+ protected AbstractSynchUIHandler getHandler() {
+ return (AbstractSynchUIHandler) handler;
+ }
+
+ protected void doAllAction(VCSAction action) {
+ getModel().doAllAction(action);
+ }
+
+ 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);
+ }
+}
\ No newline at end of file
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTabUI.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,95 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui;
+
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.handler.AbstractTabUIHandler;
+import org.codelutin.vcs.ui.model.AbstractTabUIModel;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JToggleButton;
+import java.awt.CardLayout;
+
+/** @author chemit */
+public abstract class AbstractTabUI extends AbstractUI {
+
+ public abstract JToggleButton getAllTab();
+
+ public abstract JToggleButton getLocalTab();
+
+ public abstract JToggleButton getRemoteTab();
+
+ public abstract JScrollPane getAllContent();
+
+ public abstract JScrollPane getLocalContent();
+
+ public abstract JScrollPane getRemoteContent();
+
+ public abstract JTable getAllTable();
+
+ public abstract JTable getLocalTable();
+
+ public abstract JTable getRemoteTable();
+
+ public abstract JPanel getPreview();
+
+ public abstract CardLayout getCardLayout();
+
+ public AbstractTabUI(AbstractTabUIHandler handler, AbstractTabUIModel model) {
+ super(handler, model);
+ }
+
+ public AbstractTabUI() {
+ // for jaxx but never used
+ super();
+ }
+
+ public AbstractTabUIModel getModel() {
+ return (AbstractTabUIModel) model;
+ }
+
+ protected AbstractTabUIHandler getHandler() {
+ return (AbstractTabUIHandler) handler;
+ }
+
+ @Override
+ public void setVisible(boolean b) {
+ if (handler.getLocation() == VCSEntryLocation.UNKNOW) {
+ // first launch, no tab model selected,choose one
+ getAllTab().doClick();
+ }
+ super.setVisible(b);
+ }
+
+ public JTable getTable(VCSEntryLocation modelName) {
+ switch (modelName) {
+ case ALL:
+ return getAllTable();
+ case LOCAL:
+ return getLocalTable();
+ case REMOTE:
+ return getRemoteTable();
+ case UNKNOW:
+ break;
+ }
+ throw new IllegalStateException("no table found for " + modelName);
+ }
+
+ protected void setLocation(VCSEntryLocation location) {
+ getModel().setLocation(location);
+ }
+}
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractUI.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -35,10 +35,6 @@
UIHelper.setQuitAction(this);
}
- public AbstractUI getUi() {
- return this;
- }
-
public AbstractUIModel getModel() {
return model;
}
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractVCSPopup.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,48 @@
+/**
+ * # #% 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.ui.handler.VCSAbsractAction;
+import org.codelutin.vcs.type.VCSAction;
+
+import javax.swing.JMenuItem;
+import java.awt.event.ActionEvent;
+
+/** @author chemit */
+public abstract class AbstractVCSPopup extends javax.swing.JPopupMenu {/* begin raw body code */
+ protected VCSAbsractAction 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();
+
+ protected void setDispatchAction(VCSAbsractAction 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);
+ }
+}
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSInitializer.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,44 @@
+/**
+ * # #% 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.reflect.ClassDescriptorLoader;
+import jaxx.tags.TagManager;
+import jaxx.tags.swing.JPopupMenuHandler;
+import jaxx.tags.swing.JWindowHandler;
+
+import java.beans.Introspector;
+
+public class VCSInitializer implements jaxx.spi.Initializer {
+
+ public void initialize() {
+ String[] searchPath = Introspector.getBeanInfoSearchPath();
+ String[] newSearchPath = new String[searchPath.length + 1];
+ System.arraycopy(searchPath, 0, newSearchPath, 0, searchPath.length);
+ newSearchPath[newSearchPath.length - 1] = "jaxx.beaninfos";
+
+ Introspector.setBeanInfoSearchPath(newSearchPath);
+
+ TagManager.registerTag("org.codelutin.vcs.ui.*", "JVCSPopup", new DefaultObjectHandler(ClassDescriptorLoader.getClassDescriptor(JPopupMenuHandler.class)));
+
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractSynchUI.class), JWindowHandler.class);
+ TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractVCSPopup.class), JPopupMenuHandler.class);
+
+ //TagManager.registerBean(ClassDescriptorLoader.getClassDescriptor(AbstractUI.class), JDialog.class);
+
+ //TagManager.registerDefaultNamespace("AbstractUI", "javax.swing.*");
+
+ }
+}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -26,29 +26,15 @@
n_("lutinvcs.status")
};
- /** model name for synchronize all tab ui */
+ /** model name for synchronize ui */
public static final String SYNCH_MODEL_PROPERTY = "modelSynch";
- public static final String SYNCH_ALL_MODEL_PROPERTY = "modelSynchAll";
-
- /** model name for synchronize local tab ui */
- public static final String SYNCH_LOCAL_MODEL_PROPERTY = "modelSynchLocal";
-
- /** model name for synchronize remote tab ui */
- public static final String SYNCH_REMOTE_MODEL_PROPERTY = "modelSynchRemote";
-
- /** model name for diff all tab ui */
- public static final String DIFF_ALL_MODEL_PROPERTY = "modelDiffAll";
-
- /** model name for diff local tab ui */
- public static final String DIFF_LOCAL_MODEL_PROPERTY = "modelDiffLocal";
-
- /** model name for diff remote tab ui */
- public static final String DIFF_REMOTE_MODEL_PROPERTY = "modelDiffRemote";
-
- /** model name for diff remote tab ui */
+ /** model name for confirm ui */
public static final String CONFIRM_MODEL_PROPERTY = "modelConfirm";
+ /** model name for diff ui */
+ public static final String DIFF_MODEL_PROPERTY = "modelConfirm";
+
public static final String ACTION_PROPERTY_CHANGED = "action";
public static final String MESSAGE_HISTORY_PROPERTY_CHANGED = "historyMessage";
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -14,8 +14,9 @@
*/
package org.codelutin.vcs.ui.handler;
+import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.ui.AbstractUI;
import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
@@ -28,7 +29,7 @@
*
* @author chemit
*/
-public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel> {
+public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel, AbstractUI> {
protected abstract void updateUI();
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -14,41 +14,31 @@
*/
package org.codelutin.vcs.ui.handler;
+import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractDiffUI;
import org.codelutin.vcs.ui.VCSUIConstants;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
import java.beans.PropertyChangeEvent;
/** @author chemit */
-public abstract class AbstractDiffUIHandler extends AbstractUIHandler<DiffUIModel> {
+public abstract class AbstractDiffUIHandler<U extends AbstractDiffUI> extends AbstractTabUIHandler<DiffUIModel, U> {
public void propertyChange(PropertyChangeEvent evt) {
//if (log.isDebugEnabled()) {
log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
//}
+
String action = evt.getPropertyName();
-
- if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
- doSelectTab((AbstractVCSEntriesTableModel) evt.getNewValue());
+ if (VCSUIConstants.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSEntry) evt.getNewValue());
} else {
- if (VCSUIConstants.FILE_PROPERTY_CHANGED.equals(action)) {
- doSelectFile((VCSEntry) evt.getNewValue());
- } else {
- try {
- VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
- doAction(vcsAction, (VCSEntry) evt.getNewValue());
- } catch (IllegalArgumentException e) {
- // ignore ite
- }
- }
+ super.propertyChange(evt);
}
}
- public abstract void doSelectTab(AbstractVCSEntriesTableModel action);
-
public abstract void doSelectFile(VCSEntry model);
public abstract void doAction(VCSAction action, VCSEntry model);
@@ -57,4 +47,21 @@
public abstract void gotoPreviousDiff();
+ public void doSelectLocation(VCSEntryLocation location) {
+ log.info(location);
+
+ getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
+ //VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
+ /*List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
+ } */
+ /*boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);*/
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -16,37 +16,34 @@
import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.ui.AbstractSynchUI;
import org.codelutin.vcs.ui.model.SynchUIModel;
-import java.beans.PropertyChangeEvent;
+import javax.swing.ListSelectionModel;
+import java.util.ArrayList;
+import java.util.List;
/** @author chemit */
-public abstract class AbstractSynchUIHandler extends AbstractUIHandler<SynchUIModel> {
+public abstract class AbstractSynchUIHandler<U extends AbstractSynchUI> extends AbstractTabUIHandler<SynchUIModel, U> {
- public void propertyChange(PropertyChangeEvent evt) {
- //if (log.isDebugEnabled()) {
- log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
- //}
- String action = evt.getPropertyName();
+ public abstract void doAllAction(VCSAction action);
- if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
- doSelectLocation((VCSEntryLocation) evt.getNewValue());
- } else if (action.endsWith("All")) {
- try {
- String actionName = action.substring(0, action.length() - 3);
- VCSAction vcsAction = VCSAction.valueOf(actionName.toUpperCase());
- doAllAction(vcsAction);
- } catch (IllegalArgumentException e) {
- // ignore it ?
- }
+ public void doSelectLocation(VCSEntryLocation location) {
+
+ super.doSelectLocation(location);
+
+ VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
+ List<String> acts = new ArrayList<String>();
+ for (VCSAction action : actions) {
+ acts.add(action.name().toLowerCase());
}
+ boolean hasActions = actions.length > 0;
+ getUi().getDiffAll().setEnabled(hasActions && acts.contains("diff"));
+ getUi().getUpdateAll().setEnabled(hasActions && acts.contains("update"));
+ getUi().getCommitAll().setEnabled(hasActions && acts.contains("commit"));
+ getUi().getRevertAll().setEnabled(hasActions && acts.contains("revert"));
+ getUi().getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
+ getUi().getRefreshAll().setEnabled(hasActions);
}
- //public abstract void doSelectAction(VCSAction action);
-
- public abstract void doAllAction(VCSAction action);
-
- public abstract void doSelectLocation(VCSEntryLocation action);
-
}
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java (from rev 378, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractTabUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,59 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.handler;
+
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractTabUI;
+import org.codelutin.vcs.ui.VCSUIConstants;
+import org.codelutin.vcs.ui.model.AbstractTabUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public abstract class AbstractTabUIHandler<M extends AbstractTabUIModel, U extends AbstractTabUI> extends AbstractUIHandler<M, U> {
+
+ protected abstract void initTab(VCSEntryLocation location);
+
+ @Override
+ public void init() {
+ super.init();
+ initTab(VCSEntryLocation.ALL);
+ initTab(VCSEntryLocation.LOCAL);
+ initTab(VCSEntryLocation.REMOTE);
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ return getUi().getTable(getLocation()).getSelectionModel();
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+ String action = evt.getPropertyName();
+
+ if (VCSUIConstants.TAB_PROPERTY_CHANGED.equals(action)) {
+ doSelectLocation((VCSEntryLocation) evt.getNewValue());
+ }
+ }
+
+ public void doSelectLocation(VCSEntryLocation location) {
+ log.info(location);
+ getUi().getCardLayout().show(getUi().getPreview(), location.name().toLowerCase() + "Content");
+
+ }
+
+}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -18,20 +18,21 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSFactory;
import org.codelutin.vcs.runner.VCSActionManager;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.ui.AbstractUI;
import org.codelutin.vcs.ui.model.AbstractUIModel;
-import javax.swing.JDialog;
import javax.swing.ListSelectionModel;
import java.beans.PropertyChangeListener;
/** @author chemit */
-public abstract class AbstractUIHandler<M extends AbstractUIModel> implements PropertyChangeListener {
+public abstract class AbstractUIHandler<M extends AbstractUIModel, U extends AbstractUI> implements PropertyChangeListener {
protected static Log log = LogFactory.getLog(AbstractUIHandler.class);
public abstract M getModel();
- public abstract JDialog getUi();
+ public abstract U getUi();
public abstract ListSelectionModel getSelectionModel();
@@ -42,6 +43,10 @@
getModel().addPropertyChangeListener(this);
}
+ public VCSEntryLocation getLocation() {
+ return getModel().getModel().getLocation();
+ }
+
protected VCSActionManager getActionManager() {
return VCSFactory.getActionManager();
}
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java (from rev 378, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractTabUIModel.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -0,0 +1,33 @@
+/**
+ * # #% 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;
+import org.codelutin.vcs.ui.VCSUIConstants;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class AbstractTabUIModel extends AbstractUIModel {
+
+ public void setLocation(VCSEntryLocation location) {
+ VCSEntryLocation oldLocation = getModel().getLocation();
+ getModel().setLocation(location);
+ firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
+ }
+
+}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -19,7 +19,9 @@
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.ui.VCSUIConstants;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -31,6 +33,9 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log = LogFactory.getLog(AbstractUIModel.class);
+ /** current action to be fired */
+ protected VCSAction action;
+
/** support for change properties support */
protected PropertyChangeSupport changeSupport;
@@ -60,6 +65,16 @@
getModel().refresh(entries, System.nanoTime());
}
+ public VCSAction getAction() {
+ return action;
+ }
+
+ public void setAction(VCSAction action) {
+ VCSAction oldAction = this.action;
+ this.action = action;
+ firePropertyChange(VCSUIConstants.ACTION_PROPERTY_CHANGED, oldAction, action);
+ }
+
public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
if (listener == null) {
return;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -14,10 +14,9 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
-import static org.codelutin.vcs.ui.VCSUIConstants.ACTION_PROPERTY_CHANGED;
import static org.codelutin.vcs.ui.VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED;
import java.util.ArrayList;
@@ -33,13 +32,7 @@
/** history of commit messages */
protected List<String> commitMessages;
- /** current action to fired */
- protected VCSAction action;
- public VCSAction getAction() {
- return action;
- }
-
public List<String> getCommitMessages() {
if (commitMessages == null) {
commitMessages = new ArrayList<String>();
@@ -56,10 +49,11 @@
}
public void init(VCSAction action, VCSEntryLocation location, VCSEntry[] states) {
- this.action = action;
+ // always reset action in order to allow propagation of action changed
+ this.action = null;
model.clear();
model.populate(location, states);
- // never propagate old action, since need always the property changed
- firePropertyChange(ACTION_PROPERTY_CHANGED, null, action);
+ setAction(action);
}
+
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -14,9 +14,7 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.VCSUIConstants;
/**
@@ -24,42 +22,18 @@
*
* @author chemit
*/
-public class DiffUIModel extends AbstractUIModel {
+public class DiffUIModel extends AbstractTabUIModel {
-
/** current file displayed */
protected VCSEntry fileModel;
- /** current action to fired */
- protected VCSAction action;
-
- private VCSEntryLocation location;
-
- public void setLocation(VCSEntryLocation location) {
- VCSEntryLocation oldLocation = this.location;
- getModel().setLocation(location);
- this.location = location;
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
- }
-
-
public void setFileModel(VCSEntry fileModel) {
VCSEntry oldFileModel = this.fileModel;
this.fileModel = fileModel;
firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldFileModel, fileModel);
}
- public void doAllAction(VCSAction action) {
- this.action = action;
- firePropertyChange(action.name().toLowerCase() + "All", null, model);
+ public VCSEntry getFileModel() {
+ return fileModel;
}
-
- public void doAction(VCSAction action) {
- this.action = action;
- firePropertyChange(action.name().toLowerCase(), null, model);
- }
-
- public VCSEntryLocation getLocation() {
- return location;
- }
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -15,27 +15,17 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.vcs.type.VCSAction;
-import org.codelutin.vcs.type.VCSEntryLocation;
-import org.codelutin.vcs.ui.VCSUIConstants;
/**
* Model of a repository
*
* @author chemit
*/
-public class SynchUIModel extends AbstractUIModel {
+public class SynchUIModel extends AbstractTabUIModel {
- /** current action to be fired */
- protected VCSAction action;
-
- public void setLocation(VCSEntryLocation location) {
- VCSEntryLocation oldLocation = getModel().getLocation();
- getModel().setLocation(location);
- firePropertyChange(VCSUIConstants.TAB_PROPERTY_CHANGED, oldLocation, location);
- }
-
public void doAllAction(VCSAction action) {
- this.action = action;
+
+ setAction(action);
firePropertyChange(action.name().toLowerCase() + "All", null, model);
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -14,48 +14,46 @@
*/
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
-import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.DiffUIModel;
-import javax.swing.ListSelectionModel;
-
/** @author chemit */
-public class DiffUIHandler extends AbstractDiffUIHandler {
+public class DiffUIHandler extends AbstractDiffUIHandler<JDiffUI> {
- protected final JDiffUI ui;
+ protected final AbstractDiffUI ui;
public DiffUIHandler() {
this.ui = new JDiffUI(this);
}
public JDiffUI getUi() {
- return ui;
+ return (JDiffUI) ui;
}
public DiffUIModel getModel() {
return ui.getModel();
}
- public ListSelectionModel getSelectionModel() {
- AbstractVCSEntriesTableModel tabModel = getModel().getModel();
- return tabModel == null ? null : ui.getTable(tabModel.getLocation().name().toLowerCase()).getSelectionModel();
+ protected void initTab(VCSEntryLocation location) {
+ //TODO
}
- public void doSelectTab(AbstractVCSEntriesTableModel action) {
- }
-
public void doSelectFile(VCSEntry model) {
+ //TODO
}
public void doAction(VCSAction action, VCSEntry model) {
+ //TODO
}
public void gotoNextDiff() {
+ //TODO
}
public void gotoPreviousDiff() {
+ //TODO
}
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -1,7 +1,7 @@
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
@@ -15,7 +15,7 @@
import java.util.List;
/** @author chemit */
-public class SynchUIHandler extends AbstractSynchUIHandler {
+public class SynchUIHandler extends AbstractSynchUIHandler<JSynchUI> {
protected final JSynchUI ui;
@@ -27,22 +27,10 @@
return ui;
}
- @Override
- public void init() {
- super.init();
- initTab(VCSEntryLocation.ALL);
- initTab(VCSEntryLocation.LOCAL);
- initTab(VCSEntryLocation.REMOTE);
- }
-
public SynchUIModel getModel() {
return ui.getModel();
}
- public ListSelectionModel getSelectionModel() {
- return ui.getTable(getModel().getModel().getLocation().name().toLowerCase()).getSelectionModel();
- }
-
public void doAllAction(VCSAction action) {
AbstractVCSEntriesTableModel model = getModel().getModel();
log.info(action + " : " + model);
@@ -73,48 +61,27 @@
}
}
-
- public void doSelectLocation(VCSEntryLocation location) {
- log.info(location);
-
- ui.cardLayout.show(ui.preview, location.name().toLowerCase() + "Content");
- VCSAction[] actions = getModel().getModel().getActions((ListSelectionModel) null);
- List<String> acts = new ArrayList<String>();
- for (VCSAction action : actions) {
- acts.add(action.name().toLowerCase());
- }
- boolean hasActions = actions.length > 0;
- ui.getDiffAll().setEnabled(hasActions && acts.contains("diff"));
- ui.getUpdateAll().setEnabled(hasActions && acts.contains("update"));
- ui.getCommitAll().setEnabled(hasActions && acts.contains("commit"));
- ui.getRevertAll().setEnabled(hasActions && acts.contains("revert"));
- ui.getDeleteAll().setEnabled(hasActions && acts.contains("delete"));
- ui.getRefreshAll().setEnabled(hasActions);
- }
-
- private void initTab(VCSEntryLocation location) {
- String s = location.name().toLowerCase();
- JTable table = ui.getTable(s);
+ protected void initTab(VCSEntryLocation location) {
+ JTable table = getUi().getTable(location);
AbstractVCSEntriesTableModel fileStatesModel = getModel().getModel();
table.setModel(fileStatesModel);
- table.addMouseListener(new ListMouseListener(ui, fileStatesModel, s));
- JVCSPopup jvcsPopup = ui.getPopup(s);
+ table.addMouseListener(new ListMouseListener(ui, fileStatesModel, location));
+ AbstractVCSPopup jvcsPopup = getUi().getPopup(location);
jvcsPopup.setDispatchAction(new VCSPopupAction(ui, location));
}
- private class ListMouseListener extends MouseAdapter {
+ protected static class ListMouseListener extends MouseAdapter {
private final AbstractVCSEntriesTableModel model;
private final ListSelectionModel selectionModel;
private final JTable jTable;
- private final JVCSPopup jPopupMenu;
+ private final AbstractVCSPopup jPopupMenu;
- public ListMouseListener(JSynchUI ui, AbstractVCSEntriesTableModel model, String modelName) {
+ public ListMouseListener(AbstractSynchUI ui, AbstractVCSEntriesTableModel model, VCSEntryLocation modelName) {
this.model = model;
jPopupMenu = ui.getPopup(modelName);
-
jTable = ui.getTable(modelName);
selectionModel = jTable.getSelectionModel();
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -35,16 +35,16 @@
protected VCSEntryLocation location;
protected transient ListSelectionModel selectionModel;
- protected transient JSynchUI ui;
+ protected transient AbstractTabUI ui;
protected AbstractVCSEntriesTableModel tableModel;
- public VCSPopupAction(JSynchUI ui, VCSEntryLocation location) {
+ public VCSPopupAction(AbstractTabUI ui, VCSEntryLocation location) {
super();
this.ui = ui;
this.location = location;
//this.selectionModel = ui.getHandler().getSelectionModel();
- this.selectionModel = ui.getTable(location.name().toLowerCase()).getSelectionModel();
+ this.selectionModel = ui.getTable(location).getSelectionModel();
tableModel = ui.getModel().getModel();
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -28,16 +28,16 @@
protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
- protected static JSynchUI synchUI;
- protected static JDiffUI diffUI;
+ protected static AbstractTabUI synchUI;
+ protected static AbstractDiffUI diffUI;
protected static JConfirmUI confirmUI;
- public static JSynchUI newSynchUI() {
+ public static AbstractSynchUI newSynchUI() {
SynchUIHandler result = newHandler(SynchUIHandler.class);
return result.getUi();
}
- public static JDiffUI newDiffUI() {
+ public static AbstractDiffUI newDiffUI() {
DiffUIHandler result = newHandler(DiffUIHandler.class);
return result.getUi();
}
Modified: trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 13:05:53 UTC (rev 398)
@@ -44,7 +44,7 @@
try {
connexion.open();
- JSynchUI ui = VCSUIFactory.newSynchUI();
+ AbstractSynchUI ui = VCSUIFactory.newSynchUI();
fillSynchModel(connexion, ui.getModel(), 20, "trunk", "local/", "remote/");
Modified: trunk/lutinvcs/pom.xml
===================================================================
--- trunk/lutinvcs/pom.xml 2008-04-06 13:05:33 UTC (rev 397)
+++ trunk/lutinvcs/pom.xml 2008-04-06 13:05:53 UTC (rev 398)
@@ -24,6 +24,7 @@
<module>lutinvcs-provider-mock</module>
<module>lutinvcs-provider-cvs</module>
<module>lutinvcs-provider-svn</module>
+ <module>lutinvcs-ui-pre-jaxx</module>
<module>lutinvcs-ui-jaxx</module>
<module>lutinvcs-ui</module>
</modules>
@@ -215,6 +216,11 @@
</dependency>
<dependency>
<groupId>lutinlib.vcs</groupId>
+ <artifactId>lutinvcs-ui-pre-jaxx</artifactId>
+ <version>${current.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>lutinlib.vcs</groupId>
<artifactId>lutinvcs-ui-jaxx</artifactId>
<version>${current.version}</version>
</dependency>
1
0