jetbrains.buildServer.web.util
Class ProjectHierarchyBean

java.lang.Object
  extended by jetbrains.buildServer.web.util.ProjectHierarchyBean
Direct Known Subclasses:
BuildTypesHierarchyBean, ProjectHierarchyTreeBean

public class ProjectHierarchyBean
extends java.lang.Object

Represents the helper bean class for a project that knows its depth, hence allows to place it correctly in the web UI.

This particular bean is intended to be used in all drop downs and multi-selects that show projects.

Since:
8.0
Author:
Maxim Podkolzine (maxim.podkolzine@jetbrains.com)

Nested Class Summary
protected static interface ProjectHierarchyBean.BeanCreator<T extends ProjectHierarchyBean>
           
 
Field Summary
static int MAX_DEPTH
           
protected  int myDepth
           
protected  SProject myProject
           
 
Constructor Summary
ProjectHierarchyBean(SProject project)
           
 
Method Summary
protected static
<T extends ProjectHierarchyBean>
java.util.List<T>
buildFor(java.util.List<SProject> projects, ProjectHierarchyBean.BeanCreator<T> creator, boolean alreadySorted)
           
static java.util.List<SProject> fixProjectsOrderWithRespectToHierarchy(java.util.List<SProject> projects)
           
 int getDepth()
           
 int getLimitedDepth()
           
static int getLimitedDepth(int depth)
           
 SProject getProject()
           
static java.util.List<ProjectHierarchyBean> getProjectsFor(java.util.List<SProject> list, boolean alreadySorted)
           
static java.util.List<ProjectHierarchyBean> getProjectsFor(ProjectManager projectManager)
           
static boolean isParent(SProject child, SProject parent)
           
protected  void setDepth(int depth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DEPTH

public static final int MAX_DEPTH
See Also:
Constant Field Values

myProject

protected final SProject myProject

myDepth

protected int myDepth
Constructor Detail

ProjectHierarchyBean

public ProjectHierarchyBean(@NotNull
                            SProject project)
Method Detail

getProject

@NotNull
public SProject getProject()

getDepth

public int getDepth()

getLimitedDepth

public int getLimitedDepth()

getLimitedDepth

public static int getLimitedDepth(int depth)

setDepth

protected void setDepth(int depth)

getProjectsFor

@NotNull
public static java.util.List<ProjectHierarchyBean> getProjectsFor(@NotNull
                                                                          java.util.List<SProject> list,
                                                                          boolean alreadySorted)

getProjectsFor

@NotNull
public static java.util.List<ProjectHierarchyBean> getProjectsFor(@NotNull
                                                                          ProjectManager projectManager)

buildFor

@NotNull
protected static <T extends ProjectHierarchyBean> java.util.List<T> buildFor(@NotNull
                                                                                     java.util.List<SProject> projects,
                                                                                     @NotNull
                                                                                     ProjectHierarchyBean.BeanCreator<T> creator,
                                                                                     boolean alreadySorted)

fixProjectsOrderWithRespectToHierarchy

@NotNull
public static java.util.List<SProject> fixProjectsOrderWithRespectToHierarchy(@NotNull
                                                                                      java.util.List<SProject> projects)

isParent

public static boolean isParent(@NotNull
                               SProject child,
                               @NotNull
                               SProject parent)