Class TerminalModel


  • public class TerminalModel
    extends java.lang.Object
    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 Detail

      • FILE_EXTENSION

        public static final java.lang.String FILE_EXTENSION
        The file name extension with the dot ".ee".
        See Also:
        Constant Field Values
      • SESSION_NAME

        public static final java.lang.String SESSION_NAME
        Session name in EditorTerminalProps (the project relative file name).
        See Also:
        Constant Field Values
    • Method Detail

      • isDisposed

        public boolean isDisposed()
        Checks if disposed.
        Returns:
        true if disposed.
      • getSessions

        public EESession[] 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

        public java.lang.String getCaptureFileName​(int index)
        Gets the file name from an index: "Capture [index].ee".
        Parameters:
        index - An index.
        Returns:
        A file name based on an index.
      • getCaptureFileName

        public java.lang.String getCaptureFileName​(java.lang.String name)
        Gets the file name from an screen name: "Capture [name].ee".
        Parameters:
        name - The appended name.
        Returns:
        File name from an appended name.
      • createCapture

        public void createCapture​(org.eclipse.swt.widgets.Shell shell,
                                  HostSession hostSession)
        Creates a new capture.
        Parameters:
        shell - The shell.
        hostSession - The host session.
      • loadCapture

        public EditorTerminalProps loadCapture​(java.lang.String terminalModelProjectRelativeFileName)
                                        throws java.io.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:
        java.io.IOException - For load errors.
      • loadCapture

        public EditorTerminalProps loadCapture​(org.eclipse.core.resources.IFile ifile)
                                        throws java.io.IOException
        Load a screen capture session from a file or grabs an existing one.
        Parameters:
        ifile - The file.
        Returns:
        The terminal properties, never null.
        Throws:
        java.io.IOException - For load errors.
      • getMatchingCaptures

        public EESession[] getMatchingCaptures​(EditorScreenProp screen)
        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

        public EditorTerminalProps getFirstMatchingCapture​(EditorScreenProp screen)
        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).