- java.lang.Object
-
- eu.ess.xaos.ui.control.tree.directory.TreeDirectoryItems
-
public class TreeDirectoryItems extends Object
Containing the classes used byTreeDirectoryModel.- Author:
- claudio.rosati@esss.se
- See Also:
- LiveDirsFX:org.fxmisc.livedirs.PathItem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTreeDirectoryItems.DirectoryItem<T>ATreeItemrepresenting a directory.static classTreeDirectoryItems.FileItem<T>ATreeItemrepresenting a file.static classTreeDirectoryItems.PathItem<T>static classTreeDirectoryItems.TopLevelDirectoryItem<I,T>ATreeItemrepresenting a top-level directory, i.e.
-
Field Summary
Fields Modifier and Type Field Description static Function<Path,Path>DEFAULT_INJECTORstatic Function<Path,Path>DEFAULT_PROJECTORThe defaultFunctionconverting the object returned byTreeItem.getValue()into the correspondingPathwhen theTreeItemgeneric type is justPath.
-
Method Summary
-
-
-
Method Detail
-
createDirectoryItem
public static <T> TreeDirectoryItems.DirectoryItem<T> createDirectoryItem(T path, TreeDirectoryModel.GraphicFactory graphicFactory, Function<T,Path> projector, Function<Path,T> injector)
Creates a new instance ofTreeDirectoryItems.DirectoryItemfor the given parameters.- Type Parameters:
T- Type of the object returned byTreeItem.getValue().- Parameters:
path- The value of thisTreeItem.graphicFactory- The factory class used to get an "icon" representing the created item.projector- AFunctionconverting the object returned byTreeItem.getValue()into the correspondingPath.injector- AFunctionconverting aPathinto the object used as value in the correspondingTreeItem.- Returns:
- A new instance of
TreeDirectoryItems.DirectoryItem.
-
createDirectoryItem
public static <T> TreeDirectoryItems.DirectoryItem<T> createDirectoryItem(T path, TreeDirectoryModel.GraphicFactory graphicFactory, Function<T,Path> projector, Function<Path,T> injector, Consumer<? super TreeDirectoryItems.DirectoryItem<T>> onCollapse, Consumer<? super TreeDirectoryItems.DirectoryItem<T>> onExpand)
Creates a new instance ofTreeDirectoryItems.DirectoryItemfor the given parameters.Note that the
TreeDirectoryItems.DirectoryItem.addChildDirectory(Path, TreeDirectoryModel.GraphicFactory)method will pass the givenonCollapseandonExpandparameters to the newly createdTreeDirectoryItems.DirectoryItem.- Type Parameters:
T- Type of the object returned byTreeItem.getValue().- Parameters:
path- The value of thisTreeItem.graphicFactory- The factory class used to get an "icon" representing the created item.projector- AFunctionconverting the object returned byTreeItem.getValue()into the correspondingPath.injector- AFunctionconverting aPathinto the object used as value in the correspondingTreeItem.onCollapse- AConsumerto be invoked when this item is collapsed. Can benull.onExpand- AConsumerto be invoked when this item is expanded. Can benull.- Returns:
- A new instance of
TreeDirectoryItems.DirectoryItem.
-
createFileItem
public static <T> TreeDirectoryItems.FileItem<T> createFileItem(T path, FileTime lastModified, TreeDirectoryModel.GraphicFactory graphicFactory, Function<T,Path> projector)
Creates a new instance ofTreeDirectoryItems.FileItemfor the given parameters.- Type Parameters:
T- Type of the object returned byTreeItem.getValue().- Parameters:
path- The value of thisTreeItem.lastModified- The date of last modification for this item.graphicFactory- The factory class used to get an "icon" representing the created item.projector- AFunctionconverting the object returned byTreeItem.getValue()into the correspondingPath.- Returns:
- A new instance of
TreeDirectoryItems.FileItem.
-
createTopLevelDirectoryItem
public static <I,T> TreeDirectoryItems.TopLevelDirectoryItem<I,T> createTopLevelDirectoryItem(T path, TreeDirectoryModel.GraphicFactory graphicFactory, Function<T,Path> projector, Function<Path,T> injector, DirectoryModel.Reporter<I> reporter)
Creates a new instance ofTreeDirectoryItems.TopLevelDirectoryItemfor the given parameters.- Type Parameters:
I- Type of the initiator of changes to the model.T- Type of the object returned byTreeItem.getValue().- Parameters:
path- The value of thisTreeItem.graphicFactory- The factory class used to get an "icon" representing the created item.projector- AFunctionconverting the object returned byTreeItem.getValue()into the correspondingPath.injector- AFunctionconverting aPathinto the object used as value in the correspondingTreeItem.reporter- The object reporting changes in the model.- Returns:
- A new instance of
TreeDirectoryItems.TopLevelDirectoryItem.
-
createTopLevelDirectoryItem
public static <I,T> TreeDirectoryItems.TopLevelDirectoryItem<I,T> createTopLevelDirectoryItem(T path, TreeDirectoryModel.GraphicFactory graphicFactory, Function<T,Path> projector, Function<Path,T> injector, DirectoryModel.Reporter<I> reporter, Consumer<? super TreeDirectoryItems.DirectoryItem<T>> onCollapse, Consumer<? super TreeDirectoryItems.DirectoryItem<T>> onExpand)
Creates a new instance ofTreeDirectoryItems.TopLevelDirectoryItemfor the given parameters.Note that the
TreeDirectoryItems.DirectoryItem.addChildDirectory(Path, TreeDirectoryModel.GraphicFactory)method will pass the givenonCollapseandonExpandparameters to the newly createdTreeDirectoryItems.DirectoryItem.- Type Parameters:
I- Type of the initiator of changes to the model.T- Type of the object returned byTreeItem.getValue().- Parameters:
path- The value of thisTreeItem.graphicFactory- The factory class used to get an "icon" representing the created item.projector- AFunctionconverting the object returned byTreeItem.getValue()into the correspondingPath.injector- AFunctionconverting aPathinto the object used as value in the correspondingTreeItem.reporter- The object reporting changes in the model.onCollapse- AConsumerto be invoked when this item is collapsed. Can benull.onExpand- AConsumerto be invoked when this item is expanded. Can benull.- Returns:
- A new instance of
TreeDirectoryItems.TopLevelDirectoryItem.
-
-