Class AbstractShell

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
Direct Known Subclasses:
ShellSql, ShellWeb

public abstract class AbstractShell extends JTextPane
A Terminal completely built from swing text pane.
See Also:
  • Field Details

    • loginPassword

      protected String[] loginPassword
      User and password for database.
  • Constructor Details

  • Method Details

    • action

      public abstract void action(String cmd, UUID terminalID, String wbhPath, String... arg)
      Run when cmd is validated.
      Parameters:
      cmd - Command to execute
      terminalID - Unique ID for terminal instance
      wbhPath - URL of shell
      arg - Additional parameters (User and password for SQLShell)
    • reset

      public void reset()
      Update terminal and use default behavior.
    • append

      public void append(String string)
      Add a text at the end of textpane.
      Parameters:
      string - Text to add
    • displayPrompt

      public void displayPrompt(boolean isAddingPrompt)
      Append prompt to textpane, measure prompt the first time is used.
      Parameters:
      isAddingPrompt - Should we measure prompt length?
    • getScrollableTracksViewportWidth

      public boolean getScrollableTracksViewportWidth()
      NoWrap.
      Specified by:
      getScrollableTracksViewportWidth in interface Scrollable
      Overrides:
      getScrollableTracksViewportWidth in class JEditorPane
    • addMouseMotionListener

      public void addMouseMotionListener(MouseMotionListener l)
      Cancel every mouse movement processing like drag/drop.
      Overrides:
      addMouseMotionListener in class Component
    • getLineOfOffset

      public int getLineOfOffset(int offset) throws BadLocationException
      Get index of line for current offset (generally cursor position).
      Parameters:
      offset - Position on the line
      Returns:
      Index of the line
      Throws:
      BadLocationException
    • getLineStartOffset

      public int getLineStartOffset(int line) throws BadLocationException
      Get position of the beginning of the line.
      Parameters:
      line - Index of the line
      Returns:
      Offset of line
      Throws:
      BadLocationException
    • getIsEdited

      public boolean[] getIsEdited()
    • getUuidShell

      public UUID getUuidShell()
    • getUrlShell

      public String getUrlShell()
    • getPrompt

      public String getPrompt()