Class TerminalModel

java.lang.Object
com.iizigo.term.project.TerminalModel

public class TerminalModel extends 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 Details

    • FILE_EXTENSION

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

      public static final String 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

      public EESession[] getSessions()
      Gets all EE screens.
      Returns:
      The (cahed) EE screens, never null.
    • getProject

      public 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 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 String getCaptureFileName(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(Shell shell, HostSession hostSession)
      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

      public EditorTerminalProps loadCapture(IFile ifile) throws 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:
      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).