com.ibm.commons.iloader.node
Class DataNodeVetoAdapter

java.lang.Object
  extended by com.ibm.commons.iloader.node.DataNodeVetoAdapter
All Implemented Interfaces:
DataNodeVetoListener

public abstract class DataNodeVetoAdapter
extends java.lang.Object
implements DataNodeVetoListener

A default adapter for the com.ibm.commons.iloader.node.DataNodeVetoListener interface. Allows clients to selectively veto certain events rather than needing to implement the entire listener interface. This default implementation returns true for all queries.

See Also:
DataNodeVetoListener

Constructor Summary
DataNodeVetoAdapter()
           
 
Method Summary
 boolean onCanDelete(DataNode node, int index)
          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 index)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataNodeVetoAdapter

public DataNodeVetoAdapter()
Method Detail

onCanDelete

public boolean onCanDelete(DataNode node,
                           int index)
Description copied from interface: DataNodeVetoListener
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanDelete(int) operation.

Specified by:
onCanDelete in interface DataNodeVetoListener
Parameters:
node - the DataNode that is about to execute notifyCanDelete(int)
index - the position of the item being deleted
Returns:
true if the item can be deleted

onCanDeleteAll

public boolean onCanDeleteAll(DataNode node)
Description copied from interface: DataNodeVetoListener
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanDeleteAll() operation.

Specified by:
onCanDeleteAll in interface DataNodeVetoListener
Parameters:
node - the DataNode that is about to execute notifyCanDeleteAll()
Returns:
true if all items can be deleted

onCanEdit

public boolean onCanEdit(DataNode node)
Description copied from interface: DataNodeVetoListener
Can veto if the provided DataNode may be edited. Called by the DataNode when com.ibm.commons.iloader.node.DataNode.notifyCanEdit() is being executed.

Specified by:
onCanEdit in interface DataNodeVetoListener
Parameters:
node - the DataNode under test
Returns:
true if the DataNode can be edited

onCanInsert

public boolean onCanInsert(DataNode node,
                           int index)
Description copied from interface: DataNodeVetoListener
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanInsert(int) operation.

Specified by:
onCanInsert in interface DataNodeVetoListener
Parameters:
node - the DataNode that is about to execute notifyCanInsert(int)
index - the position the item is to be inserted at
Returns:
true if the item can be inserted

onCanSetCurrentItem

public boolean onCanSetCurrentItem(DataNode node,
                                   int newPosition)
Description copied from interface: DataNodeVetoListener
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanSetCurrentItem(int) operation.

Specified by:
onCanSetCurrentItem in interface DataNodeVetoListener
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

public boolean onCanSetValue(DataNode node,
                             java.lang.String attributeName,
                             java.lang.String value,
                             java.lang.String oldValue)
Description copied from interface: DataNodeVetoListener
Can veto the current com.ibm.commons.iloader.node.DataNode.notifyCanSetValue(String, String, String) operation.

Specified by:
onCanSetValue in interface DataNodeVetoListener
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