org.pushingpixels.flamingo.api.bcb
Class BreadcrumbBarCallBack<T>

java.lang.Object
  extended by org.pushingpixels.flamingo.api.bcb.BreadcrumbBarCallBack<T>
Type Parameters:
T - Type of data associated with each breadcrumb bar item.
Direct Known Subclasses:
BreadcrumbFileSelector.DirCallback, BreadcrumbMultiSvnSelector.PathCallback, BreadcrumbSvnSelector.PathCallback, BreadcrumbTreeAdapterSelector.TreeCallback

public abstract class BreadcrumbBarCallBack<T>
extends java.lang.Object

The application callback that can be set on JBreadcrumbBar.


Field Summary
protected  boolean throwsExceptions
          If true, some of the operations will throw BreadcrumbBarException.
 
Constructor Summary
BreadcrumbBarCallBack()
           
 
Method Summary
 java.io.InputStream getLeafContent(T leaf)
          Returns the input stream with the leaf content.
 java.util.List<StringValuePair<T>> getLeafs(java.util.List<BreadcrumbItem<T>> path)
          Returns the choice element that corresponds to the specified path.
 java.util.List<StringValuePair<T>> getPathChoices(java.util.List<BreadcrumbItem<T>> path)
          Returns the choice element that corresponds to the specified path.
 void setThrowsExceptions(boolean throwsExceptions)
          Sets the indication whether the operations of this breadcrumb bar will throw BreadcrumbBarException.
 void setup()
          Sets up the callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

throwsExceptions

protected boolean throwsExceptions
If true, some of the operations will throw BreadcrumbBarException.

Constructor Detail

BreadcrumbBarCallBack

public BreadcrumbBarCallBack()
Method Detail

setup

public void setup()
           throws BreadcrumbBarException
Sets up the callback.

Throws:
BreadcrumbBarException - Runtime exception that wraps the cause. Is thrown only when setThrowsExceptions(boolean) has been called with true parameter.

setThrowsExceptions

public void setThrowsExceptions(boolean throwsExceptions)
Sets the indication whether the operations of this breadcrumb bar will throw BreadcrumbBarException.

Parameters:
throwsExceptions - If true, the operations of this breadcrumb bar will throw BreadcrumbBarException.

getPathChoices

public java.util.List<StringValuePair<T>> getPathChoices(java.util.List<BreadcrumbItem<T>> path)
                                                  throws BreadcrumbBarException
Returns the choice element that corresponds to the specified path. If the path is empty, null should be returned. If path is null, the "root" elements should be returned

Parameters:
path - Breadcrumb bar path.
Returns:
The choice element that corresponds to the specified path
Throws:
BreadcrumbBarException - Runtime exception that wraps the cause. Is thrown only when setThrowsExceptions(boolean) has been called with true parameter.

getLeafs

public java.util.List<StringValuePair<T>> getLeafs(java.util.List<BreadcrumbItem<T>> path)
                                            throws BreadcrumbBarException
Returns the choice element that corresponds to the specified path. If the path is empty, null should be returned. If path is null, the "root" elements should be returned

Parameters:
path - Breadcrumb bar path.
Returns:
The choice element that corresponds to the specified path
Throws:
BreadcrumbBarException - Runtime exception that wraps the cause. Is thrown only when setThrowsExceptions(boolean) has been called with true parameter.

getLeafContent

public java.io.InputStream getLeafContent(T leaf)
                                   throws BreadcrumbBarException
Returns the input stream with the leaf content. Some implementations may return null if this is not applicable.

Parameters:
leaf - Leaf.
Returns:
Input stream with the leaf content. May be null if this is not applicable.
Throws:
BreadcrumbBarException - Runtime exception that wraps the cause. Is thrown only when setThrowsExceptions(boolean) has been called with true parameter.