Search in sources :

Example 1 with WDeleteSelection

use of org.adempiere.webui.window.WDeleteSelection in project adempiere by adempiere.

the class AbstractADWindowPanel method onDeleteSelection.

// Elaine 2008/12/01
/**
	 * @see ToolbarListener#onDelete()
	 */
public void onDeleteSelection() {
    GridTab currentTab = toolbar.getCurrentPanel().getGridTab();
    if (currentTab.isReadOnly())
        return;
    //	
    WDeleteSelection dSelection = new WDeleteSelection(currentTab);
    dSelection.showDialog();
    if (dSelection.isOkPressed()) {
        logger.fine("ok");
        int[] indices = dSelection.getSelection();
        Arrays.sort(indices);
        int offset = 0;
        for (int i = 0; i < indices.length; i++) {
            currentTab.navigate(indices[i] - offset);
            if (currentTab.dataDelete()) {
                offset++;
            }
        }
        curTabPanel.dynamicDisplay(0);
    } else {
        logger.fine("cancel");
    }
    //	Set Focus
    focusToActivePanel();
}
Also used : GridTab(org.compiere.model.GridTab) WDeleteSelection(org.adempiere.webui.window.WDeleteSelection)

Aggregations

WDeleteSelection (org.adempiere.webui.window.WDeleteSelection)1 GridTab (org.compiere.model.GridTab)1