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
- 3940 discussions
[Buix-commits] r309 - trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:04:28 +0000 (Thu, 03 Apr 2008)
New Revision: 309
Removed:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/
Log:
uis
1
0
[Buix-commits] r308 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:04:04 +0000 (Thu, 03 Apr 2008)
New Revision: 308
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties
Log:
uis
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties 2008-04-03 17:02:06 UTC (rev 307)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-en_GB.properties 2008-04-03 17:04:04 UTC (rev 308)
@@ -1,3 +1,4 @@
+lutinvcs.accept=Accept
lutinvcs.action.commit=commit
lutinvcs.action.delete=delete
lutinvcs.action.diff=show diff
@@ -2,9 +3,12 @@
lutinvcs.action.refresh=refresh
-lutinvcs.action.revert=revert selected files
+lutinvcs.action.revert=revert
lutinvcs.action.tooltip.commit=commit selected files
lutinvcs.action.tooltip.commitAll=commit all files
lutinvcs.action.tooltip.delete=delete
lutinvcs.action.tooltip.deleteAll=delete all files
-lutinvcs.action.tooltip.diff=show diff for selected files
+lutinvcs.action.tooltip.diff=show diff of selected files
lutinvcs.action.tooltip.diffAll=show diff of all files
+lutinvcs.action.tooltip.lastMessages=
+lutinvcs.action.tooltip.nextDiff=next diff
+lutinvcs.action.tooltip.previousDiff=previous diff
lutinvcs.action.tooltip.refresh=refresh selected files
@@ -16,9 +20,15 @@
lutinvcs.action.tooltip.update=update selected files
lutinvcs.action.tooltip.updateAll=update all files
lutinvcs.action.update=update
-lutinvcs.quit=Quit
+lutinvcs.commit.message=Please fill a message for your commit
+lutinvcs.confirm.message=Message TODO
+lutinvcs.confirm.title=Confirm UI
+lutinvcs.diff.title=Diff UI
lutinvcs.synch.title=Synch
lutinvcs.tabs.all=all
+lutinvcs.tabs.diff.tooltip.all=both local and remote modifed files
+lutinvcs.tabs.diff.tooltip.local=only local modified files
+lutinvcs.tabs.diff.tooltip.remote=only remote modified files
lutinvcs.tabs.local=local
lutinvcs.tabs.remote=remote
lutinvcs.tabs.tooltip.all=Show all files (local and remote)
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties 2008-04-03 17:02:06 UTC (rev 307)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/resources/i18n/lutinvcs-ui-jaxx-fr_FR.properties 2008-04-03 17:04:04 UTC (rev 308)
@@ -1,3 +1,4 @@
+lutinvcs.accept=Accepter
lutinvcs.action.commit=committer
lutinvcs.action.delete=supprimer
lutinvcs.action.diff=voir les diff
@@ -7,18 +8,27 @@
lutinvcs.action.tooltip.commitAll=commiter tous les fichiers
lutinvcs.action.tooltip.delete=supprimer les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.deleteAll=supprimer tous les fichiers
-lutinvcs.action.tooltip.diff=voir les diff\u00E9rences des fichiers s\u00E9lectionn\u00E9s
+lutinvcs.action.tooltip.diff=voir tous les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.diffAll=voir les diff\u00E9rences de tous les fichiers
-lutinvcs.action.tooltip.refresh=rafra\u00EEchir
+lutinvcs.action.tooltip.lastMessages=
+lutinvcs.action.tooltip.nextDiff=voir la prochaine diff\u00E9rence
+lutinvcs.action.tooltip.previousDiff=voir la diff\u00E9rence pr\u00E9c\u00E9dente
+lutinvcs.action.tooltip.refresh=rafra\u00EEchir tous les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.refreshAll=rafra\u00EEchir tous les fichiers
lutinvcs.action.tooltip.revert=annuler les modifications sur les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.revertAll=annuler les modifications sur tous les fichiers
lutinvcs.action.tooltip.update=mettre \u00E0 jour les fichiers s\u00E9lectionn\u00E9s
lutinvcs.action.tooltip.updateAll=mettre \u00E0 jour tous les fichiers
lutinvcs.action.update=mettre \u00E0 jour
-lutinvcs.quit=Quitter
+lutinvcs.commit.message=Renseigner le message de commit
+lutinvcs.confirm.message=Message TODO
+lutinvcs.confirm.title=Confirm UI
+lutinvcs.diff.title=Diff UI
lutinvcs.synch.title=Synchronisation
lutinvcs.tabs.all=all
+lutinvcs.tabs.diff.tooltip.all=voir tous les fichiers modifi\u00E9s
+lutinvcs.tabs.diff.tooltip.local=voir les fichiers locaux modifi\u00E9es
+lutinvcs.tabs.diff.tooltip.remote=voir les fichiers distants modifi\u00E9s
lutinvcs.tabs.local=local
lutinvcs.tabs.remote=remote
lutinvcs.tabs.tooltip.all=voir tous les fichiers modifi\u00E9s localement ou \u00E0 distance
1
0
[Buix-commits] r307 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:02:06 +0000 (Thu, 03 Apr 2008)
New Revision: 307
Added:
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/JDiffPanelUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
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/JVCSPopup.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css
Log:
uis
Copied: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx (from rev 298, 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/JConfirmUI.jaxx (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -0,0 +1,93 @@
+<JDialog title='lutinvcs.confirm.title' id='ui' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'>
+ <style source="common.css"/>
+ <script>
+
+ import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.ui.action.AbstractConfirmUIHandler;
+
+ protected AbstractConfirmUIHandler handler;
+
+ public JConfirmUI(AbstractConfirmUIHandler handler) {
+ this.handler =handler;
+ JRootPane rootPane = ui.getRootPane();
+ //rootPane.setDefaultButton(accept);
+
+ Action quitAction = new AbstractAction("cancel") {
+ private static final long serialVersionUID = -869095664995763057L;
+ public void actionPerformed(ActionEvent e) {
+ ui.dispose();
+ }
+ };
+
+ Action acceptAction= new AbstractAction("accept") {
+ private static final long serialVersionUID = -869095664995763055L;
+ public void actionPerformed(ActionEvent e) {
+ model.doAction(commitMessage.getText());
+ }
+ };
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"),"quit");
+ rootPane.getActionMap().put("quit", quitAction);
+ accept.setAction((acceptAction));
+ }
+
+ protected AbstractConfirmUIHandler getHandler() {
+ return handler;
+ }
+
+ protected void showLastMessages() {
+
+ }
+ </script>
+
+ <org.codelutin.vcs.ui.model.ConfirmUIModel id="model"/>
+
+
+ <Table>
+ <row fill='both'>
+ <cell fill='both'>
+ <JLabel id="actionLabel" text="lutinvcs.confirm.message"/>
+ </cell>
+ </row>
+
+ <row fill='both'>
+ <cell fill='both' weightx='1'>
+ <Table id="toolbar" fill='both'>
+ <row>
+ <cell fill='both'>
+ <JLabel id="actionCommitLabel" text="lutinvcs.commit.message"/>
+ </cell>
+ <cell fill='both'>
+ <JLabel/>
+ </cell>
+ <cell fill='horizontal' anchor='east'>
+ <JButton id='lastMessages' toolTipText="lutinvcs.action.tooltip.lastMessages"
+ icon='{createImageIcon("recent_messages.png")}'
+ onActionPerformed='showLastMessages()'/>
+ </cell>
+ </row>
+ <row fill='both'>
+ <cell fill='both' columns='3' weightx='1' weighty='1'>
+ <JScrollPane id="commitScroll" height='60' verticalScrollBarPolicy="20">
+ <!--JScrollPane id="commitScroll" verticalScrollBarPolicy="20" columnHeaderView="{toolbar}"-->
+ <JTextArea id="commitMessage" constructorParams="4,50"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+
+ <row>
+ <cell fill='both' weightx='1' weighty='1'>
+ <JScrollPane id='content' styleClass='confirmScroll'>
+ <JTable id="contentTable" styleClass='confirmTable' model="{model.getModel()}"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='both'>
+ <JButton id='accept' text='lutinvcs.accept'/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
Added: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffPanelUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffPanelUI.jaxx (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffPanelUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -0,0 +1,15 @@
+<!--Table>
+ <style source="common.css"/>
+ <row fill='both'>
+ <cell fill='both' weightx='1'-->
+<JSplitPane id='splitPane2' orientation='horizontal' oneTouchExpandable='true'>
+ <JScrollPane id='remoteScroll' styleClass='updateScroll'>
+ <JTextArea id="remoteContent"/>
+ </JScrollPane>
+ <JScrollPane id='localScroll' styleClass='updateScroll'>
+ <JTextArea id="localContent"/>
+ </JScrollPane>
+</JSplitPane>
+ <!--/cell>
+ </row>
+</Table-->
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -0,0 +1,156 @@
+<JDialog title='lutinvcs.diff.title' id='diffui' defaultCloseOperation='DISPOSE_ON_CLOSE'>
+ <style source="common.css"/>
+ <script>
+
+ import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.ui.action.AbstractDiffUIHandler;
+ import org.codelutin.vcs.ui.VCSUIConstants;
+
+ protected AbstractDiffUIHandler handler;
+
+ public JTable getTable(String modelName) {
+ return (JTable) get$objectMap().get(modelName+"Table");
+ }
+
+ @Override
+ public void setVisible(boolean b) {
+ if (getHandler().getModel().getTabModel() == null) {
+ // first launch, no tab model selected,choose one
+ selectTab(VCSUIConstants.DIFF_ALL_MODEL_PROPERTY);
+ }
+ super.setVisible(b);
+ }
+
+ public JDiffUI(AbstractDiffUIHandler handler) {
+ this.handler =handler;
+ }
+
+ protected AbstractDiffUIHandler getHandler() {
+ return handler;
+ }
+
+ protected void setHandler(AbstractDiffUIHandler handler) {
+ this.handler = handler;
+ }
+
+ protected void selectTab(String tabname) {
+ model.setTabModel(model.getModel(tabname));
+ }
+
+ protected void selectFile(JTable table) {
+ model.setFileModel(model.getTabModel().getData(table.getSelectionModel())[0]);
+ }
+
+ protected void doAction(VCSAction action) {
+ model.doAction(action);
+ }
+
+ protected void gotoNextDiff() {
+ handler.gotoNextDiff();
+ }
+
+ protected void gotoPreviousDiff() {
+ handler.gotoPreviousDiff();
+ }
+
+ Action quitAction;
+ JRootPane rootPane = diffui.getRootPane();
+ //rootPane.setDefaultButton(quit);
+ quitAction = new AbstractAction("quit") {
+ private static final long serialVersionUID = -869095664995763057L;
+ public void actionPerformed(ActionEvent e) {
+ diffui.dispose();
+ }
+ };
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"),"quit");
+ rootPane.getActionMap().put("quit", quitAction);
+ </script>
+
+ <org.codelutin.vcs.ui.model.DiffUIModel id="model"/>
+
+ <java.awt.CardLayout id='cardLayout'/>
+
+ <Table>
+ <row fill='both'>
+ <cell fill='both' weightx='1'>
+ <JToolBar>
+ <JToggleButton id='allTab' selected='true' buttonGroup='tabs' mnemonic="A"
+ toolTipText="lutinvcs.tabs.diff.tooltip.all"
+ icon='{createImageIcon("remote_vs_local.png")}'
+ onActionPerformed='selectTab("modelSynchAll")'/>
+ <JToggleButton id='localTab' selected='false' buttonGroup='tabs' mnemonic="L"
+ toolTipText="lutinvcs.tabs.diff.tooltip.local"
+ icon='{createImageIcon("local_vs_local.png")}'
+ onActionPerformed='selectTab("modelSynchLocal")'/>
+ <JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' mnemonic="R"
+ icon='{createImageIcon("remote_vs_remote.png")}'
+ toolTipText="lutinvcs.tabs.diff.tooltip.remote"
+ onActionPerformed='selectTab("modelSynchRemote")'/>
+
+
+ <JButton id='nextDiff' toolTipText="lutinvcs.action.tooltip.nextDiff"
+ icon='{createImageIcon("diff-next.png")}' onActionPerformed='gotoNextDiff()'/>
+
+ <JButton id='previousDiff' toolTipText="lutinvcs.action.tooltip.previousDiff"
+ icon='{createImageIcon("diff-previous.png")}' onActionPerformed='gotoPreviousDiff()'/>
+
+ <JButton id='refresh' toolTipText="lutinvcs.action.tooltip.refresh"
+ icon='{createImageIcon("autoRefresh.png")}'
+ onActionPerformed='doAction(VCSAction.REFRESH)'/>
+
+ <JButton id='update' toolTipText="lutinvcs.action.tooltip.update"
+ icon='{createImageIcon("update.png")}'
+ onActionPerformed='doAction(VCSAction.UPDATE)'/>
+
+ <JButton id='commit' toolTipText="lutinvcs.action.tooltip.commit"
+ icon='{createImageIcon("commit.png")}'
+ onActionPerformed='doAction(VCSAction.COMMIT)'/>
+
+ <JButton id='revert' toolTipText="lutinvcs.action.tooltip.revert"
+ icon='{createImageIcon("rollback.png")}'
+ onActionPerformed='doAction(VCSAction.REVERT)'/>
+
+ <JButton id='delete' toolTipText="lutinvcs.action.tooltip.delete"
+ icon='{createImageIcon("remove.png")}'
+ onActionPerformed='doAction(VCSAction.DELETE)'/>
+ </JToolBar>
+ </cell>
+ </row>
+ <row fill='both'>
+ <cell fill='both' weighty='1' weightx='2'>
+ <JPanel id='preview' layout='{cardLayout}'>
+ <JScrollPane id='allContent' styleClass='diffScroll' constraints='"modelSynchAll"'>
+ <JTable id="modelDiffAllTable" styleClass='diffTable'
+ onMouseClicked="selectFile(modelDiffAllTable)"/>
+ </JScrollPane>
+ <JScrollPane id='localContent' styleClass='diffScroll' constraints='"modelSynchLocal"'>
+ <JTable id="modelDiffLocalTable" styleClass='diffTable'
+ onMouseClicked="selectFile(modelDiffLocalTable)"/>
+ </JScrollPane>
+ <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"modelSynchRemote"'
+ onMouseClicked="selectFile(modelDiffRemoteTable)">
+ <JTable id="modelDiffRemoteTable" styleClass='diffTable'/>
+ </JScrollPane>
+ </JPanel>
+ </cell>
+ </row>
+ <!--row>
+ <cell fill='both'>
+ <JToolBar>
+ <Table insets='0,0,0,0'>
+ <row fill='both' anchor='west'>
+ <cell fill='both' weightx='2'>
+ <JLabel id="label"/>
+ </cell>
+ </row>
+ <row fill='both' anchor='east'>
+ <cell fill='both'>
+ <JProgressBar id="progress"/>
+ </cell>
+ </row>
+ </Table>
+ </JToolBar>
+ </cell>
+ </row-->
+ </Table>
+</JDialog>
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-03 17:01:51 UTC (rev 306)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -18,9 +18,8 @@
@Override
public void setVisible(boolean b) {
if (getHandler().getModel().getTabModel() == null) {
- getHandler().init();
// first launch, no tab model selected,choose one
- selectTab(VCSUIConstants.ALL_MODEL_PROPERTY);
+ selectTab(VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY);
}
super.setVisible(b);
}
@@ -47,8 +46,7 @@
Action quitAction;
JRootPane rootPane = ui.getRootPane();
- rootPane.setDefaultButton(quit);
- quitAction = new AbstractAction(quit.getText()) {
+ quitAction = new AbstractAction("quit") {
private static final long serialVersionUID = -869095664995763057L;
public void actionPerformed(ActionEvent e) {
ui.dispose();
@@ -121,11 +119,11 @@
</JPanel>
</cell>
</row>
- <row>
+ <!--row>
<cell fill='both'>
<JButton id='quit' text='lutinvcs.quit' action='{quitAction}'/>
</cell>
- </row>
+ </row-->
<!--row>
<cell fill='both'>
<JToolBar>
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-03 17:01:51 UTC (rev 306)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-03 17:02:06 UTC (rev 307)
@@ -1,4 +1,4 @@
-<JPopupMenu enabled='false'>
+<JPopupMenu>
<script>
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.ui.action.VCSAbsractAction;
@@ -14,17 +14,23 @@
ActionEvent e = new ActionEvent( item,1,action.name());
dispatchAction.actionPerformed(e);
}
+ add(refresh);
+ add(diff);
+ add(update);
+ add(commit);
+ add(revert);
+ add(delete);
</script>
- <JMenuItem id='refresh' text="lutinvcs.action.refresh" toolTipText="lutinvcs.action.tooltip.refresh"
+ <JMenuItem id='refresh' text='{_("lutinvcs.action.refresh")}' toolTipText='{_("lutinvcs.action.tooltip.refresh")}'
icon='{createImageIcon("autoRefresh.png")}' onActionPerformed='doAction(VCSAction.REFRESH,refresh)'/>
- <JMenuItem id='diff' text="lutinvcs.action.diff" toolTipText="lutinvcs.action.tooltip.diff"
+ <JMenuItem id='diff' text='{_("lutinvcs.action.diff")}' toolTipText='{_("lutinvcs.action.tooltip.diff")}'
icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,diff)'/>
- <JMenuItem id='update' text="lutinvcs.action.update" toolTipText="lutinvcs.action.tooltip.update"
+ <JMenuItem id='update' text='{_("lutinvcs.action.update")}' toolTipText='{_("lutinvcs.action.tooltip.update")}'
icon='{createImageIcon("update.png")}' onActionPerformed='doAction(VCSAction.UPDATE,update)'/>
- <JMenuItem id='commit' text="lutinvcs.action.commit" toolTipText="lutinvcs.action.tooltip.commit"
+ <JMenuItem id='commit' text='{_("lutinvcs.action.commit")}' toolTipText='{_("lutinvcs.action.tooltip.commit")}'
icon='{createImageIcon("commit.png")}' onActionPerformed='doAction(VCSAction.COMMIT,commit)'/>
- <JMenuItem id='revert' text="lutinvcs.action.revert" toolTipText="lutinvcs.action.tooltip.revert"
+ <JMenuItem id='revert' text='{_("lutinvcs.action.revert")}' toolTipText='{_("lutinvcs.action.tooltip.revert")}'
icon='{createImageIcon("rollback.png")}' onActionPerformed='doAction(VCSAction.REVERT,revert)'/>
- <JMenuItem id='delete' text="lutinvcs.action.delete" toolTipText="lutinvcs.action.tooltip.delete"
+ <JMenuItem id='delete' text='{_("lutinvcs.action.delete")}' toolTipText='{_("lutinvcs.action.tooltip.delete")}'
icon='{createImageIcon("remove.png")}' onActionPerformed='doAction(VCSAction.DELETE,delete)'/>
-</JPopupMenu>
+</JPopupMenu>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css 2008-04-03 17:01:51 UTC (rev 306)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/common.css 2008-04-03 17:02:06 UTC (rev 307)
@@ -42,7 +42,6 @@
}
;
-
}
.updateScroll {
1
0
[Buix-commits] r306 - in trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui: . action
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:01:51 +0000 (Thu, 03 Apr 2008)
New Revision: 306
Added:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.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/VCSPopupAction.java
Removed:
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java
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/VCSUIFactory.java
Log:
implantations d'handler d'ui
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -0,0 +1,58 @@
+/**
+ * # #% 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.VCSAction;
+import org.codelutin.vcs.ui.action.AbstractConfirmUIHandler;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public class ConfirmUIHandler extends AbstractConfirmUIHandler {
+
+ protected final JConfirmUI ui;
+
+ public ConfirmUIHandler() {
+ super();
+ this.ui = new JConfirmUI(this);
+ }
+
+ public ConfirmUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public JConfirmUI getUi() {
+ return ui;
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ JTable table = ui.getContentTable();
+ return table.getSelectionModel();
+ }
+
+ protected void updateUI() {
+ VCSAction action = ui.getModel().getAction();
+ ui.getAccept().setText(action.getLibelle());
+ ui.getToolbar().setVisible(action.isCommit());
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ super.propertyChange(evt);
+
+ }
+}
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -0,0 +1,63 @@
+/**
+ * # #% 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.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.action.AbstractDiffUIHandler;
+import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
+
+import javax.swing.ListSelectionModel;
+
+/** @author chemit */
+public class DiffUIHandler extends AbstractDiffUIHandler {
+
+ protected final JDiffUI ui;
+
+ public DiffUIHandler() {
+ super();
+ this.ui = new JDiffUI(this);
+ }
+
+ public JDiffUI getUi() {
+ return ui;
+ }
+
+ public DiffUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public ListSelectionModel getSelectionModel() {
+ AbstractVCSFileStatesModel tabModel = getModel().getTabModel();
+ return tabModel == null ? null : ui.getTable(tabModel.getName()).getSelectionModel();
+ }
+
+ public void doSelectTab(SimpleVCSFileStatesModel action) {
+ }
+
+ public void doSelectFile(VCSFileState model) {
+ }
+
+ public void doAction(VCSAction action, VCSFileState model) {
+ }
+
+ public void gotoNextDiff() {
+ }
+
+ public void gotoPreviousDiff() {
+ }
+}
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-03 17:01:40 UTC (rev 305)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -3,10 +3,9 @@
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSFileState;
import org.codelutin.vcs.ui.action.AbstractSynchUIHandler;
-import org.codelutin.vcs.ui.action.VCSPopupAction;
import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.ui.model.SynchVCSFileStatesModel;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
@@ -15,6 +14,7 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/** @author chemit */
@@ -22,35 +22,33 @@
protected final JSynchUI ui;
- public SynchUIHandler(JSynchUI ui) {
+ public SynchUIHandler() {
super();
- this.ui = ui;
+ this.ui = new JSynchUI(this);
}
+ public JSynchUI getUi() {
+ return ui;
+ }
+
@Override
public void init() {
super.init();
- initTab(VCSUIConstants.ALL_MODEL_PROPERTY);
- initTab(VCSUIConstants.LOCAL_MODEL_PROPERTY);
- initTab(VCSUIConstants.REMOTE_MODEL_PROPERTY);
+ initTab(VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY);
+ initTab(VCSUIConstants.SYNCH_LOCAL_MODEL_PROPERTY);
+ initTab(VCSUIConstants.SYNCH_REMOTE_MODEL_PROPERTY);
}
- private void initTab(String modelName) {
- JTable table = ui.getTable(modelName);
- SynchVCSFileStatesModel fileStatesModel = getModel().getModel(modelName);
- table.setModel(fileStatesModel);
- table.getSelectionModel().addListSelectionListener(this);
- table.addMouseListener(new ListMouseListener(ui, fileStatesModel));
- JVCSPopup jvcsPopup = ui.getPopup(modelName);
- jvcsPopup.setInvoker(table);
- jvcsPopup.setDispatchAction(new VCSPopupAction(ui, modelName));
- }
-
public SynchUIModel getModel() {
return ui.getModel();
}
- public void doAllAction(VCSAction action, SynchVCSFileStatesModel model) {
+ public ListSelectionModel getSelectionModel() {
+ AbstractVCSFileStatesModel tabModel = getModel().getTabModel();
+ return tabModel == null ? null : ui.getTable(tabModel.getName()).getSelectionModel();
+ }
+
+ public void doAllAction(VCSAction action, SimpleVCSFileStatesModel model) {
log.info(action + " : " + model);
JTable table = ui.getTable(model.getName());
ListSelectionModel selectionModel = table.getSelectionModel();
@@ -66,7 +64,7 @@
}
}
- public void doSelectAction(VCSAction action, SynchVCSFileStatesModel model) {
+ public void doSelectAction(VCSAction action, SimpleVCSFileStatesModel model) {
log.info(action + " : " + model);
JTable table = ui.getTable(model.getName());
ListSelectionModel selectionModel = table.getSelectionModel();
@@ -74,12 +72,19 @@
// nothing to do
return;
}
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ return;
+ }
VCSFileState[] states = model.getData(selectionModel);
log.info("files to treate :" + states.length);
-
+ JConfirmUI confirmUI = VCSUIFactory.newConfirmUI(Arrays.asList(states));
+ confirmUI.getModel().setAction(action);
+ confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, states.length - 1);
+ confirmUI.setVisible(true);
}
- public void doSelectTabAction(SynchVCSFileStatesModel model) {
+ public void doSelectTabAction(SimpleVCSFileStatesModel model) {
log.info(model);
String tabModelName = model.getName();
@@ -105,10 +110,22 @@
}
}
+ private void initTab(String modelName) {
+ JTable table = ui.getTable(modelName);
+ SimpleVCSFileStatesModel fileStatesModel = getModel().getModel(modelName);
+ table.setModel(fileStatesModel);
+ table.getSelectionModel().addListSelectionListener(this);
+ table.addMouseListener(new ListMouseListener(ui, fileStatesModel));
+ JVCSPopup jvcsPopup = ui.getPopup(modelName);
+ jvcsPopup.setDispatchAction(new VCSPopupAction(ui, modelName));
+ }
+
private class ListMouseListener extends MouseAdapter {
private final AbstractVCSFileStatesModel model;
+
private final ListSelectionModel selectionModel;
+
private final JTable jTable;
private final JVCSPopup jPopupMenu;
@@ -127,13 +144,17 @@
@Override
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
- initPopup(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
}
@Override
public void mouseReleased(MouseEvent e) {
super.mouseReleased(e);
- initPopup(e);
+ if (e.isPopupTrigger()) {
+ initPopup(e.getX(), e.getY());
+ }
}
@Override
@@ -141,8 +162,8 @@
// nothing to do
}
- protected void initPopup(MouseEvent e) {
- if (e.isPopupTrigger() && !selectionModel.isSelectionEmpty()) {
+ protected void initPopup(int x, int y) {
+ if (!selectionModel.isSelectionEmpty()) {
List<String> acts = new ArrayList<String>();
for (VCSAction action : model.getActions(selectionModel)) {
acts.add(action.name().toLowerCase());
@@ -154,8 +175,9 @@
jPopupMenu.getRevert().setEnabled(hasActions && acts.contains("revert"));
jPopupMenu.getDelete().setEnabled(hasActions && acts.contains("delete"));
jPopupMenu.getRefresh().setEnabled(hasActions);
+ jPopupMenu.pack();
// display popup
- jPopupMenu.show(jTable, e.getX(), e.getY());
+ jPopupMenu.show(jTable, x, y);
}
}
}
Copied: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java (from rev 299, trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -0,0 +1,61 @@
+/**
+ * # #% 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.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.action.VCSAbsractAction;
+import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+
+import javax.swing.ListSelectionModel;
+import java.awt.event.ActionEvent;
+import java.util.Arrays;
+
+/**
+ * Action of a clik inside the popup menu
+ *
+ * @author chemit
+ */
+public class VCSPopupAction extends VCSAbsractAction {
+ private static final long serialVersionUID = -1983061535956510913L;
+
+ protected AbstractVCSFileStatesModel model;
+ protected transient ListSelectionModel selectionModel;
+
+ public VCSPopupAction(JSynchUI ui, String modelName) {
+ super(ui.getModel().getHandler());
+ this.model = ui.getModel().getModel(modelName);
+ this.selectionModel = ui.getTable(modelName).getSelectionModel();
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ // select only lines for this action inside already selected lines
+ model.select(action, selectionModel, false);
+ // obtain thoses lines
+ VCSFileState[] states = model.getData(selectionModel);
+ log.info("action: " + action + ", files to treate :" + states.length);
+ if (action == VCSAction.DIFF) {
+ // show diff ui
+ } else if (action == VCSAction.REFRESH) {
+ // refresh ui, and update list if needed
+ } else {
+ // show confirm action ui
+ JConfirmUI confirmUI = VCSUIFactory.newConfirmUI(Arrays.asList(states));
+ confirmUI.getModel().setAction(action);
+ confirmUI.getHandler().getSelectionModel().setSelectionInterval(0, states.length - 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-03 17:01:40 UTC (rev 305)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSUIFactory.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -15,20 +15,69 @@
package org.codelutin.vcs.ui;
import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.action.AbstractUIHandler;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/** @author chemit */
public class VCSUIFactory {
- static JSynchUI synchUI;
+ protected static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> cache;
+ public static Map<Class<? extends AbstractUIHandler>, AbstractUIHandler> getCache() {
+ if (cache == null) {
+ cache = new HashMap<Class<? extends AbstractUIHandler>, AbstractUIHandler>();
+ }
+ return cache;
+ }
+
+ protected static JSynchUI synchUI;
+ protected static JDiffUI diffUI;
+ protected static JConfirmUI confirmUI;
+
public static JSynchUI newSynchUI(List<VCSFileState> states) {
- if (synchUI == null) {
- synchUI = new JSynchUI();
- synchUI.setHandler(new SynchUIHandler(synchUI));
+ SynchUIHandler result = newHandler(SynchUIHandler.class, states);
+ return result.getUi();
+ }
+
+ public static JDiffUI newDiffUI(List<VCSFileState> states) {
+ DiffUIHandler result = newHandler(DiffUIHandler.class, states);
+ return result.getUi();
+ }
+
+ public static JConfirmUI newConfirmUI(List<VCSFileState> states) {
+ ConfirmUIHandler result = newHandler(ConfirmUIHandler.class, states);
+ return result.getUi();
+ }
+
+ public static void close() {
+ if (cache != null) {
+ cache.clear();
}
- synchUI.getModel().setData(states);
- return synchUI;
+ cache = null;
}
+
+ @SuppressWarnings({"unchecked"})
+ protected static <H extends AbstractUIHandler> H newHandler(Class<H> klass, List<VCSFileState> states) {
+ H result;
+ result = (H) getCache().get(klass);
+ if (result == null) {
+ try {
+ result = klass.newInstance();
+ result.init();
+ getCache().put(klass, result);
+ } catch (InstantiationException e) {
+ throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException("could not instanciate ui handler " + klass + " for reason : " + e.getMessage());
+ }
+ }
+ result.getModel().setData(states);
+ return result;
+ }
+
+ protected VCSUIFactory() {
+ }
}
Deleted: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java 2008-04-03 17:01:40 UTC (rev 305)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/action/VCSPopupAction.java 2008-04-03 17:01:51 UTC (rev 306)
@@ -1,49 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs.ui.action;
-
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.ui.JSynchUI;
-import org.codelutin.vcs.ui.JVCSPopup;
-import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
-
-import javax.swing.ListSelectionModel;
-import java.awt.event.ActionEvent;
-
-/** @author chemit */
-public class VCSPopupAction extends VCSAbsractAction {
- private static final long serialVersionUID = -1983061535956510913L;
-
- protected JVCSPopup popup;
- protected AbstractVCSFileStatesModel model;
- protected transient ListSelectionModel selectionModel;
-
- public VCSPopupAction(JSynchUI ui, String modelName) {
- super(ui.getModel().getHandler());
- this.model = ui.getModel().getModel(modelName);
- this.popup = ui.getPopup(modelName);
- this.selectionModel = ui.getTable(modelName).getSelectionModel();
- }
-
- public void actionPerformed(ActionEvent e) {
- // select only lines for this action inside already selected lines
- model.select(action, selectionModel, false);
- // obtain thoses lines
- VCSFileState[] states = model.getData(selectionModel);
- // do real vcs action on thoses lines
- //TODO delegate to VCSActionThread ?
- log.info("files to treate :" + states.length);
- }
-}
1
0
[Buix-commits] r305 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:01:40 +0000 (Thu, 03 Apr 2008)
New Revision: 305
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java
Log:
ui constants
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-03 17:01:02 UTC (rev 304)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/VCSUIConstants.java 2008-04-03 17:01:40 UTC (rev 305)
@@ -27,17 +27,23 @@
};
/** model name for synchronize all tab ui */
- public static final String ALL_MODEL_PROPERTY = "modelSynchAll";
+ public static final String SYNCH_ALL_MODEL_PROPERTY = "modelSynchAll";
/** model name for synchronize local tab ui */
- public static final String LOCAL_MODEL_PROPERTY = "modelSynchLocal";
+ public static final String SYNCH_LOCAL_MODEL_PROPERTY = "modelSynchLocal";
/** model name for synchronize remote tab ui */
- public static final String REMOTE_MODEL_PROPERTY = "modelSynchRemote";
+ public static final String SYNCH_REMOTE_MODEL_PROPERTY = "modelSynchRemote";
- /** model name for diff ui */
- public static final String DIFF_MODEL_PROPERTY = "modelDiff";
+ /** 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 commit ui */
public static final String COMMIT_MODEL_PROPERTY = "modelCommit";
1
0
[Buix-commits] r304 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:01:02 +0000 (Thu, 03 Apr 2008)
New Revision: 304
Added:
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/DiffPanelUIModel.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/SimpleVCSFileStatesModel.java
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
Log:
model d'uis
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,108 @@
+/**
+ * # #% 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.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+
+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);
+
+ /** vcs handler to use (lazy instanciation) */
+ protected VCSHandler handler;
+ /** support for change properties support */
+ protected PropertyChangeSupport changeSupport;
+
+ public VCSHandler getHandler() {
+ return handler;
+ }
+
+ public abstract void setData(List<VCSFileState> states);
+
+ public abstract void addData(List<VCSFileState> states);
+
+ public abstract void removeData(List<VCSFileState> states);
+
+ protected void splitStates(List<VCSFileState> states, List<VCSFileState> local, List<VCSFileState> remote) {
+ for (VCSFileState state : states) {
+ if (state.getState() != null && state.getState().isLocal()) {
+ local.add(state);
+ }
+ if (state.getState() != null && state.getState().isRemote()) {
+ remote.add(state);
+ }
+ }
+ }
+
+ 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);
+ }
+}
Added: 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 (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,106 @@
+/**
+ * # #% 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.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class ConfirmUIModel extends AbstractUIModel {
+
+
+ /** la propri�t� pour indiquer un changement de racine d'arbre */
+ public static final String ACTION_PROPERTY_CHANGED = "tab";
+
+ /** local root : wroking copy */
+ protected URL localRoot;
+
+ /** remote root : remote url */
+ protected URL remoteRoot;
+
+ /** model */
+ protected SimpleVCSFileStatesModel model;
+
+ /** current action to fired */
+ protected VCSAction action;
+
+ protected List<String> messageHistory;
+
+ public ConfirmUIModel() {
+ }
+
+ public ConfirmUIModel(VCSHandler handler, URL leftRoot, URL rightRoot) {
+ this.handler = handler;
+ this.localRoot = leftRoot;
+ this.remoteRoot = rightRoot;
+ }
+
+ public AbstractVCSFileStatesModel getModel() {
+ if (model == null) {
+ model = new SimpleVCSFileStatesModel(action + "");
+ }
+ return model;
+ }
+
+ public List<String> getMessageHistory() {
+ if (messageHistory == null) {
+ messageHistory = new ArrayList<String>();
+ }
+ return messageHistory;
+ }
+
+ public void setData(List<VCSFileState> states) {
+ getModel().setData(states);
+ }
+
+ public void addData(List<VCSFileState> states) {
+ getModel().addData(states.toArray(new VCSFileState[states.size()]));
+ }
+
+ public void removeData(List<VCSFileState> states) {
+ getModel().removeData(states.toArray(new VCSFileState[states.size()]));
+ }
+
+ public void doAction(String commitMesssage) {
+ if (model == null || action == null) {
+ return;
+ }
+ if (commitMesssage != null && !getMessageHistory().contains(commitMesssage)) {
+ getMessageHistory().add(commitMesssage);
+ }
+ firePropertyChange(action.name().toLowerCase(), null, commitMesssage);
+ }
+
+ public void setAction(VCSAction action) {
+ VCSAction oldAction = this.action;
+ this.action = action;
+ firePropertyChange(ACTION_PROPERTY_CHANGED, oldAction, action);
+ }
+
+ public VCSAction getAction() {
+ return action;
+ }
+
+
+}
\ No newline at end of file
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -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.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+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 VCSFileState 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-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java (from rev 298, 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/DiffUIModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -0,0 +1,172 @@
+/**
+ * # #% 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.VCSFileState;
+import org.codelutin.vcs.VCSHandler;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_LOCAL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_REMOTE_MODEL_PROPERTY;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model of a repository
+ *
+ * @author chemit
+ */
+public class DiffUIModel extends AbstractUIModel {
+
+ /** property to indicate change tab */
+ public static final String TAB_PROPERTY_CHANGED = "tab";
+
+ /** property to indicate change file (display a new DiffPanelUI) */
+ 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 COMMIT_PROPERTY_CHANGED = "commit";
+
+ public static final String UPDATE_PROPERTY_CHANGED = "update";
+
+ public static final String REVERT_PROPERTY_CHANGED = "revert";
+
+ /** local root : wroking copy */
+ protected URL leftRoot;
+
+ /** remote root : remote url */
+ protected URL rightRoot;
+
+ /** map of models */
+ protected List<SimpleVCSFileStatesModel> models;
+
+ /** current tab displayed */
+ protected AbstractVCSFileStatesModel tabModel;
+
+ /** current file displayed */
+ protected VCSFileState fileModel;
+
+ /** current action to fired */
+ protected VCSAction action;
+
+ public DiffUIModel() {
+ }
+
+ public DiffUIModel(VCSHandler handler, URL leftRoot, URL rightRoot) {
+ this.handler = handler;
+ this.leftRoot = leftRoot;
+ this.rightRoot = rightRoot;
+ }
+
+ public AbstractVCSFileStatesModel getTabModel() {
+ return tabModel;
+ }
+
+ public void setTabModel(AbstractVCSFileStatesModel tabModel) {
+ AbstractVCSFileStatesModel oldTabModel = this.tabModel;
+ this.tabModel = tabModel;
+ firePropertyChange(TAB_PROPERTY_CHANGED, oldTabModel, tabModel);
+ }
+
+ public void setFileModel(VCSFileState fileModel) {
+ VCSFileState oldFileModel = this.fileModel;
+ this.fileModel = fileModel;
+ firePropertyChange(TAB_PROPERTY_CHANGED, oldFileModel, tabModel);
+ }
+
+ public AbstractVCSFileStatesModel getTabModel(String tabModel) {
+ return getModel(tabModel);
+ }
+
+ public void setLeftRoot(URL leftRoot) {
+ this.leftRoot = leftRoot;
+ }
+
+ public void setRightRoot(URL rightRoot) {
+ this.rightRoot = rightRoot;
+ }
+
+ public SimpleVCSFileStatesModel getModel(String modelName) {
+ SimpleVCSFileStatesModel tableModel = null;
+ for (SimpleVCSFileStatesModel model : getModels()) {
+ if (modelName.equals(model.getName())) {
+ tableModel = model;
+ break;
+ }
+ }
+ if (tableModel == null) {
+ getModels().add(tableModel = new SimpleVCSFileStatesModel(modelName));
+ }
+ return tableModel;
+ }
+
+ public void doAllAction(VCSAction action) {
+ if (tabModel == null) {
+ return;
+ }
+ this.action = action;
+ firePropertyChange(action.name().toLowerCase() + "All", null, tabModel);
+ }
+
+ public void setData(List<VCSFileState> states) {
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
+ List<VCSFileState> local = new ArrayList<VCSFileState>();
+ List<VCSFileState> remote = new ArrayList<VCSFileState>();
+ splitStates(states, local, remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).setData(local);
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).setData(remote);
+ }
+
+ public void addData(List<VCSFileState> states) {
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
+ List<VCSFileState> local = new ArrayList<VCSFileState>();
+ List<VCSFileState> remote = new ArrayList<VCSFileState>();
+ splitStates(states, local, remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).addData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).addData(remote.toArray(new VCSFileState[remote.size()]));
+ }
+
+ public void removeData(List<VCSFileState> states) {
+ getModel(SYNCH_ALL_MODEL_PROPERTY).removeData(states.toArray(new VCSFileState[states.size()]));
+ List<VCSFileState> local = new ArrayList<VCSFileState>();
+ List<VCSFileState> remote = new ArrayList<VCSFileState>();
+ splitStates(states, local, remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).removeData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).removeData(remote.toArray(new VCSFileState[remote.size()]));
+ }
+
+ public void doAction(VCSAction action) {
+ if (tabModel == null) {
+ return;
+ }
+ this.action = action;
+ firePropertyChange(action.name().toLowerCase(), null, tabModel);
+ }
+
+ protected List<SimpleVCSFileStatesModel> getModels() {
+ if (models == null) {
+ models = new ArrayList<SimpleVCSFileStatesModel>();
+ }
+ return models;
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java (from rev 301, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSFileStatesModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -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.model;
+
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.ui.VCSUIConstants;
+
+/** @author chemit */
+public class SimpleVCSFileStatesModel extends AbstractVCSFileStatesModel {
+
+ private static final long serialVersionUID = -7592705623128585146L;
+
+ public SimpleVCSFileStatesModel(String name) {
+ super(name, VCSUIConstants.SIMPLE_COLUMNS_NAMES);
+ }
+
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ if (isEmpty()) return null;
+ VCSFileState item = data.get(rowIndex);
+ Object result = null;
+ if (columnIndex == 0) {
+ // get module
+ result = item.getModuleName();
+ } else if (columnIndex == 1) {
+ // get file
+ result = item.getModuleRelativeFileName();
+ } else if (columnIndex == 2) {
+ // get status
+ VCSState state = item.getState();
+ result = state == null ? null : state.libelle();
+ }
+ return result;
+ }
+
+
+}
\ 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-03 17:00:51 UTC (rev 303)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -14,17 +14,13 @@
*/
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.VCSFileState;
import org.codelutin.vcs.VCSHandler;
-import static org.codelutin.vcs.ui.VCSUIConstants.ALL_MODEL_PROPERTY;
-import static org.codelutin.vcs.ui.VCSUIConstants.LOCAL_MODEL_PROPERTY;
-import static org.codelutin.vcs.ui.VCSUIConstants.REMOTE_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_LOCAL_MODEL_PROPERTY;
+import static org.codelutin.vcs.ui.VCSUIConstants.SYNCH_REMOTE_MODEL_PROPERTY;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
@@ -35,11 +31,8 @@
*
* @author chemit
*/
-public class SynchUIModel {
+public class SynchUIModel extends AbstractUIModel {
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static protected final Log log = LogFactory.getLog(SynchUIModel.class);
-
/** la propri�t� pour indiquer un changement de racine d'arbre */
public static final String TAB_PROPERTY_CHANGED = "tab";
@@ -65,15 +58,9 @@
/** remote root : remote url */
protected URL remoteRoot;
- /** vcs handler to use (lazy instanciation) */
- protected VCSHandler handler;
-
/** map of models */
- protected List<SynchVCSFileStatesModel> models;
+ protected List<SimpleVCSFileStatesModel> models;
- /** support for change properties support */
- protected PropertyChangeSupport changeSupport;
-
/** current tab displayed */
protected AbstractVCSFileStatesModel tabModel;
@@ -115,45 +102,45 @@
this.remoteRoot = remoteRoot;
}
- public SynchVCSFileStatesModel getModel(String modelName) {
- SynchVCSFileStatesModel tableModel = null;
- for (SynchVCSFileStatesModel model : getModels()) {
+ public SimpleVCSFileStatesModel getModel(String modelName) {
+ SimpleVCSFileStatesModel tableModel = null;
+ for (SimpleVCSFileStatesModel model : getModels()) {
if (modelName.equals(model.getName())) {
tableModel = model;
break;
}
}
if (tableModel == null) {
- getModels().add(tableModel = new SynchVCSFileStatesModel(modelName));
+ getModels().add(tableModel = new SimpleVCSFileStatesModel(modelName));
}
return tableModel;
}
public void setData(List<VCSFileState> states) {
- getModel(ALL_MODEL_PROPERTY).setData(states);
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
List<VCSFileState> local = new ArrayList<VCSFileState>();
List<VCSFileState> remote = new ArrayList<VCSFileState>();
splitStates(states, local, remote);
- getModel(LOCAL_MODEL_PROPERTY).setData(local);
- getModel(REMOTE_MODEL_PROPERTY).setData(remote);
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).setData(local);
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).setData(remote);
}
public void addData(List<VCSFileState> states) {
- getModel(ALL_MODEL_PROPERTY).setData(states);
+ getModel(SYNCH_ALL_MODEL_PROPERTY).setData(states);
List<VCSFileState> local = new ArrayList<VCSFileState>();
List<VCSFileState> remote = new ArrayList<VCSFileState>();
splitStates(states, local, remote);
- getModel(LOCAL_MODEL_PROPERTY).addData(local.toArray(new VCSFileState[local.size()]));
- getModel(REMOTE_MODEL_PROPERTY).addData(remote.toArray(new VCSFileState[remote.size()]));
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).addData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).addData(remote.toArray(new VCSFileState[remote.size()]));
}
public void removeData(List<VCSFileState> states) {
- getModel(ALL_MODEL_PROPERTY).removeData(states.toArray(new VCSFileState[states.size()]));
+ getModel(SYNCH_ALL_MODEL_PROPERTY).removeData(states.toArray(new VCSFileState[states.size()]));
List<VCSFileState> local = new ArrayList<VCSFileState>();
List<VCSFileState> remote = new ArrayList<VCSFileState>();
splitStates(states, local, remote);
- getModel(LOCAL_MODEL_PROPERTY).removeData(local.toArray(new VCSFileState[local.size()]));
- getModel(REMOTE_MODEL_PROPERTY).removeData(remote.toArray(new VCSFileState[remote.size()]));
+ getModel(SYNCH_LOCAL_MODEL_PROPERTY).removeData(local.toArray(new VCSFileState[local.size()]));
+ getModel(SYNCH_REMOTE_MODEL_PROPERTY).removeData(remote.toArray(new VCSFileState[remote.size()]));
}
public void doAllAction(VCSAction action) {
@@ -164,72 +151,12 @@
firePropertyChange(action.name().toLowerCase() + "All", null, tabModel);
}
- 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);
- }
-
- protected List<SynchVCSFileStatesModel> getModels() {
+ protected List<SimpleVCSFileStatesModel> getModels() {
if (models == null) {
- models = new ArrayList<SynchVCSFileStatesModel>();
+ models = new ArrayList<SimpleVCSFileStatesModel>();
}
return models;
}
- protected void splitStates(List<VCSFileState> states, List<VCSFileState> local, List<VCSFileState> remote) {
- for (VCSFileState state : states) {
- if (state.getState() != null && state.getState().isLocal()) {
- local.add(state);
- }
- if (state.getState() != null && state.getState().isRemote()) {
- remote.add(state);
- }
- }
- }
+
}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java 2008-04-03 17:00:51 UTC (rev 303)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java 2008-04-03 17:01:02 UTC (rev 304)
@@ -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.model;
-
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.VCSState;
-import org.codelutin.vcs.ui.VCSUIConstants;
-
-/** @author chemit */
-public class SynchVCSFileStatesModel extends AbstractVCSFileStatesModel {
- private static final long serialVersionUID = -7592705623128585146L;
-
- public SynchVCSFileStatesModel(String name) {
- super(name, VCSUIConstants.SIMPLE_COLUMNS_NAMES);
- }
-
- public Object getValueAt(int rowIndex, int columnIndex) {
- if (isEmpty()) return null;
- VCSFileState item = data.get(rowIndex);
- Object result = null;
- if (columnIndex == 0) {
- // get module
- result = item.getModuleName();
- } else if (columnIndex == 1) {
- // get file
- result = item.getModuleRelativeFileName();
- } else if (columnIndex == 2) {
- // get status
- VCSState state = item.getState();
- result = state == null ? null : state.libelle();
- }
- return result;
- }
-
-}
1
0
[Buix-commits] r303 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 17:00:51 +0000 (Thu, 03 Apr 2008)
New Revision: 303
Added:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java
Log:
handlers d'ui
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java (from rev 298, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractConfirmUIHandler.java 2008-04-03 17:00:51 UTC (rev 303)
@@ -0,0 +1,57 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.action;
+
+import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.model.AbstractVCSFileStatesModel;
+import org.codelutin.vcs.ui.model.ConfirmUIModel;
+
+import javax.swing.ListSelectionModel;
+import java.beans.PropertyChangeEvent;
+
+/** @author chemit */
+public abstract class AbstractConfirmUIHandler extends AbstractUIHandler<ConfirmUIModel> {
+
+ protected abstract void updateUI();
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ //if (log.isDebugEnabled()) {
+ log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
+ //}
+ String action = evt.getPropertyName();
+
+ if (ConfirmUIModel.ACTION_PROPERTY_CHANGED.equals(action)) {
+ updateUI();
+ return;
+ }
+ try {
+ String commitMessage = (String) evt.getNewValue();
+ VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
+ doAction(vcsAction, commitMessage, getModel().getModel());
+ } catch (IllegalArgumentException e) {
+ // ignore ite
+ }
+ }
+
+ public void doAction(VCSAction action, String commitMessage, AbstractVCSFileStatesModel model) {
+ ListSelectionModel selectionModel = getSelectionModel();
+ model.select(action, selectionModel, false);
+ VCSFileState[] data = model.getData(selectionModel);
+ //TODO fire vcs action on given data
+ log.info("action:" + action + ", message:" + commitMessage + ", nb files:" + data.length);
+ }
+
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java (from rev 298, trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractDiffUIHandler.java 2008-04-03 17:00:51 UTC (rev 303)
@@ -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.action;
+
+import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.VCSFileState;
+import org.codelutin.vcs.ui.model.DiffUIModel;
+import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
+
+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 (DiffUIModel.TAB_PROPERTY_CHANGED.equals(action)) {
+ doSelectTab((SimpleVCSFileStatesModel) evt.getNewValue());
+ } else {
+ if (DiffUIModel.FILE_PROPERTY_CHANGED.equals(action)) {
+ doSelectFile((VCSFileState) evt.getNewValue());
+ } else {
+ try {
+ VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
+ doAction(vcsAction, (VCSFileState) evt.getNewValue());
+ } catch (IllegalArgumentException e) {
+ // ignore ite
+ }
+ }
+ }
+ }
+
+ public abstract void doSelectTab(SimpleVCSFileStatesModel action);
+
+ public abstract void doSelectFile(VCSFileState model);
+
+ public abstract void doAction(VCSAction action, VCSFileState model);
+
+ public abstract void gotoNextDiff();
+
+ public abstract void gotoPreviousDiff();
+
+}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 16:59:29 UTC (rev 302)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractSynchUIHandler.java 2008-04-03 17:00:51 UTC (rev 303)
@@ -14,48 +14,46 @@
*/
package org.codelutin.vcs.ui.action;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.ui.model.SimpleVCSFileStatesModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
-import org.codelutin.vcs.ui.model.SynchVCSFileStatesModel;
import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
/** @author chemit */
-public abstract class AbstractSynchUIHandler implements PropertyChangeListener {
+public abstract class AbstractSynchUIHandler extends AbstractUIHandler<SynchUIModel> {
- protected static Log log = LogFactory.getLog(AbstractSynchUIHandler.class);
-
public void propertyChange(PropertyChangeEvent evt) {
//if (log.isDebugEnabled()) {
log.info(evt.getPropertyName() + " old:" + evt.getOldValue() + ", new:" + evt.getNewValue());
//}
String action = evt.getPropertyName();
- SynchVCSFileStatesModel model = (SynchVCSFileStatesModel) evt.getNewValue();
+ SimpleVCSFileStatesModel model = (SimpleVCSFileStatesModel) evt.getNewValue();
if (SynchUIModel.TAB_PROPERTY_CHANGED.equals(action)) {
doSelectTabAction(model);
} else if (action.endsWith("All")) {
- String actionName = action.substring(0, action.length() - 3);
- doAllAction(VCSAction.valueOf(actionName.toUpperCase()), model);
+ try {
+ String actionName = action.substring(0, action.length() - 3);
+ VCSAction vcsAction = VCSAction.valueOf(actionName.toUpperCase());
+ doAllAction(vcsAction, model);
+ } catch (IllegalArgumentException e) {
+ // ignore it ?
+ }
} else {
- doSelectAction(VCSAction.valueOf(action.toUpperCase()), model);
+ try {
+ VCSAction vcsAction = VCSAction.valueOf(action.toUpperCase());
+ doSelectAction(vcsAction, model);
+ } catch (IllegalArgumentException e) {
+ // ignore it ?
+ }
+
}
}
- public abstract SynchUIModel getModel();
+ public abstract void doSelectAction(VCSAction action, SimpleVCSFileStatesModel model);
- public abstract void doSelectAction(VCSAction action, SynchVCSFileStatesModel model);
+ public abstract void doAllAction(VCSAction action, SimpleVCSFileStatesModel model);
- public abstract void doAllAction(VCSAction action, SynchVCSFileStatesModel model);
+ public abstract void doSelectTabAction(SimpleVCSFileStatesModel action);
- public abstract void doSelectTabAction(SynchVCSFileStatesModel action);
-
- public void init() {
- if (getModel() == null) {
- throw new IllegalStateException("no model was defined for " + this);
- }
- getModel().addPropertyChangeListener(this);
- }
}
Added: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/action/AbstractUIHandler.java 2008-04-03 17:00:51 UTC (rev 303)
@@ -0,0 +1,42 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.ui.action;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.ui.model.AbstractUIModel;
+
+import javax.swing.ListSelectionModel;
+import javax.swing.JDialog;
+import java.beans.PropertyChangeListener;
+
+/** @author chemit */
+public abstract class AbstractUIHandler<M extends AbstractUIModel> implements PropertyChangeListener {
+
+ protected static Log log = LogFactory.getLog(AbstractConfirmUIHandler.class);
+
+ public abstract M getModel();
+
+ public abstract JDialog getUi();
+
+ public abstract ListSelectionModel getSelectionModel();
+
+ public void init() {
+ if (getModel() == null) {
+ throw new IllegalStateException("no model was defined for " + this);
+ }
+ getModel().addPropertyChangeListener(this);
+ }
+}
1
0
[Buix-commits] r302 - in trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs: . ui
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
by tchemit@users.labs.libre-entreprise.org 03 Apr '08
03 Apr '08
Author: tchemit
Date: 2008-04-03 16:59:29 +0000 (Thu, 03 Apr 2008)
New Revision: 302
Removed:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSRepositoryState.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTableModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccess.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccessManager.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldModelUtil.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FileStateTableModel.java
Log:
old ui code
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSRepositoryState.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSRepositoryState.java 2008-04-02 17:17:09 UTC (rev 301)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSRepositoryState.java 2008-04-03 16:59:29 UTC (rev 302)
@@ -1,200 +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;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.ui.FileStateTableModel;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.List;
-
-/**
- * Permet de rechercher et conserve les differences entre le repository local et
- * distant.
- *
- * @author poussin
- * @author chemit
- */
-public class VCSRepositoryState {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static protected final Log log = LogFactory.getLog(VCSRepositoryState.class);
-
- /** liste des �tats des fichiers scann�s */
- protected List<VCSFileState> states = new ArrayList<VCSFileState>();
-
- /** tableau des model de table (un par �tat VCSState) */
- protected FileStateTableModel[] models;
-
- /** le r�pertoire racine du working copy local */
- protected File root;
-
- /** vcs states to be authorized in this model */
- protected VCSState[] acceptedStates;
-
- /** vcs actions to be authorized in this model */
- protected EnumSet<VCSAction> acceptedActions;
-
- /** vcs handler to use (lazy instanciation) */
- protected VCSHandler handler;
-
- public static final VCSState[] UPDATE_STATES = {
- org.codelutin.vcs.VCSState.OUT_OF_DATE,
- org.codelutin.vcs.VCSState.MODIFIED,
- org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED,
- org.codelutin.vcs.VCSState.UNVERSIONNED,
- org.codelutin.vcs.VCSState.MISSING
- };
-
- /**
- * @param handler handlet to use
- * @param root directory of root local working copy
- * @param actions accepted actions
- * @param modules la liste des modules a traiter
- * @throws VCSException if any problem while building
- */
- protected VCSRepositoryState(VCSHandler handler, File root, EnumSet<VCSAction> actions, File... modules) throws VCSException {
- this.acceptedActions = actions;
- this.root = root;
- this.acceptedStates = UPDATE_STATES;
- this.handler = handler;
- // scan all modules
- for (File mod : modules) {
- states.addAll(doScan(mod, acceptedStates));
- }
- }
-
- public VCSHandler getHandler() {
- return handler;
- }
-
- /**
- * @param handler vcs handler to use for synch operation
- * @throws VCSException if any problem while synchro
- */
- public void doSynch(VCSHandler handler) throws VCSException {
- long timestamp = System.nanoTime();
- for (VCSFileState fileState : states) {
- fileState.doSynch(handler, timestamp);
- }
- }
-
- public File getRoot() {
- return root;
- }
-
- public List<VCSFileState> getStates() {
- return states;
- }
-
- public VCSState[] getAcceptedStates() {
- return acceptedStates;
- }
-
- public FileStateTableModel getModel(VCSState state) {
- return getModels()[state.ordinal()];
- }
-
-
- protected FileStateTableModel[] getModels() {
- if (models == null) {
- models = new FileStateTableModel[VCSState.values().length];
- }
- return models;
- }
-
- public void createUIModels() {
- for (VCSState state : acceptedStates) {
- getModels()[state.ordinal()] = new FileStateTableModel(VCSFileStateManager.filter(states, state), acceptedActions);
- }
- }
-
- public List<VCSFileState> selected(VCSState... wanted) {
- if (wanted.length == 0) {
- wanted = acceptedStates;
- }
- List<VCSFileState> result = new ArrayList<VCSFileState>();
- for (VCSState state : wanted) {
- FileStateTableModel tableModel = getModel(state);
- if (tableModel != null) {
- result.addAll(tableModel.getSelected());
- }
- }
- return result;
- }
-
- public void checkAll(boolean toUse, VCSState... wanted) {
- if (wanted.length == 0) wanted = acceptedStates;
- for (VCSState state : wanted) {
- FileStateTableModel tableModel = getModel(state);
- if (tableModel != null) {
- tableModel.checkAll(0, toUse);
- }
- }
- }
-
- public boolean isModelEmpty() {
- for (VCSState state : acceptedStates) {
- FileStateTableModel tableModel = getModel(state);
- if (tableModel != null && tableModel.getRowCount() > 0) {
- return false;
- }
- }
- return true;
- }
-
- public int getModelSelectedSize() {
- int result = 0;
- for (VCSState state : acceptedStates) {
- result += getModelSelectedSize(state);
- }
- return result;
- }
-
- public boolean isModelEmpty(VCSState state) {
- FileStateTableModel tableModel = getModel(state);
- return !(tableModel != null && tableModel.getRowCount() > 0);
- }
-
- public int getModelSize(VCSState state) {
- FileStateTableModel tableModel = getModel(state);
- return tableModel == null ? 0 : tableModel.getRowCount();
- }
-
- public int getModelSelectedSize(VCSState state) {
- FileStateTableModel tableModel = getModel(state);
- return tableModel == null ? 0 : tableModel.getSelectedSize();
- }
-
- private List<VCSFileState> doScan(File module, VCSState... acceptedStates)
- throws VCSException {
- // obtain list of all VCSFileState found in module directory
- List<VCSFileState> states;
- states = VCSFileStateManager.doScan(getHandler(), module, true, acceptedStates);
- return states;
- }
-
- public EnumSet<VCSAction> getAcceptedActions() {
- return acceptedActions;
- }
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTableModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTableModel.java 2008-04-02 17:17:09 UTC (rev 301)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/AbstractTableModel.java 2008-04-03 16:59:29 UTC (rev 302)
@@ -1,190 +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;
-
-import static org.codelutin.i18n.I18n._;
-
-import static java.lang.Boolean.TRUE;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-/** TODO-TC */
-(a)org.codelutin.i18n.I18nable
-public abstract class AbstractTableModel<D> extends javax.swing.table.AbstractTableModel {
-
-
- protected final FieldAccess<D>[] modelAccess;
- protected List<D> data;
-
- protected final int nbOptions;
- protected Map<D, Boolean>[] options;
- protected final String[] optionNames;
- protected final Class[] optionClass;
- protected boolean[] optionChecks;
-
- private static final long serialVersionUID = 4697917831388337369L;
-
- @SuppressWarnings({"unchecked"})
- protected AbstractTableModel(
- List<D> data, FieldAccess<D>[] modelAccess,
- Class[] optionsClass, String[] optionsNames) throws RuntimeException {
- if (optionsClass.length != optionsNames.length)
- throw new RuntimeException(_("lutinvcs.error.fieldmodel.unmatchin.options"));
-
- this.data = data;
- this.optionClass = optionsClass;
- this.optionNames = optionsNames;
- this.modelAccess = modelAccess;
- this.nbOptions = optionsClass.length;
- this.options = new Map[this.nbOptions];
- this.optionChecks = new boolean[this.nbOptions];
- }
-
- protected AbstractTableModel(List<D> data, FieldAccess<D>[] modelAccess,
- Class optionsClass, String optionsNames) {
- this(data, modelAccess, new Class[]{optionsClass},
- new String[]{optionsNames});
- }
-
- protected AbstractTableModel(List<D> data, FieldAccess<D>[] modelAccess) {
- this(data, modelAccess, new Class[0], new String[0]);
- }
-
- protected Map<D, Boolean> getOptionMap(int rowindex) {
- if (rowindex >= nbOptions) return null;
- Map<D, Boolean> map = options[rowindex];
- if (map == null)
- map = options[rowindex] = new LinkedHashMap<D, Boolean>();
- return map;
- }
-
- /**
- * @param index option index
- * @return Returns the selected for an option.
- */
- public List<D> getSelected(int index) {
- List<D> result = new ArrayList<D>();
- Map<D, Boolean> option = nbOptions == 0 ? null : options[index];
- if (index >= nbOptions || option == null) return result;
- for (Map.Entry<D, Boolean> item : option.entrySet())
- if (java.lang.Boolean.TRUE.equals(item.getValue()))
- result.add(item.getKey());
- return result;
- }
-
- public int getSelectedSize(int index) {
- int result = 0;
- Map<D, Boolean> option = nbOptions == 0 ? null : options[index];
- if (index >= nbOptions || option == null) return result;
- for (Map.Entry<D, Boolean> item : option.entrySet())
- if (java.lang.Boolean.TRUE.equals(item.getValue()))
- result++;
- return result;
- }
-
- public List<D> getData() {
- return data;
- }
-
- public int getColumnCount() {
- return modelAccess.length + nbOptions;
- }
-
- public int getRowCount() {
- return data.size();
- }
-
- public void checkAll() {
- if (nbOptions != 1) return;
- for (int i = 0; i < nbOptions; i++) checkAll(i);
- }
-
- @Override
- public Class<?> getColumnClass(int columnIndex) {
- Class result;
- if (columnIndex < nbOptions) {
-
- result = this.optionClass[columnIndex];
- } else {
- result = FieldAccessManager.getFieldClass(modelAccess[columnIndex - nbOptions]);
- }
- return result;
- }
-
- @Override
- public String getColumnName(int columnIndex) {
- String result;
- if (columnIndex < nbOptions)
- result = this.optionNames[columnIndex];
- else
- result = FieldAccessManager.getFieldName(modelAccess[columnIndex - nbOptions]);
- return result;
- }
-
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return columnIndex < nbOptions;
- }
-
- @Override
- public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
- D item = data.get(rowIndex);
- if (columnIndex < nbOptions)
- setOptionValueAt(item, aValue, columnIndex);
- // read only data
- }
-
- public Object getValueAt(int rowIndex, int columnIndex) {
- D item = data.get(rowIndex);
- if (columnIndex < nbOptions)
- return getOptionValueAt(item, columnIndex);
- return modelAccess[columnIndex - nbOptions].getValue(item);
- }
-
- protected void setOptionValueAt(D item, Object aValue, int index) {
- getOptionMap(index).put(item, TRUE.equals(aValue));
- }
-
- protected void checkAll(int index, boolean value) {
- if (index >= nbOptions || nbOptions > 1) return;
- for (int i = 0; i < getRowCount(); i++)
- setValueAt(value, i, index);
- }
-
- protected void checkAll(int index) {
- if (index >= nbOptions || nbOptions > 1) return;
- checkAll(index, optionChecks[index] = !optionChecks[index]);
- }
-
- protected Boolean getOptionValueAt(D item, int index) {
- return getOptionMap(index).get(item);
- }
-
- protected FieldAccess[] getFiedAccess() {
- return modelAccess;
- }
-
- public void reset(List<D> states) {
- data.clear();
- data.addAll(states);
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccess.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccess.java 2008-04-02 17:17:09 UTC (rev 301)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccess.java 2008-04-03 16:59:29 UTC (rev 302)
@@ -1,31 +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;
-
-/**
- * A simple contract for a field access in vcs ui, says a cell
- *
- * @author chemit
- */
-public interface FieldAccess<D> {
-
- Object getValue(D item);
-
-}
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccessManager.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccessManager.java 2008-04-02 17:17:09 UTC (rev 301)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldAccessManager.java 2008-04-03 16:59:29 UTC (rev 302)
@@ -1,154 +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;
-
-import org.apache.commons.logging.Log;
-import static org.apache.commons.logging.LogFactory.getLog;
-import static org.codelutin.i18n.I18n._;
-
-/**
- * Class pour gérer un cache de {@link FieldAccessEntry} indexés à partir de
- * {@link FieldAccess}.
- *
- * @author chemit
- */
-(a)org.codelutin.i18n.I18nable
-public class FieldAccessManager {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = getLog(FieldAccessManager.class);
-
- /** cache of registred FiledModelEntry associated to a FieldAccess */
- static protected java.util.Map<FieldAccess, FieldAccessEntry> cache;
-
- /**
- * Register a FieldAccess in the cache
- *
- * @param constant the constant to be used
- * @param libelle name of the field (libelle to display in row header)
- * @param clazz class of the object used for this field
- */
- public static <D> void registerFieldAccess(FieldAccess<D> constant, String libelle, Class clazz) {
- checkAlreadyRegistredEntry(constant);
- FieldAccessEntry<D> entry = new FieldAccessEntry<D>(constant, libelle, clazz);
- log.debug(entry);
- getCache().put(constant, entry);
- }
-
- /**
- * Obtain the class of a field via his constant type safe value
- *
- * @param constant the constant to be used
- * @return the class defined for the field
- */
- public static <D> Class getFieldClass(FieldAccess<D> constant) {
- FieldAccessEntry entry = getEntry(constant, true);
- return entry == null ? null : entry.getClazz();
- }
-
- /**
- * Obtain the libelle of a field via his constant type safe value
- *
- * @param constant the constant to be used
- * @return the libelle defined for the field
- */
- public static <D> String getFieldName(FieldAccess<D> constant) {
- FieldAccessEntry entry = getEntry(constant, true);
- return entry == null ? null : entry.getLibelle();
- }
-
- /**
- * Obtain for a item the value of his field via his constant type safe value
- *
- * @param constant the constant to be used
- * @param item the item to be inspect
- * @return the class defined for the field
- */
- public static <D> Object getFieldValue(FieldAccess<D> constant, D item) {
- FieldAccessEntry<D> entry = getEntry(constant, true);
- return entry == null ? null : entry.getValue(item);
- }
-
- @SuppressWarnings({"unchecked"})
- protected static <D> FieldAccessEntry<D> getEntry(FieldAccess<D> constant, boolean safe) {
- FieldAccessEntry<D> entry = getCache().get(constant);
- checkExistingEntry(constant, safe, entry);
- return entry;
- }
-
- private static <D> void checkExistingEntry(FieldAccess<D> constant, boolean safe, FieldAccessEntry<D> entry) {
- if (safe && entry == null) {
- throw new RuntimeException(_("lutinvcs.error.fieldmodel.not.registred", constant));
- }
- }
-
- private static <D> void checkAlreadyRegistredEntry(FieldAccess<D> constant) throws RuntimeException {
- FieldAccessEntry<D> entry = getEntry(constant, false);
- if (entry != null) {
- throw new RuntimeException(_("lutinvcs.error.fieldmodel.already.registred", constant));
- }
- }
-
-
- private static java.util.Map<FieldAccess, FieldAccessEntry> getCache() {
- if (cache == null)
- cache = new java.util.HashMap<FieldAccess, FieldAccessEntry>();
- return cache;
- }
-
- protected static class FieldAccessEntry<D> implements FieldAccess<D> {
-
- private final String libelle;
- private final Class clazz;
- private final FieldAccess<D> constant;
-
- FieldAccessEntry(FieldAccess<D> constant, String libelle, Class clazz) {
- this.constant = constant;
- // keep only translated libelle
- this.libelle = _(libelle);
- this.clazz = clazz;
- }
-
- public String getLibelle() {
- return libelle;
- }
-
- public Class getClazz() {
- return clazz;
- }
-
- public Object getValue(D item) {
- return constant.getValue(item);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(this.getClass().getSimpleName());
- sb.append('@').append(Math.abs(hashCode()));
- sb.append(" [").append(constant).append("] [").append(libelle).append("] [");
- sb.append(clazz).append(']');
- return sb.toString();
- }
- }
-
- protected FieldAccessManager() {
- }
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldModelUtil.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldModelUtil.java 2008-04-02 17:17:09 UTC (rev 301)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FieldModelUtil.java 2008-04-03 16:59:29 UTC (rev 302)
@@ -1,121 +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;
-
-import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.VCSFileState;
-
-import java.io.File;
-
-(a)org.codelutin.i18n.I18nable
-public class FieldModelUtil {
-
-
- static public ModuleFile<String> createModuleFileTableModel(java.util.List<String> data) {
- return new ModuleFile<String>(SimpleModuleFileAccess.getAcces(), data);
- }
-
- static public ModuleFile<String> createModuleFileTableModelWithSelect(java.util.List<String> data) {
- return new ModuleFile<String>(SimpleModuleFileAccess.getAcces(), data, Boolean.class, _("lutinvcs.select"));
- }
-
- static public <D> ModuleFile<D> createModuleFileTableModelWithSelect(FieldAccess<D>[] model, java.util.List<D> data) {
- return new ModuleFile<D>(model, data, Boolean.class, _("lutinvcs.select"));
- }
-
- static public <D> ModuleFile<D> createModuleFileTableModel(FieldAccess<D>[] model, java.util.List<D> data) {
- return new ModuleFile<D>(model, data);
- }
-
- public static class ModuleFile<D> extends AbstractTableModel<D> {
- private static final long serialVersionUID = 4067521432762944991L;
-
- protected ModuleFile(FieldAccess<D>[] model, java.util.List<D> data, Class klazz, String select) {
- super(data, model, klazz, select);
- }
-
- protected ModuleFile(FieldAccess<D>[] model, java.util.List<D> data) {
- super(data, model);
- }
- }
-
-
- public static enum SimpleModuleFileWithActionAccess implements FieldAccess<VCSFileState> {
- ACTION(_("lutinvcs.action"), String.class) {
- public Object getValue(VCSFileState item) {
- return item.getAction().getLibelle();
- }
- },
- MODULE(_("lutinvcs.module"), String.class) {
- public Object getValue(VCSFileState item) {
- return item.getModuleName();
- }
- },
- NAME(_("lutinvcs.file"), String.class) {
- public Object getValue(VCSFileState item) {
- return item.getModuleRelativeFileName();
- }
- };
-
- SimpleModuleFileWithActionAccess(String libelle, Class clazz) {
- FieldAccessManager.registerFieldAccess(this, libelle, clazz);
- }
- }
-
- public static enum SimpleModuleFileAccess implements FieldAccess<String> {
-
- MODULE(_("lutinvcs.module"), String.class) {
- public Object getValue(String item) {
- return item.contains(java.io.File.separator) ? item.substring(
- 0, item.lastIndexOf(java.io.File.separator)) : item;
- }
- },
- NAME(_("lutinvcs.file"), String.class) {
- public Object getValue(String item) {
- return item.contains(java.io.File.separator) ? item
- .substring(item.lastIndexOf(java.io.File.separator) + 1)
- : "";
- }
- };
-
- SimpleModuleFileAccess(String libelle, Class clazz) {
- FieldAccessManager.registerFieldAccess(this, libelle, clazz);
- }
-
- public static FieldAccess<String>[] getAcces() {
- return values();
- }
-
- }
-
- public static enum SimpleFileAccess implements FieldAccess<File> {
-
- NAME(_("lutinvcs.file"), File.class) {
- public Object getValue(File item) {
- return item.getAbsolutePath();
- }
- };
-
- SimpleFileAccess(String libelle, Class clazz) {
- FieldAccessManager.registerFieldAccess(this, libelle, clazz);
- }
- }
-
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FileStateTableModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FileStateTableModel.java 2008-04-02 17:17:09 UTC (rev 301)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/FileStateTableModel.java 2008-04-03 16:59:29 UTC (rev 302)
@@ -1,234 +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;
-
-import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSFileState;
-import org.codelutin.vcs.VCSState;
-
-import javax.swing.table.AbstractTableModel;
-import static java.lang.Boolean.FALSE;
-import static java.lang.Boolean.TRUE;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * TODO Use FieldAccessManager
- *
- * @author tchemit
- * @see org.codelutin.vcs.ui.FieldAccessManager
- * @see org.codelutin.vcs.ui.FieldModelUtil
- * @see org.codelutin.vcs.ui.FieldAccess
- */
-
-(a)org.codelutin.i18n.I18nable
-public class FileStateTableModel extends AbstractTableModel {
-
- private static final long serialVersionUID = 5764217576707763232L;
-
- public static enum FIELD_ACCESS {
- MODULE(_("lutinvcs.module"), String.class) {
- public Object getValue(VCSFileState item) {
- return item.getModuleName();
- }
- },
- NAME(_("lutinvcs.file"), String.class) {
- public Object getValue(VCSFileState item) {
- return item.getModuleRelativeFileName();
- }
- },
- LOGDIFF(_("lutinvcs.logDiff"), String.class) {
- public Object getValue(VCSFileState item) {
- final String changeLog = item.getChangeLog();
- return changeLog == null ? "" : changeLog;
- }
- },
- REV(_("lutinvcs.rev"), Long.class) {
- public Object getValue(VCSFileState item) {
- return item.getRev();
- }
- };
-
- protected String columnName;
- protected Class columnClass;
-
- FIELD_ACCESS(String columnName, Class columnClass) {
- this.columnName = columnName;
- this.columnClass = columnClass;
- }
-
- public String getColumnName() {
- return columnName;
- }
-
- public Class getColumnClass() {
- return columnClass;
- }
-
- public abstract Object getValue(VCSFileState item);
- }
-
- protected Map<VCSFileState, VCSAction> selected;
- protected List<VCSFileState> data;
- protected VCSState state;
- protected List<VCSAction> actions;
-
- public FileStateTableModel(List<VCSFileState> data, EnumSet<VCSAction> actions) {
- this.data = data;
- this.selected = new HashMap<VCSFileState, VCSAction>();
- List<VCSAction> tmp = new ArrayList<VCSAction>();
-
- if (!data.isEmpty()) {
- // determine vcsstates used here for the moment a unique type
- state = data.get(0).getState();
-
- for (VCSAction action : state.getActions()) {
- if (action.isVisible() && actions.contains(action)) {
- tmp.add(action);
- }
- }
- }
- this.actions = tmp;
- }
-
- /** @return Returns the selected. */
- public List<VCSFileState> getSelected() {
- List<VCSFileState> result = new ArrayList<VCSFileState>();
- for (Map.Entry<VCSFileState, VCSAction> item : selected.entrySet())
- if (item.getValue() != null) {
- item.getKey().setAction(item.getValue());
- result.add(item.getKey());
- }
- return result;
- }
-
- public int getSelectedSize() {
- int result = 0;
- for (Map.Entry<VCSFileState, VCSAction> item : selected.entrySet()) {
- if (item.getValue() != null) {
- result++;
- }
- }
- return result;
- }
-
- public List<VCSAction> getActions() {
- return actions;
- }
-
- public VCSAction getAction(int row) {
- return selected.get(data.get(row));
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#getColumnCount()
- */
- public int getColumnCount() {
- return _FIELD_ACCESS.length + actions.size() - 2;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#getRowCount()
- */
- public int getRowCount() {
- return data.size();
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
- */
- @Override
- public Class<?> getColumnClass(int columnIndex) {
- Class result;
- if (columnIndex < actions.size()) {
- result = Boolean.class;
- } else {
- result = _FIELD_ACCESS[columnIndex - actions.size()].getColumnClass();
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.AbstractTableModel#getColumnName(int)
- */
- @Override
- public String getColumnName(int columnIndex) {
- String result;
- if (columnIndex < actions.size()) {
- result = actions.get(columnIndex).getLibelle().substring(0, 1);
- } else {
- result = _FIELD_ACCESS[columnIndex - actions.size()].getColumnName();
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.AbstractTableModel#isCellEditable(int, int)
- */
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return columnIndex < actions.size();
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.AbstractTableModel#setValueAt(Object, int, int)
- */
- @Override
- public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
- if (columnIndex < actions.size()) {
- VCSFileState item = data.get(rowIndex);
- VCSAction action = actions.get(columnIndex);
- final boolean b = TRUE.equals(aValue);
- selected.put(item, b ? action : null);
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#getValueAt(int, int)
- */
- public Object getValueAt(int rowIndex, int columnIndex) {
- VCSFileState item = data.get(rowIndex);
- Object result;
- if (getRowCount() == 0) return null;
- if (columnIndex < actions.size()) {
- result = selected.get(item);
- VCSAction action = actions.get(columnIndex);
- result = result == null || action != result ? FALSE : TRUE;
- } else {
- result = _FIELD_ACCESS[columnIndex - actions.size()].getValue(item);
- }
-
- return result;
- }
-
-
- public void checkAll(int index, boolean value) {
- if (actions.size() != 1 || index >= actions.size()) return;
- //if (getActions().size() == 1) return;
- // the only case we can automaticly check-uncheck items
- for (int i = 0; i < getRowCount(); i++) setValueAt(value, i, index);
- }
-
- private static final FIELD_ACCESS[] _FIELD_ACCESS = FIELD_ACCESS.values();
-}
\ No newline at end of file
1
0
[Buix-commits] r301 - in trunk/lutinvcs: lutinvcs-api/src/site lutinvcs-core/src/main/java/org/codelutin/vcs lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model lutinvcs-core/src/site lutinvcs-core/src/test/java/org/codelutin/vcs lutinvcs-provider-cvs/src/site lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs lutinvcs-provider-mock/src/main/java/org/codelutin/vcs lutinvcs-ui/src/site src/site
by tchemit@users.labs.libre-entreprise.org 02 Apr '08
by tchemit@users.labs.libre-entreprise.org 02 Apr '08
02 Apr '08
Author: tchemit
Date: 2008-04-02 17:17:09 +0000 (Wed, 02 Apr 2008)
New Revision: 301
Modified:
trunk/lutinvcs/lutinvcs-api/src/site/site_fr.xml
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFileStateManager.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java
trunk/lutinvcs/lutinvcs-core/src/site/site_fr.xml
trunk/lutinvcs/lutinvcs-core/src/test/java/org/codelutin/vcs/VCSLocalData.java
trunk/lutinvcs/lutinvcs-provider-cvs/src/site/site_fr.xml
trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHandlerTest.java
trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHelperTest.java
trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockHandlerProvider.java
trunk/lutinvcs/lutinvcs-ui/src/site/site_fr.xml
trunk/lutinvcs/src/site/site_fr.xml
Log:
reformat
Modified: trunk/lutinvcs/lutinvcs-api/src/site/site_fr.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/site/site_fr.xml 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-api/src/site/site_fr.xml 2008-04-02 17:17:09 UTC (rev 301)
@@ -24,14 +24,14 @@
</poweredBy>
<body>
- <menu name="Common Links" inherit="top" />
- <menu ref="parent" />
- <menu ref="reports" />
-
+ <menu name="Common Links" inherit="top"/>
+ <menu ref="parent"/>
+ <menu ref="reports"/>
+
<menu name="Liens">
<item href="http://java.sun.com/j2se"
name="Le site Java de Sun">
- </item>
+ </item>
</menu>
</body>
</project>
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFileStateManager.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFileStateManager.java 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFileStateManager.java 2008-04-02 17:17:09 UTC (rev 301)
@@ -237,7 +237,7 @@
// /////////////////////////////////////////////////////////////////////////
@SuppressWarnings({"unchecked"})
static public List<VCSFileState>[] explode(List<VCSFileState> source,
- VCSState... wanted) {
+ VCSState... wanted) {
if (wanted.length == 0)
wanted = VCSState.values();
int nbState = wanted.length;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchVCSFileStatesModel.java 2008-04-02 17:17:09 UTC (rev 301)
@@ -16,11 +16,8 @@
import org.codelutin.vcs.VCSFileState;
import org.codelutin.vcs.VCSState;
-import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.ui.VCSUIConstants;
-import javax.swing.ListSelectionModel;
-
/** @author chemit */
public class SynchVCSFileStatesModel extends AbstractVCSFileStatesModel {
private static final long serialVersionUID = -7592705623128585146L;
Modified: trunk/lutinvcs/lutinvcs-core/src/site/site_fr.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/site/site_fr.xml 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-core/src/site/site_fr.xml 2008-04-02 17:17:09 UTC (rev 301)
@@ -24,9 +24,9 @@
</poweredBy>
<body>
- <menu name="Common Links" inherit="top" />
- <menu ref="parent" />
- <menu ref="reports" />
+ <menu name="Common Links" inherit="top"/>
+ <menu ref="parent"/>
+ <menu ref="reports"/>
<menu name="Liens">
<item href="http://java.sun.com/j2se"
Modified: trunk/lutinvcs/lutinvcs-core/src/test/java/org/codelutin/vcs/VCSLocalData.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/test/java/org/codelutin/vcs/VCSLocalData.java 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-core/src/test/java/org/codelutin/vcs/VCSLocalData.java 2008-04-02 17:17:09 UTC (rev 301)
@@ -1,7 +1,6 @@
package org.codelutin.vcs;
import junit.framework.TestCase;
-
import org.codelutin.util.FileUtil;
import java.io.File;
@@ -106,7 +105,7 @@
File[] result = new File[index.length];
for (int i1 = 0; i1 < index.length; i1++) {
int i = index[i1];
- result[i1] = getFile(root, prefix, i);
+ result[i1] = getFile(root, prefix, i);
}
return result;
}
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/site/site_fr.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/site/site_fr.xml 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/site/site_fr.xml 2008-04-02 17:17:09 UTC (rev 301)
@@ -24,9 +24,9 @@
</poweredBy>
<body>
- <menu name="Common Links" inherit="top" />
- <menu ref="parent" />
- <menu ref="reports" />
+ <menu name="Common Links" inherit="top"/>
+ <menu ref="parent"/>
+ <menu ref="reports"/>
<menu name="Liens">
<item href="http://java.sun.com/j2se"
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHandlerTest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHandlerTest.java 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHandlerTest.java 2008-04-02 17:17:09 UTC (rev 301)
@@ -1,11 +1,9 @@
package org.codelutin.vcs.impl.cvs;
-import org.codelutin.vcs.VCSType;
import org.codelutin.vcs.VCSHandlerTest;
+import org.codelutin.vcs.VCSType;
-/**
- * Test CVSHandler
- */
+/** Test CVSHandler */
class CVSHandlerTest extends VCSHandlerTest {
protected void setUpVars() {
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHelperTest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHelperTest.java 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/test/java/org/codelutin/vcs/impl/cvs/CVSHelperTest.java 2008-04-02 17:17:09 UTC (rev 301)
@@ -34,17 +34,14 @@
import junit.framework.TestCase;
-/**
- * @author poussin
- *
- */
+/** @author poussin */
public class CVSHelperTest extends TestCase {
-
+
public void testDummy() {
-
+
}
-
+
// /*
// * Test method for 'fr.ifremer.isisfish.versionning.vcsCvs.CVSHelper.checkout(File, String)'
// */
Modified: trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockHandlerProvider.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockHandlerProvider.java 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockHandlerProvider.java 2008-04-02 17:17:09 UTC (rev 301)
@@ -14,8 +14,6 @@
*/
package org.codelutin.vcs;
-import org.codelutin.vcs.VCSConfig;
-import org.codelutin.vcs.VCSHandlerProvider;
import org.codelutin.vcs.impl.mock.MockVCSHandler;
/** @author chemit */
Modified: trunk/lutinvcs/lutinvcs-ui/src/site/site_fr.xml
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/site/site_fr.xml 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/lutinvcs-ui/src/site/site_fr.xml 2008-04-02 17:17:09 UTC (rev 301)
@@ -24,9 +24,9 @@
</poweredBy>
<body>
- <menu name="Common Links" inherit="top" />
- <menu ref="parent" />
- <menu ref="reports" />
+ <menu name="Common Links" inherit="top"/>
+ <menu ref="parent"/>
+ <menu ref="reports"/>
<menu name="Liens">
<item href="http://java.sun.com/j2se"
Modified: trunk/lutinvcs/src/site/site_fr.xml
===================================================================
--- trunk/lutinvcs/src/site/site_fr.xml 2008-04-02 17:08:10 UTC (rev 300)
+++ trunk/lutinvcs/src/site/site_fr.xml 2008-04-02 17:17:09 UTC (rev 301)
@@ -34,14 +34,13 @@
</links>
<menu name="Utilisation">
- <item href="/index.html" name="Présentation"/>
+ <item href="/index.html" name="Présentation"/>
<item href="/todo.html" name="Reste à faire"/>
</menu>
+ <menu ref="modules"/>
- <menu ref="modules" />
-
<menu name="Développement">
<item href="/devel/index.html"
name="Présentation">
@@ -57,7 +56,7 @@
</item>
</menu>
- <menu ref="reports" />
+ <menu ref="reports"/>
</body>
</project>
1
0
[Buix-commits] r300 - trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs
by tchemit@users.labs.libre-entreprise.org 02 Apr '08
by tchemit@users.labs.libre-entreprise.org 02 Apr '08
02 Apr '08
Author: tchemit
Date: 2008-04-02 17:08:10 +0000 (Wed, 02 Apr 2008)
New Revision: 300
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSHandlerFactory.java
Log:
log provider found
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSHandlerFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSHandlerFactory.java 2008-04-02 14:35:41 UTC (rev 299)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSHandlerFactory.java 2008-04-02 17:08:10 UTC (rev 300)
@@ -100,6 +100,9 @@
providers = ServiceLoader.load(VCSHandlerProvider.class);
int nb = 0;
for (VCSHandlerProvider provider : providers) {
+ if (log.isDebugEnabled()) {
+ log.debug("find " + provider);
+ }
nb++;
}
log.info("found " + nb + " provider(s) " + providers.toString() + " in " + StringUtil.convertTime(t0, System.nanoTime()));
1
0