com.ibm.commons.iloader.node
Interface DataNodeVetoListener

All Known Implementing Classes:
DataNodeVetoAdapter

public interface DataNodeVetoListener

This interface allows clients to veto certain operations in the DataNode lifecycle. Clients may opt to prevent certain operations from occurring. For instance if a certain model deal with submitting data to a server, then the veto listener could opt to not allow a setValue operation from occurring if a certain operation was executed twice.


Method Summary
 boolean onCanDelete(DataNode node, int position)
          Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanDelete(int) operation.
 boolean onCanDeleteAll(DataNode node)
          Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanDeleteAll() operation.
 boolean onCanEdit(DataNode node)
          Can veto if the provided DataNode may be edited.
 boolean onCanInsert(DataNode node, int position)
          Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanInsert(int) operation.
 boolean onCanSetCurrentItem(DataNode node, int newPosition)
          Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanSetCurrentItem(int) operation.
 boolean onCanSetValue(DataNode node, java.lang.String attributeName, java.lang.String value, java.lang.String oldValue)
          Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanSetValue(String, String, String) operation.
 

Method Detail

onCanSetCurrentItem

boolean onCanSetCurrentItem(DataNode node,
                            int newPosition)
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanSetCurrentItem(int) operation.

Parameters:
node - the DataNode that is about to execute notifyCanSetCurrentItem(int)
newPosition - the position of the new item
Returns:
true if the operation should be allowed to continue

onCanSetValue

boolean onCanSetValue(DataNode node,
                      java.lang.String attributeName,
                      java.lang.String value,
                      java.lang.String oldValue)
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanSetValue(String, String, String) operation.

Parameters:
node - the DataNode that is about to execute notifyCanSetValue(String, String, String)
attributeName - the name of the attribute whose value is to be set
value - the proposed new value of the attribute
oldValue - the old value of the attribute
Returns:
true if the value can be set

onCanEdit

boolean onCanEdit(DataNode node)
Can veto if the provided DataNode may be edited. Called by the DataNode when com.ibm.commons.iloader.node.DataNode.notifyCanEdit() is being executed.

Parameters:
node - the DataNode under test
Returns:
true if the DataNode can be edited

onCanInsert

boolean onCanInsert(DataNode node,
                    int position)
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanInsert(int) operation.

Parameters:
node - the DataNode that is about to execute notifyCanInsert(int)
position - the position the item is to be inserted at
Returns:
true if the item can be inserted

onCanDelete

boolean onCanDelete(DataNode node,
                    int position)
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanDelete(int) operation.

Parameters:
node - the DataNode that is about to execute notifyCanDelete(int)
position - the position of the item being deleted
Returns:
true if the item can be deleted

onCanDeleteAll

boolean onCanDeleteAll(DataNode node)
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanDeleteAll() operation.

Parameters:
node - the DataNode that is about to execute notifyCanDeleteAll()
Returns:
true if all items can be deleted