File Control Operations
There are five file related operations and are detailed as follows:
I. Open Operation
- Provide dialog for users to select a file to open
=> if the selected file is opened
VttApi.SetFocusAt( )
- Move the frame with the selected open file to the front
- Request focus to the frame with the selected open file
=> if the selected file is not opened, and no file is opened in current frame
LoadFileToVtt( )
- load file to current vttObj
=> if the selected file is not opened, and a different file is opened in current frame
VttApi.Add( )
LoadFileToVtt( )
- load file to the new added vttObj
II. Save Operation
=> if no document is opened on current Frame
- Show warning message: "Empty text! Please open a text (file) first!"
=> if a VTT document is opened on current frame
SaveVttFileDialog( )
- Save Text, Tags, Markups to target files
=> if a non-VTT document is opened on current frame
SaveNonVttFileDialog( )
- Provide dialog for user to add file extension (.vtt) to the current file
- Save Text, Tags, Markups to target files
III. Save as Operation
=> if no document is opened
- Show warning message: "Empty text! Please open a text (file) first!"
=> if a document is opened
SaveAsDialog( )
- Add file extension (.vtt) to the current file if not VTT file
- Show dialog for users to choose a file to save
- Save Text, Tags, Markups to target file
IV. Close Operation
=> if no document is opened
- Show warning message: "No text (file) is opened! Can't close!"
=> if a document is opened, and there is some change since last save
SaveCloseDialog( )
- Add file extension (.vtt) to the current file if not VTT file
- Provide dialog to save Text, Tags, Markups to target file
CloseFileOperation( )
- if more than one frame are opened, close current frame
- if only one frame is open, close the document
=> if a document is opened, and there is no change since last save
CloseFileOperation( )
- if more than one frame are opened, close current frame
- if only one frame is open, close the document
V. Exit Operation
=> Exit current frame
ExitFileOperation( )
- if no file opened, close the current frame
- If a file opened, with some change since last save, provide save dialog
- If a file opened, with no change since last save, close the current frame
=> Exit all other frames
SetFocusAt( )
ExitFileOperation( )
=> Exit VTT application
Cleanup all created java objects