Class FileViewerContext
java.lang.Object
net.sf.basedb.clients.web.extensions.fileviewer.FileViewerContext
public class FileViewerContext extends Object
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
Nested Classes Modifier and Type Class Description static class
FileViewerContext.Type
-
Field Summary
Fields Modifier and Type Field Description private AnyToAny
any
private File
file
private DataFileType
fileType
private FileSetMember
member
private BasicItem
parentItem
private FileViewerContext.Type
type
-
Constructor Summary
Constructors Modifier Constructor Description private
FileViewerContext(FileViewerContext.Type type, BasicItem parentItem)
-
Method Summary
Modifier and Type Method Description static FileViewerContext
anyToAny(BasicItem parentItem)
Creates an any-to-any listing context where files belong to a parent item.static FileViewerContext
dataFile(BasicItem parentItem)
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.AnyToAny
getAnyToAny()
Get the current any-to-any link pointing to the file.File
getFile()
Get the current file.DataFileType
getFileType()
Get the current data file type.FileSetMember
getMember()
Get the current file set member information for the file.BasicItem
getParentItem()
If the context has a parent item this method returns it.FileViewerContext.Type
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:
FileViewerContext.Type.FILE
-
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:
FileViewerContext.Type.DATA_FILE
-
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:
FileViewerContext.Type.ANY_TO_ANY
-
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
-