Package io.goobi.viewer.model.archives
Class ArchiveTree
java.lang.Object
io.goobi.viewer.model.archives.ArchiveTree
- All Implemented Interfaces:
Serializable
Table of contents and associated functionality for a record. Instances can be either the default archive or a session-local copy.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final StringConstantDEFAULT_GROUP="_DEFAULT". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollapseAll.voidcollapseAll(boolean collapseAllEntries) voidcollapseEntry(ArchiveEntry entry) Collapses this entry and hides all sub-entries.voidexpandAll.voidexpandEntry(ArchiveEntry entry) Expands this entry and sets all sub-entries visible if their immediate parent is expanded.voidexpandUpEntry(ArchiveEntry entry) Expands and sets visible all ancestors of this node and expands siblings of this node.voidgenerate(ArchiveEntry root) Sets the given root entry, generates a new flat list and adds it to entryMap.getEntryById(String identifier) Gets the hierarchical tree as a flat list.getFlatView.getRootElement(String group) getTocElements.getTreeView.getTreeViewForGroup(String group) getTreeViewForGroup.getViewForGroup(String group) getViewForGroup.getVisibleTree(boolean searchActive) booleanisEntryExpanded(ArchiveEntry entry) booleanisEntryVisible(ArchiveEntry entry) booleanbooleanvoidresetCollapseLevel(ArchiveEntry entry, int maxDepth) Recursively expands and sets visible entries at or below maxDepth; hides and collapses any below.voidvoidvoidsetSelectedEntry(ArchiveEntry selectedEntry) voidsetTrueRootElement(ArchiveEntry trueRootElement) voidtoggleSelectedEntry(ArchiveEntry selectedEntry) voidupdate(ArchiveEntry rootElement)
-
Field Details
-
DEFAULT_GROUP
ConstantDEFAULT_GROUP="_DEFAULT".- See Also:
-
DEFAULT_COLLAPSE_LEVEL
public static final int DEFAULT_COLLAPSE_LEVEL- See Also:
-
-
Constructor Details
-
ArchiveTree
public ArchiveTree()Creates a new TOC instance. -
ArchiveTree
-
-
Method Details
-
update
- Parameters:
rootElement- root archive entry to update the tree from
-
generate
Sets the given root entry, generates a new flat list and adds it to entryMap.- Parameters:
root- The root entry to set
-
getViewForGroup
getViewForGroup.- Parameters:
group- entry map group key to retrieve the flat view for- Returns:
- a list of archive entries for the given group, or null if none found
-
getTreeViewForGroup
getTreeViewForGroup.- Parameters:
group- entry map group key to build the tree view for- Returns:
- a list of archive entries for the given group with tree nesting applied
-
getFlatView
getFlatView.- Returns:
- a flat list of all archive entries in the default group
-
getTreeView
getTreeView.- Returns:
- a list of archive entries for the default group with tree nesting applied
-
getVisibleTree
- Parameters:
searchActive- true if a search filter is currently active- Returns:
- List
-
resetCollapseLevel
Recursively expands and sets visible entries at or below maxDepth; hides and collapses any below.- Parameters:
entry- archive entry to start recursion frommaxDepth- maximum hierarchy level to keep expanded and visible
-
getSelectedEntry
-
setSelectedEntry
-
isExpandEntryOnSelection
public boolean isExpandEntryOnSelection() -
toggleSelectedEntry
- Parameters:
selectedEntry- archive entry to toggle selection for
-
getTrueRootElement
-
setTrueRootElement
-
getRootElement
- Returns:
- Root element for the default group
-
getRootElement
- Parameters:
group- entry map group key to retrieve the root entry for- Returns:
- Root element for the given group
-
expandAll
public void expandAll()expandAll. -
collapseAll
public void collapseAll()collapseAll. -
collapseAll
public void collapseAll(boolean collapseAllEntries) - Parameters:
collapseAllEntries- If true, all invisible child children will also be collapsed
-
getTocElements
getTocElements.- Returns:
- a list of all archive entries in the default group
-
getFlatEntryList
Gets the hierarchical tree as a flat list.- Returns:
- List
-
getEntryById
- Parameters:
identifier- node identifier to search for in the tree- Returns:
- the
ArchiveEntrywith the given identifier if it exists in the tree; null otherwise
-
search
- Parameters:
searchValue- search string to match against node labels and IDs
-
resetSearch
public void resetSearch() -
isTreeFullyLoaded
public boolean isTreeFullyLoaded() -
isEntryVisible
- Parameters:
entry- archive entry to check visibility for- Returns:
- true if given entry is currently visible; false otherwise
-
isEntryExpanded
- Parameters:
entry- archive entry to check expansion state for- Returns:
- true if given entry is currently expanded; false otherwise
-
expandEntry
Expands this entry and sets all sub-entries visible if their immediate parent is expanded.- Parameters:
entry- archive entry to expand
-
collapseEntry
Collapses this entry and hides all sub-entries.- Parameters:
entry- archive entry to collapse
-
expandUpEntry
Expands and sets visible all ancestors of this node and expands siblings of this node.- Parameters:
entry- archive entry whose ancestors are to be expanded
-