IDEMPIERE-85 : Add confirmation on TreeMaintenance when moving all nodes

This commit is contained in:
Nicolas Micoud 2012-07-02 16:46:16 +02:00
parent 28ac2b4f83
commit 0aae5a3997
2 changed files with 31 additions and 24 deletions

View File

@ -34,6 +34,7 @@ import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import org.compiere.apps.ADialog;
import org.compiere.grid.tree.VTreePanel; import org.compiere.grid.tree.VTreePanel;
import org.compiere.model.MTree; import org.compiere.model.MTree;
import org.compiere.model.MTreeNode; import org.compiere.model.MTreeNode;
@ -297,6 +298,7 @@ public class VTreeMaintenance extends TreeMaintenance
*/ */
private void action_treeAddAll() private void action_treeAddAll()
{ {
if (ADialog.ask(m_WindowNo, null, "Add all item(s) on tree?")) { // idempiere-85
log.info(""); log.info("");
ListModel model = centerList.getModel(); ListModel model = centerList.getModel();
int size = model.getSize(); int size = model.getSize();
@ -306,6 +308,7 @@ public class VTreeMaintenance extends TreeMaintenance
ListItem item = (ListItem)model.getElementAt(index); ListItem item = (ListItem)model.getElementAt(index);
action_treeAdd(item); action_treeAdd(item);
} }
}
} // action_treeAddAll } // action_treeAddAll
/** /**
@ -313,6 +316,7 @@ public class VTreeMaintenance extends TreeMaintenance
*/ */
private void action_treeDeleteAll() private void action_treeDeleteAll()
{ {
if (ADialog.ask(m_WindowNo, null, "Remove all item(s) from tree?")) { // idempiere-85
log.info(""); log.info("");
ListModel model = centerList.getModel(); ListModel model = centerList.getModel();
int size = model.getSize(); int size = model.getSize();
@ -322,6 +326,7 @@ public class VTreeMaintenance extends TreeMaintenance
ListItem item = (ListItem)model.getElementAt(index); ListItem item = (ListItem)model.getElementAt(index);
action_treeDelete(item); action_treeDelete(item);
} }
}
} // action_treeDeleteAll } // action_treeDeleteAll
} // VTreeMaintenance } // VTreeMaintenance

View File

@ -388,6 +388,7 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
*/ */
private void action_treeAddAll() private void action_treeAddAll()
{ {
if (FDialog.ask(m_WindowNo, null, "Add all item(s) on tree?")) {
log.info(""); log.info("");
ListModel model = centerList.getModel(); ListModel model = centerList.getModel();
int size = model.getSize(); int size = model.getSize();
@ -397,6 +398,7 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
ListItem item = (ListItem)model.getElementAt(index); ListItem item = (ListItem)model.getElementAt(index);
action_treeAdd(item); action_treeAdd(item);
} }
}
} // action_treeAddAll } // action_treeAddAll
/** /**