[Buix-commits] r371 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
Author: tchemit Date: 2008-04-05 20:43:39 +0000 (Sat, 05 Apr 2008) New Revision: 371 Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx Log: refactor PRovider, Handler and Connexion Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx =================================================================== --- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-05 20:43:32 UTC (rev 370) +++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-05 20:43:39 UTC (rev 371) @@ -3,6 +3,7 @@ <script> import org.codelutin.vcs.VCSAction; + import org.codelutin.vcs.VCSEntryLocation; import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler; import org.codelutin.vcs.ui.VCSUIConstants; @@ -14,9 +15,9 @@ @Override public void setVisible(boolean b) { - if (getHandler().getModel().getTabModel() == null) { + if (getModel().getLocation() == null) { // first launch, no tab model selected,choose one - selectTab(VCSUIConstants.DIFF_ALL_MODEL_PROPERTY); + allTab.doClick(); } super.setVisible(b); } @@ -33,12 +34,12 @@ this.handler = handler; } - protected void selectTab(String tabname) { - model.setTabModel(model.getModel(tabname)); + protected void selectTab(VCSEntryLocation location) { + getModel().setLocation(location); } protected void selectFile(JTable table) { - model.setFileModel(model.getTabModel().getData(table.getSelectionModel())[0]); + model.setFileModel(model.getModel().getData(table.getSelectionModel())[0]); } protected void doAction(VCSAction action) { @@ -77,15 +78,15 @@ <JToggleButton id='allTab' selected='true' buttonGroup='tabs' mnemonic="A" toolTipText="lutinvcs.tabs.diff.tooltip.all" icon='{createImageIcon("remote_vs_local.png")}' - onActionPerformed='selectTab("modelSynchAll")'/> + onActionPerformed='selectTab(VCSEntryLocation.ALL)'/> <JToggleButton id='localTab' selected='false' buttonGroup='tabs' mnemonic="L" toolTipText="lutinvcs.tabs.diff.tooltip.local" icon='{createImageIcon("local_vs_local.png")}' - onActionPerformed='selectTab("modelSynchLocal")'/> + onActionPerformed='selectTab(VCSEntryLocation.LOCAL)'/> <JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' mnemonic="R" icon='{createImageIcon("remote_vs_remote.png")}' toolTipText="lutinvcs.tabs.diff.tooltip.remote" - onActionPerformed='selectTab("modelSynchRemote")'/> + onActionPerformed='selectTab(VCSEntryLocation.REMOTE)'/> <JButton id='nextDiff' toolTipText="lutinvcs.action.tooltip.nextDiff" @@ -120,16 +121,16 @@ <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)"/> + <JTable id="allTable" styleClass='diffTable' + onMouseClicked="selectFile(allTable)"/> </JScrollPane> <JScrollPane id='localContent' styleClass='diffScroll' constraints='"modelSynchLocal"'> - <JTable id="modelDiffLocalTable" styleClass='diffTable' - onMouseClicked="selectFile(modelDiffLocalTable)"/> + <JTable id="localTable" styleClass='diffTable' + onMouseClicked="selectFile(localTable)"/> </JScrollPane> <JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"modelSynchRemote"' - onMouseClicked="selectFile(modelDiffRemoteTable)"> - <JTable id="modelDiffRemoteTable" styleClass='diffTable'/> + onMouseClicked="selectFile(remoteTable)"> + <JTable id="remoteTable" styleClass='diffTable'/> </JScrollPane> </JPanel> </cell> Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx =================================================================== --- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-05 20:43:32 UTC (rev 370) +++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-05 20:43:39 UTC (rev 371) @@ -3,6 +3,7 @@ <script> import org.codelutin.vcs.VCSAction; + import org.codelutin.vcs.VCSEntryLocation; import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler; import org.codelutin.vcs.ui.model.SynchUIModel; @@ -20,6 +21,14 @@ return (SynchUIModel) super.getModel(); } + @Override + public void setVisible(boolean b) { + if (getModel().getModel().getLocation() == null) { + // first launch, no tab model selected,choose one + allTab.doClick(); + } + super.setVisible(b); + } public JTable getTable(String modelName) { return (JTable) get$objectMap().get(modelName+"Table"); } @@ -28,19 +37,10 @@ return (JVCSPopup) get$objectMap().get(modelName+"Popup"); } - @Override - public void setVisible(boolean b) { - if (getHandler().getModel().getTabModel() == null) { - // first launch, no tab model selected,choose one - selectTab(VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY); + protected void setLocation(VCSEntryLocation location) { + getModel().setLocation(location); } - super.setVisible(b); - } - protected void selectTab(String tabname) { - getModel().setTabModel(getModel().getModel(tabname)); - } - protected void doAllAction(VCSAction action) { getModel().doAllAction(action); } @@ -52,22 +52,22 @@ <JPopupMenu enabled='false'> </JPopupMenu> - <org.codelutin.vcs.ui.JVCSPopup id="modelSynchAllPopup"/> - <org.codelutin.vcs.ui.JVCSPopup id="modelSynchLocalPopup"/> - <org.codelutin.vcs.ui.JVCSPopup id="modelSynchRemotePopup"/> + <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/> + <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/> + <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/> <Table> <row fill='both'> <cell fill='both' weightx='1'> <JToolBar> - <JToggleButton id='allTab' selected='true' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A" + <JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A" toolTipText="lutinvcs.tabs.tooltip.all" - onActionPerformed='selectTab("modelSynchAll")'/> + onActionPerformed='setLocation(VCSEntryLocation.ALL)'/> <JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local' mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local" - onActionPerformed='selectTab("modelSynchLocal")'/> + onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/> <JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote' mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote" - onActionPerformed='selectTab("modelSynchRemote")'/> + onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/> <JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll" icon='{createImageIcon("autoRefresh.png")}' @@ -98,13 +98,13 @@ <cell fill='both' weighty='1' weightx='2'> <JPanel id='preview' layout='{cardLayout}'> <JScrollPane id='allContent' styleClass='updateScroll' constraints='"modelSynchAll"'> - <JTable id="modelSynchAllTable" styleClass='updateTable'/> + <JTable id="allTable" styleClass='updateTable'/> </JScrollPane> <JScrollPane id='localContent' styleClass='updateScroll' constraints='"modelSynchLocal"'> - <JTable id="modelSynchLocalTable" styleClass='updateTable'/> + <JTable id="localTable" styleClass='updateTable'/> </JScrollPane> <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"modelSynchRemote"'> - <JTable id="modelSynchRemoteTable" styleClass='updateTable'/> + <JTable id="remoteTable" styleClass='updateTable'/> </JScrollPane> </JPanel> </cell>
participants (1)
-
tchemit@users.labs.libre-entreprise.org