[Buix-commits] r281 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
Author: tchemit Date: 2008-04-02 08:55:11 +0000 (Wed, 02 Apr 2008) New Revision: 281 Added: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx Log: popup pour les actions sur la selection des lignes l'ui de synch avance bien 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-02 08:53:39 UTC (rev 280) +++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-02 08:55:11 UTC (rev 281) @@ -1,10 +1,42 @@ -<JDialog title='lutinvcs.synch.title' id='ui' - defaultCloseOperation='DISPOSE_ON_CLOSE'> +<JDialog title='lutinvcs.synch.title' id='ui' defaultCloseOperation='DISPOSE_ON_CLOSE'> <style source="common.css"/> <script> import org.codelutin.vcs.VCSAction; + import org.codelutin.vcs.ui.action.AbstractSynchUIHandler; + protected AbstractSynchUIHandler handler; + + public JTable getTable(String modelName) { + return (JTable) get$objectMap().get(modelName+"Table"); + } + + public JVCSPopup getPopup(String modelName) { + return (JVCSPopup) get$objectMap().get(modelName+"Popup"); + } + + @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); + } + super.setVisible(b); + } + + public JSynchUI(AbstractSynchUIHandler handler) { + this.handler =handler; + } + + protected AbstractSynchUIHandler getHandler() { + return handler; + } + + protected void setHandler(AbstractSynchUIHandler handler) { + this.handler = handler; + } + protected void selectTab(String tabname) { model.setTabModel(model.getModel(tabname)); } @@ -12,8 +44,8 @@ protected void doAllAction(VCSAction action) { model.doAllAction(action); } + Action quitAction; - JRootPane rootPane = ui.getRootPane(); rootPane.setDefaultButton(quit); quitAction = new AbstractAction(quit.getText()) { @@ -24,79 +56,67 @@ }; rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"),"quit"); rootPane.getActionMap().put("quit", quitAction); - allTable.setModel(model.getModel("model.synch.all")); - localTable.setModel(model.getModel("model.synch.local")); - remoteTable.setModel(model.getModel("model.synch.remote")); - refresh.setText(""); - diffAll.setText(""); - updateAll.setText(""); - commitAll.setText(""); - revertAll.setText(""); - </script> - <!--org.codelutin.vcs.ui.SynchUIHandlerImpl id='handler' constructorParameters="this"/--> - <org.codelutin.vcs.ui.model.SynchUIModel id="model"/> - <DefaultListModel id='listModel'/> - <!--org.codelutin.vcs.ui.model.SynchUIModel id="model"/--> - <!--org.codelutin.vcs.ui.model.SynchVCSFileStatesModel id="tabModel"/--> <java.awt.CardLayout id='cardLayout'/> - <JPopupMenu id="tablePopupMenu" invoker='{allTable}' enabled='false'> - <JMenuItem id='diff' text="lutinvcs.action.diff" toolTipText="lutinvcs.action.tooltip.diff"/> - <JMenuItem id='update' text="lutinvcs.action.update" toolTipText="lutinvcs.action.tooltip.update"/> - <JMenuItem id='commit' text="lutinvcs.action.commit" toolTipText="lutinvcs.action.tooltip.commit"/> - <JMenuItem id='revert' text="lutinvcs.action.revert" toolTipText="lutinvcs.action.tooltip.revert"/> + <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"/> <Table> <row fill='both'> <cell fill='both' weightx='1'> <JToolBar> <JToggleButton id='allTab' selected='true' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A" toolTipText="lutinvcs.tabs.tooltip.all" - onActionPerformed='selectTab("model.synch.all")'/> + onActionPerformed='selectTab("modelSynchAll")'/> <JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local' - mnemonic="L" - toolTipText="lutinvcs.tabs.tooltip.local" - onActionPerformed='selectTab("model.synch.local")'/> + mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local" + onActionPerformed='selectTab("modelSynchLocal")'/> <JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote' - mnemonic="R" - toolTipText="lutinvcs.tabs.tooltip.remote" - onActionPerformed='selectTab("model.synch.remote")'/> + mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote" + onActionPerformed='selectTab("modelSynchRemote")'/> - <JButton id='refresh' text="lutinvcs.action.refresh" toolTipText="lutinvcs.action.tooltip.refresh" - icon='{createImageIcon("autoRefresh.png")}'/> + <JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll" + icon='{createImageIcon("autoRefresh.png")}' + onActionPerformed='doAllAction(VCSAction.REFRESH)'/> - <JButton id='diffAll' text="lutinvcs.action.diffAll" toolTipText="lutinvcs.action.tooltip.diffAll" + <JButton id='diffAll' toolTipText="lutinvcs.action.tooltip.diffAll" icon='{createImageIcon("diff.png")}' onActionPerformed='doAllAction(VCSAction.DIFF)'/> - <JButton id='updateAll' text="lutinvcs.action.updateAll" - onActionPerformed='doAllAction(VCSAction.UPDATE)' - toolTipText="lutinvcs.action.tooltip.updateAll" icon='{createImageIcon("update.png")}'/> + <JButton id='updateAll' toolTipText="lutinvcs.action.tooltip.updateAll" + icon='{createImageIcon("update.png")}' + onActionPerformed='doAllAction(VCSAction.UPDATE)'/> - <JButton id='commitAll' text="lutinvcs.action.commitAll" - onActionPerformed='doAllAction(VCSAction.COMMIT)' - toolTipText="lutinvcs.action.tooltip.commitAll" icon='{createImageIcon("commit.png")}'/> + <JButton id='commitAll' toolTipText="lutinvcs.action.tooltip.commitAll" + icon='{createImageIcon("commit.png")}' + onActionPerformed='doAllAction(VCSAction.COMMIT)'/> - <JButton id='revertAll' text="lutinvcs.action.revertAll" - onActionPerformed='doAllAction(VCSAction.REVERT)' - toolTipText="lutinvcs.action.tooltip.revertAll" icon='{createImageIcon("rollback.png")}'/> + <JButton id='revertAll' toolTipText="lutinvcs.action.tooltip.revertAll" + icon='{createImageIcon("rollback.png")}' + onActionPerformed='doAllAction(VCSAction.REVERT)'/> + + <JButton id='deleteAll' toolTipText="lutinvcs.action.tooltip.deleteAll" + icon='{createImageIcon("remove.png")}' + onActionPerformed='doAllAction(VCSAction.DELETE)'/> </JToolBar> </cell> </row> <row fill='both'> <cell fill='both' weighty='1' weightx='2'> <JPanel id='preview' layout='{cardLayout}'> - <JScrollPane id='allContent' styleClass='updateScroll' constraints='"model.synch.all"'> - <JTable id="allTable" styleClass='updateTable'/> + <JScrollPane id='allContent' styleClass='updateScroll' constraints='"modelSynchAll"'> + <JTable id="modelSynchAllTable" styleClass='updateTable'/> </JScrollPane> - <JScrollPane id='localContent' styleClass='updateScroll' constraints='"model.synch.local"'> - <JTable id="localTable" styleClass='updateTable'/> + <JScrollPane id='localContent' styleClass='updateScroll' constraints='"modelSynchLocal"'> + <JTable id="modelSynchLocalTable" styleClass='updateTable'/> </JScrollPane> - <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"model.synch.remote"'> - <JTable id="remoteTable" styleClass='updateTable'/> + <JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"modelSynchRemote"'> + <JTable id="modelSynchRemoteTable" styleClass='updateTable'/> </JScrollPane> </JPanel> </cell> Added: 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 (rev 0) +++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-02 08:55:11 UTC (rev 281) @@ -0,0 +1,30 @@ +<JPopupMenu enabled='false'> + <script> + import org.codelutin.vcs.VCSAction; + import org.codelutin.vcs.ui.action.VCSAbsractAction; + + protected VCSAbsractAction dispatchAction; + + protected void setDispatchAction(VCSAbsractAction action) { + this.dispatchAction=action; + } + + protected void doAction(VCSAction action,JMenuItem item) { + dispatchAction.setAction(action); + ActionEvent e = new ActionEvent( item,1,action.name()); + dispatchAction.actionPerformed(e); + } + </script> + <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" + icon='{createImageIcon("diff.png")}' onActionPerformed='doAction(VCSAction.DIFF,diff)'/> + <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" + icon='{createImageIcon("commit.png")}' onActionPerformed='doAction(VCSAction.COMMIT,commit)'/> + <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" + icon='{createImageIcon("remove.png")}' onActionPerformed='doAction(VCSAction.DELETE,delete)'/> +</JPopupMenu>
participants (1)
-
tchemit@users.labs.libre-entreprise.org