Author: tchemit Date: 2008-04-03 22:23:44 +0000 (Thu, 03 Apr 2008) New Revision: 331 Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx Log: use AbstractUI Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx =================================================================== --- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-03 22:23:09 UTC (rev 330) +++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-03 22:23:44 UTC (rev 331) @@ -1,74 +1,71 @@ -<JDialog title='lutinvcs.confirm.title' id='ui' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'> +<org.codelutin.vcs.ui.AbstractUI title='lutinvcs.confirm.title' defaultCloseOperation='DISPOSE_ON_CLOSE' modal='true'> <style source="common.css"/> <script> - import org.codelutin.vcs.VCSAction; import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler; + import org.codelutin.vcs.ui.model.ConfirmUIModel ; - protected AbstractConfirmUIHandler handler; - public JConfirmUI(AbstractConfirmUIHandler handler) { - this.handler =handler; - JRootPane rootPane = ui.getRootPane(); - //rootPane.setDefaultButton(accept); + super(handler,new ConfirmUIModel()); - 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()); + getHandler().doAction(getCommitMessage().getText(),getModel().getModel()); } }; - 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; + return (AbstractConfirmUIHandler) super.getHandler(); } + public ConfirmUIModel getModel() { + return (ConfirmUIModel) super.getModel(); + } + 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> + <JToolBar id='tool'> + <Table fill='both' insets='0,0,0,0'> + <row> + <cell fill='both'> + <JLabel id="actionCommitLabel" text="lutinvcs.commit.message"/> + </cell> + <cell fill='both' weightx="1"> + <JLabel/> + </cell> + <cell anchor='east'> + <JButton id='lastMessages' + toolTipText="lutinvcs.action.tooltip.lastMessages" + icon='{createImageIcon("recent_msgs.png")}' + onActionPerformed='showLastMessages()'/> + </cell> + </row> + </Table> + + </JToolBar> </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}"--> + <JScrollPane id="commitScroll" height='90' verticalScrollBarPolicy="20" + columnHeaderView="{tool}"> <JTextArea id="commitMessage" constructorParams="4,50"/> </JScrollPane> </cell> @@ -80,7 +77,7 @@ <row> <cell fill='both' weightx='1' weighty='1'> <JScrollPane id='content' styleClass='confirmScroll'> - <JTable id="contentTable" styleClass='confirmTable' model="{model.getModel()}"/> + <JTable id="contentTable" styleClass='confirmTable' model="{getModel().getModel()}"/> </JScrollPane> </cell> </row> @@ -90,4 +87,4 @@ </cell> </row> </Table> -</JDialog> +</org.codelutin.vcs.ui.AbstractUI> 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 22:23:09 UTC (rev 330) +++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-03 22:23:44 UTC (rev 331) @@ -1,12 +1,25 @@ -<JDialog title='lutinvcs.synch.title' id='ui' defaultCloseOperation='DISPOSE_ON_CLOSE'> +<org.codelutin.vcs.ui.AbstractUI title='lutinvcs.synch.title' modal="true" defaultCloseOperation='DISPOSE_ON_CLOSE'> <style source="common.css"/> <script> import org.codelutin.vcs.VCSAction; import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler; + import org.codelutin.vcs.ui.model.SynchUIModel; - protected AbstractSynchUIHandler handler; + public JSynchUI(AbstractSynchUIHandler handler) { + super(handler,new SynchUIModel()); + } + @Override + protected AbstractSynchUIHandler getHandler() { + return (AbstractSynchUIHandler) handler; + } + + @Override + public SynchUIModel getModel() { + return (SynchUIModel) super.getModel(); + } + public JTable getTable(String modelName) { return (JTable) get$objectMap().get(modelName+"Table"); } @@ -24,39 +37,16 @@ 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)); + getModel().setTabModel(getModel().getModel(tabname)); } protected void doAllAction(VCSAction action) { - model.doAllAction(action); + getModel().doAllAction(action); } - - Action quitAction; - JRootPane rootPane = ui.getRootPane(); - quitAction = new AbstractAction("quit") { - private static final long serialVersionUID = -869095664995763057L; - public void actionPerformed(ActionEvent e) { - ui.dispose(); - } - }; - rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"),"quit"); - rootPane.getActionMap().put("quit", quitAction); </script> - <org.codelutin.vcs.ui.model.SynchUIModel id="model"/> + <!--org.codelutin.vcs.ui.model.SynchUIModel id="model"/--> <java.awt.CardLayout id='cardLayout'/> @@ -119,28 +109,5 @@ </JPanel> </cell> </row> - <!--row> - <cell fill='both'> - <JButton id='quit' text='lutinvcs.quit' handler='{quitAction}'/> - </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> +</org.codelutin.vcs.ui.AbstractUI>