oracle.dacf.util
Class MultiSelectDelete
java.lang.Object
|
+--oracle.dacf.util.MultiSelectDelete
- All Implemented Interfaces:
- java.util.EventListener, NavigationBarButtonClickListener
- public class MultiSelectDelete
- extends java.lang.Object
- implements NavigationBarButtonClickListener
An utility class which can be used to implement multi-select delete
in a GridControl.
By default, the NavigationBar delete button delete's the current
row of the rowset to which it is bound to. When a GridControl configured
to work in MultiSelection mode is used in association with a NavigationBar,
this behaviour may not be desirable. The end user would expect all selected
rows to be deleted. The default behaviour of the NavigationBar delete button
can be overridden by using this class.
When an instance of this class is registered as a NavigationBarButtonClick
Listener it responds to the 'delete' button click by deleting all rows that
are selected in the GridControl. After the delete operation the first
row prior to deletion will be the selected row. This behaviour can be
changed by overriding this class and implementing the
getNewCurrencyAfterDelete() method.
Usage :
// support for deleting all selected rows in grid
MultiSelectDelete msd = new MultiSelectDelete();
NavigationBar n = new NavigationBar();
GridControl g = new GridControl();
// put grid in multiselect mode
g.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
// add the grid to the MultiSelectDelete
msd.addGridControl(g);
// hook the MultiSelectDelete into the NavBar
n.addVetoableNavigationBarButtonClickListener(msd);
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiSelectDelete
public MultiSelectDelete()
MultiSelectDelete
public MultiSelectDelete(GridControl g)
addGridControl
public void addGridControl(GridControl g)
removeGridControl
public void removeGridControl(GridControl g)
navigationBarButtonClicked
public void navigationBarButtonClicked(NavigationBarButtonClickEvent event)
throws NavigationBarButtonClickVetoException
- Specified by:
navigationBarButtonClicked
in interface NavigationBarButtonClickListener
deleteSelectedRows
protected void deleteSelectedRows(javax.infobus.ScrollableRowsetAccess s,
int[] rows)
getRowset
protected javax.infobus.ScrollableRowsetAccess getRowset(GridControl g)
- get rowset which we can use to delete things
getNewCurrencyAfterDelete
protected int getNewCurrencyAfterDelete(int[] rows)
- An arbitary selection algo which assumes that the first row before
selection will be the new current row.