Class FixedTerminalSizeProvider

  • All Implemented Interfaces:
    UnixTerminalSizeQuerier

    public class FixedTerminalSizeProvider
    extends java.lang.Object
    implements UnixTerminalSizeQuerier
    Using this terminal size provider, your terminal will be set to a fixed size and will never receive any resize events. Of course if the physical terminal is resized, in reality it will have a different size, but the application won't know about it. The size reported to the user is always the size attached to this object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private TerminalSize size  
    • Constructor Summary

      Constructors 
      Constructor Description
      FixedTerminalSizeProvider​(TerminalSize size)
      Creating a FixedTerminalSizeProvider set to a particular size that it will always report whenever the associated Terminal interface queries.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TerminalSize queryTerminalSize()
      Checks what the size of the terminal is, measured in number of rows and columns.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedTerminalSizeProvider

        public FixedTerminalSizeProvider​(TerminalSize size)
        Creating a FixedTerminalSizeProvider set to a particular size that it will always report whenever the associated Terminal interface queries.
        Parameters:
        size - Size the terminal should be statically initialized to
    • Method Detail

      • queryTerminalSize

        public TerminalSize queryTerminalSize()
        Description copied from interface: UnixTerminalSizeQuerier
        Checks what the size of the terminal is, measured in number of rows and columns. The implementer of this interface is expected to know which terminal we are querying for and have all it needs to figure out the size. One way of implementing this could be to read of an external value or variable or calling IPCs or just return a static size at all times.
        Specified by:
        queryTerminalSize in interface UnixTerminalSizeQuerier
        Returns:
        Size of the terminal at this point in time