|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 20:21:20
|
[ http://jira.springframework.org/browse/RCP-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-264:
-----------------------------
Fix Version/s: 1.x
> Master/detail hooks on commands: delete, save, update, ...
> ----------------------------------------------------------
>
> Key: RCP-264
> URL: http://jira.springframework.org/browse/RCP-264
> Project: Spring Framework Rich Client Project
> Issue Type: Improvement
> Components: Helper Classes
> Reporter: Geoffrey De Smet
> Assignee: Oliver Hutchison
> Fix For: 1.x
>
>
> Currently it's hard to hook in a myService.deleteMyObject(myObject) on a delete command without disturbing all the logic already in spring rich.
> The only way I see is by overriding deleteSelectedItems() with an almost exact implementation.
> It would be nice if it was like this in AbstractMasterForm:
> /**
> * Delete the detail item at the specified index.
> * @param index Index of item to delete
> */
> protected void deleteSelectedItems() {
> ListSelectionModel sm = getSelectionModel();
> if( sm.isSelectionEmpty() ) {
> return;
> }
> _detailForm.reset();
> int min = sm.getMinSelectionIndex();
> int max = sm.getMaxSelectionIndex();
> // Loop backwards and delete each selected item in the interval
> for( int index = max; index >= min; index-- ) {
> if( sm.isSelectedIndex( index ) ) {
> deleteItem(getMasterEventList().getElementAt(index));
> getMasterEventList().remove( index );
> }
> }
> }
> /**
> * Template method, hook for service calls.
> * @param o the object to delete
> */
> protected void deleteItem(Object o) {
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|