Class FileViewerContext
java.lang.Object
net.sf.basedb.clients.web.extensions.fileviewer.FileViewerContext
This class is used for holding information about a file that is beeing displayed
in the GUI in some context. A file item is always available by the
getFile()
method. The getType()
can be used to determine what other information that is
possible available.- Since:
- 3.16
- Author:
- nicklas
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate AnyToAny
private File
private DataFileType
private FileSetMember
private BasicItem
private FileViewerContext.Type
-
Constructor Summary
ModifierConstructorDescriptionprivate
FileViewerContext
(FileViewerContext.Type type, BasicItem parentItem) -
Method Summary
Modifier and TypeMethodDescriptionstatic FileViewerContext
Creates an any-to-any listing context where files belong to a parent item.static FileViewerContext
Creates a data-file listing context where files belong to a parent item.static FileViewerContext
file()
Creates a file-listing or single-file context without any other related items.Get the current any-to-any link pointing to the file.getFile()
Get the current file.Get the current data file type.Get the current file set member information for the file.If the context has a parent item this method returns it.getType()
Get the context type that the file is being displayed in.void
setCurrentAnyToAny
(BasicItem parentItem, File file, AnyToAny any) Sets the current any-to-any linked file and change the parent item.void
setCurrentAnyToAny
(File file, AnyToAny any) Sets the current any-to-any linked file.void
setCurrentDataFile
(BasicItem parentItem, File file, DataFileType fileType, FileSetMember member) Sets the current data file and change the parent item.void
setCurrentDataFile
(File file, DataFileType fileType, FileSetMember member) Sets the current data file.void
setCurrentFile
(File file) Set the current file.
-
Field Details
-
type
-
parentItem
-
file
-
any
-
member
-
fileType
-
-
Constructor Details
-
FileViewerContext
-
-
Method Details
-
file
Creates a file-listing or single-file context without any other related items.- See Also:
-
dataFile
Creates a data-file listing context where files belong to a parent item. The parent item is aFileStoreEnabled
item and the context also contains aFileSetMember
andDataFileType
.- See Also:
-
anyToAny
Creates an any-to-any listing context where files belong to a parent item. The parent item can be anyBasicItem
item and the context also contains anAnyToAny
link.- See Also:
-
getType
Get the context type that the file is being displayed in. -
getParentItem
If the context has a parent item this method returns it. -
getFile
Get the current file. -
getAnyToAny
Get the current any-to-any link pointing to the file. This should always be available if the type isFileViewerContext.Type.ANY_TO_ANY
or null otherwise. -
getFileType
Get the current data file type. This should always be available if the type isFileViewerContext.Type.DATA_FILE
or null otherwise. -
getMember
Get the current file set member information for the file. This should always be available if the type isFileViewerContext.Type.DATA_FILE
or null otherwise. -
setCurrentFile
Set the current file. -
setCurrentDataFile
Sets the current data file. -
setCurrentDataFile
public void setCurrentDataFile(BasicItem parentItem, File file, DataFileType fileType, FileSetMember member) Sets the current data file and change the parent item.- Since:
- 3.17
-
setCurrentAnyToAny
Sets the current any-to-any linked file. -
setCurrentAnyToAny
Sets the current any-to-any linked file and change the parent item.- Since:
- 3.17
-