Package com.iizigo.term.project
Class TerminalModel
java.lang.Object
com.iizigo.term.project.TerminalModel
The Terminal Model contains the routines required for a required Terminal Project where all screen captures are stored when the Terminal Plug-in is used.
- Author:
- Christopher Mindus
Field Summary
Method Summary
Modifier and TypeMethodDescriptionvoid
createCapture
(org.eclipse.swt.widgets.Shell shell, HostSession hostSession) Creates a new capture.getCaptureFileName
(int index) Gets the file name from an index: "Capture [index].ee".getCaptureFileName
(String name) Gets the file name from an screen name: "Capture [name].ee".Gets the first terminal capture matching the screen.getMatchingCaptures
(EditorScreenProp screen) Gets the terminal sessions that matches a screen (only captures, no recordings).int
Gets the next capture index, based on file names of type "Capture NN.ee".org.eclipse.core.resources.IProject
Gets the project.Gets all EE screens.boolean
Checks if disposed.loadCapture
(String terminalModelProjectRelativeFileName) Load a screen capture session from a file or grabs an existing one.loadCapture
(org.eclipse.core.resources.IFile ifile) Load a screen capture session from a file or grabs an existing one.
Field Details
FILE_EXTENSION
The file name extension with the dot ".ee".- See Also:
SESSION_NAME
Session name in EditorTerminalProps (the project relative file name).- See Also:
Method Details
isDisposed
public boolean isDisposed()Checks if disposed.- Returns:
- true if disposed.
getSessions
Gets all EE screens.- Returns:
- The (cahed) EE screens, never null.
getProject
public org.eclipse.core.resources.IProject getProject()Gets the project.- Returns:
- The terminal project.
getNextCaptureIndex
public int getNextCaptureIndex()Gets the next capture index, based on file names of type "Capture NN.ee".- Returns:
- The next screen index name for automatic naming.
getCaptureFileName
Gets the file name from an index: "Capture [index].ee".- Parameters:
index
- An index.- Returns:
- A file name based on an index.
getCaptureFileName
Gets the file name from an screen name: "Capture [name].ee".- Parameters:
name
- The appended name.- Returns:
- File name from an appended name.
createCapture
Creates a new capture.- Parameters:
shell
- The shell.hostSession
- The host session.
loadCapture
public EditorTerminalProps loadCapture(String terminalModelProjectRelativeFileName) throws IOException Load a screen capture session from a file or grabs an existing one.- Parameters:
terminalModelProjectRelativeFileName
- The file name.- Returns:
- The terminal properties, never null.
- Throws:
IOException
- For load errors.
loadCapture
Load a screen capture session from a file or grabs an existing one.- Parameters:
ifile
- The file.- Returns:
- The terminal properties, never null.
- Throws:
IOException
- For load errors.
getMatchingCaptures
Gets the terminal sessions that matches a screen (only captures, no recordings).- Parameters:
screen
- The screen to match.- Returns:
- The matching captures, never null.
getFirstMatchingCapture
Gets the first terminal capture matching the screen.- Parameters:
screen
- The screen to match.- Returns:
- The properties or null if not found (or not loaded yet).