org.squashtest.csp.tm.domain.library
Class FolderSupport<NODE extends LibraryNode>

java.lang.Object
  extended by org.squashtest.csp.tm.domain.library.FolderSupport<NODE>
Type Parameters:
NODE -

public class FolderSupport<NODE extends LibraryNode>
extends Object

This class is meant to be used as a delegate when one implements a Folder.

Author:
Gregory Fouquet

Constructor Summary
FolderSupport(Folder<NODE> folder)
           
 
Method Summary
 void addContent(NODE node)
          Adds content to folder after checking the content can be added.
 boolean hasContent()
           
 boolean isContentNameAvailable(String name)
          Tells if the given name is already attributed to any of folder's content.
 void notifyAssociatedProjectWasSet(Project formerProject, Project currentProject)
          Notifies that the project was set to something.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderSupport

public FolderSupport(Folder<NODE> folder)
Method Detail

addContent

public void addContent(NODE node)
Adds content to folder after checking the content can be added.

Parameters:
node - the content to add

isContentNameAvailable

public boolean isContentNameAvailable(String name)
Tells if the given name is already attributed to any of folder's content.

Parameters:
name -
Returns:

notifyAssociatedProjectWasSet

public void notifyAssociatedProjectWasSet(Project formerProject,
                                          Project currentProject)
Notifies that the project was set to something. Notifies each of folder's content it is now associated with a new project. We dont want to expose a "setProject" method in folders, so the folder is reponsible for setting the project association, then it can extend the operation by calling this method.

Parameters:
formerProject - former value of folder's associated project
currentProject - new value of folder's associated project

hasContent

public boolean hasContent()


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.