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

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

public class FolderSupport<NODE extends LibraryNode,FOLDER extends Folder<NODE>>
extends Object

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

Author:
Gregory Fouquet

Constructor Summary
FolderSupport(FOLDER folder)
           
 
Method Summary
 void addContent(NODE node)
          Adds content to folder after checking the content can be added.
 FOLDER createCopy(FOLDER newFolder)
           
 List<String> getContentNames()
           
 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 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()

createCopy

public FOLDER createCopy(FOLDER newFolder)

getContentNames

public List<String> getContentNames()


Copyright © 2010-2012 Henix, henix.fr. All Rights Reserved.