danger.util
Interface ActiveFolder.Delegate

All Superinterfaces:
ActiveList.Delegate
All Known Implementing Classes:
ActiveFolder.WeakDelegateList
Enclosing interface:
ActiveFolder


public static interface ActiveFolder.Delegate
extends ActiveList.Delegate

Interface for delegates that get notified on changes to instances of ActiveFolder.


Method Summary
 ActiveFolder getFolder()
          Get the folder that this delegate represents, if any.
 void onSetData(ActiveFolder folder, Object data)
          This method is called whenever the arbitrary data object of a folder is changed.
 void onSetOpen(ActiveFolder folder, boolean open)
          This method is called whenever the opened state of a folder is changed.
 void onSetTitle(ActiveFolder folder, String title)
          This method is called whenever the title of a folder is changed.
 
Methods inherited from interface danger.util.ActiveList.Delegate
onItemAdded, onItemRemoved, onItemsReordered, onItemUpdated, onRangeAdded, onRangeRemoved
 

Method Detail

getFolder

ActiveFolder getFolder()
Get the folder that this delegate represents, if any. This method exists so that, when one is holding onto a folder, one can walk up the heritage of a tree of folders via the delegates to reach a top-level folder being viewed / manipulated. Unless you have a particularly good reason not to, this method should almost certainly be implemented as simply return null.

Returns:
null-ok; the folder that this delegate represents

onSetOpen

void onSetOpen(ActiveFolder folder,
               boolean open)
This method is called whenever the opened state of a folder is changed. For example, StdActiveFolder.setOpen(boolean) is a concrete method that can change the opened state of a folder.

Parameters:
folder - non-null; the folder which was updated
open - the new opened state

onSetTitle

void onSetTitle(ActiveFolder folder,
                String title)
This method is called whenever the title of a folder is changed. For example, StdActiveFolder.setTitle(java.lang.String) is a concrete method that can change the title of a folder.

Parameters:
folder - non-null; the folder which was updated
title - non-null; the new title

onSetData

void onSetData(ActiveFolder folder,
               Object data)
This method is called whenever the arbitrary data object of a folder is changed. For example, StdActiveFolder.setData(java.lang.Object) is a concrete method that can change the data object of a folder.

Parameters:
folder - non-null; the folder which was updated
data - null-ok; the new data