r2112 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
Author: tchemit Date: 2009-04-16 13:42:48 +0000 (Thu, 16 Apr 2009) New Revision: 2112 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx Log: super binding sur table... Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-04-16 13:39:50 UTC (rev 2111) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-04-16 13:42:48 UTC (rev 2112) @@ -82,19 +82,35 @@ protected void clearDoneJobs() { getContextValue(SimulAction.class).clearDoneJobs(); } + + protected void updateActions() { + setCanLaunch(!selectionModelQueueTab.isSelectionEmpty()); + setCanShowLog(!selectionModelQueueTabDone.isSelectionEmpty()); + setCanClear(queueTableDone.getModel().getRowCount()>0); + } ]]> </script> + + <Boolean id='canLaunch' javaBean='false'/> + <Boolean id='canShowLog' javaBean='false'/> + <Boolean id='canClear' javaBean='false'/> + + <DefaultListSelectionModel id="selectionModelQueueTab" onValueChanged='updateActions()'/> + <DefaultListSelectionModel id="selectionModelQueueTabDone" onValueChanged='updateActions()'/> + <row> <cell columns="4" fill="both" weightx="1.0" weighty="0.5"> <JScrollPane> - <JTable id="queueTable" model='{getContextValue(SimulationServiceTableModel.class, "new")}' selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"/> + <JTable id="queueTable" model='{getContextValue(SimulationServiceTableModel.class, "new")}' selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}" + selectionModel="{selectionModelQueueTab}"/> </JScrollPane> </cell> </row> <row> <cell columns="4" fill="both" weightx="1.0" weighty="0.5"> <JScrollPane> - <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}' selectionMode="{ListSelectionModel.SINGLE_SELECTION}" /> + <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}' selectionMode="{ListSelectionModel.SINGLE_SELECTION}" + selectionModel="{selectionModelQueueTabDone}" /> </JScrollPane> </cell> </row> @@ -103,13 +119,13 @@ <JToggleButton id="autoLaunchButton" text="isisfish.queue.simulationLaunch"/> </cell> <cell fill="horizontal" weightx="0.3"> - <JButton id="stopSimuButton" text="isisfish.queue.stopSimulation" onActionPerformed='stopSimulation()' enabled='{queueTable.getSelectionModel().getMinSelectionIndex() != -1}' /> + <JButton id="stopSimuButton" text="isisfish.queue.stopSimulation" onActionPerformed='stopSimulation()' enabled='{isCanLaunch()}' /> </cell> <cell fill="horizontal" weightx="0.3"> - <JButton id="showLogButton" text="isisfish.queue.showLog" onActionPerformed='viewLog()' enabled='{!queueTableDone.getSelectionModel().isSelectionEmpty()}' /> + <JButton id="showLogButton" text="isisfish.queue.showLog" onActionPerformed='viewLog()' enabled='{isCanShowLog()}' /> </cell> <cell fill="horizontal" weightx="0.3"> - <JButton id="clearDoneJobsButton" text="isisfish.queue.clearDone" onActionPerformed='clearDoneJobs()' enabled='{queueTableDone.getModel().getRowCount() > 0}' /> + <JButton id="clearDoneJobsButton" text="isisfish.queue.clearDone" onActionPerformed='clearDoneJobs()' enabled='{isCanClear()}' /> </cell> </row> </Table> \ No newline at end of file
participants (1)
-
tchemit@users.labs.libre-entreprise.org