Class MoreTextBuilder

    • Constructor Detail

      • MoreTextBuilder

        public MoreTextBuilder()
    • Method Detail

      • getMoreText

        public String getMoreText()
        Retrieves the more text from the more text property.
        Returns:
        The more text stored by the more text property.
      • setMoreText

        public void setMoreText​(String aMoreText)
        Sets the more text for the more text property.
        Parameters:
        aMoreText - The more text to be stored by the more text mode property.
      • getColumnWidth

        public int getColumnWidth()
        Specified by:
        getColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor
      • setColumnWidth

        public void setColumnWidth​(int aColumnWidth)
        Specified by:
        setColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
      • withColumnWidth

        public MoreTextBuilder withColumnWidth​(int aColumnWidth)
        Specified by:
        withColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<MoreTextBuilder>
      • getMoreTextMode

        public MoreTextMode getMoreTextMode()
        Retrieves the more text mode from the more text mode property.
        Returns:
        The more text mode stored by the more text mode property.
      • setMoreTextMode

        public void setMoreTextMode​(MoreTextMode aMoreTextMode)
        Sets the more text mode for the more text mode property.
        Parameters:
        aMoreTextMode - The more text mode to be stored by the more text mode property.
      • withMoreTextMode

        public MoreTextBuilder withMoreTextMode​(MoreTextMode aMoreTextMode)
        Sets the more text mode for the more text mode property.
        Parameters:
        aMoreTextMode - the more text mode
        Returns:
        The builder for applying multiple build operations.
      • withMoreText

        public MoreTextBuilder withMoreText​(String aMoreText)
        Sets the more text for the more text property.
        Parameters:
        aMoreText - the more text
        Returns:
        The builder for applying multiple build operations.
      • asMoreText

        public static String[] asMoreText​(String[] aText,
                                          int aLength,
                                          String aMore,
                                          MoreTextMode aMoreTextMode)
        The text array is "mored" depending on the provided MoreTextMode. It is assumed that the text does not contain any ANSI escape codes, else asMoreText(String[], int, String, MoreTextMode, boolean) In case it is MoreTextMode.NONE, then the text is returned untouched. In case it is MoreTextMode.LEFT, then the text is "mored" to the left. In case it is MoreTextMode.RIGHT, then the text is "mored" the the right.
        Parameters:
        aText - The text array to be truncated.
        aLength - The length to be reached.
        aMore - The text to be prepended to the left in case the text was longer than the required length.
        aMoreTextMode - The MoreTextMode specifying on how to truncate the text.
        Returns:
        The accordingly "mored" text array.
      • asMoreText

        public static String[] asMoreText​(String[] aText,
                                          int aLength,
                                          String aMore,
                                          MoreTextMode aMoreTextMode,
                                          boolean hasAnsiEscapeCodes)
        The text array is "mored" depending on the provided MoreTextMode. In case it is MoreTextMode.NONE, then the text is returned untouched. In case it is MoreTextMode.LEFT, then the text is "mored" to the left. In case it is MoreTextMode.RIGHT, then the text is "mored" the the right.
        Parameters:
        aText - The text array to be truncated.
        aLength - The length to be reached.
        aMore - The text to be prepended to the left in case the text was longer than the required length.
        aMoreTextMode - The MoreTextMode specifying on how to truncate the text.
        hasAnsiEscapeCodes - Whether to take any (non printable) ANSI escape codes into account which would, when not being considered, cause wrong results.
        Returns:
        The accordingly "mored" text array.
      • asMoreText

        public static String asMoreText​(String aText,
                                        int aLength,
                                        String aMore,
                                        MoreTextMode aMoreTextMode)
        The text is "mored" depending on the provided MoreTextMode. It is assumed that the text does not contain any ANSI escape codes, else asMoreText(String, int, String, MoreTextMode, boolean) In case it is MoreTextMode.NONE, then the text is returned untouched. In case it is MoreTextMode.LEFT, then the text is "mored" to the left. In case it is MoreTextMode.RIGHT, then the text is "mored" the the right.
        Parameters:
        aText - The text array to be truncated.
        aLength - The length to be reached.
        aMore - The text to be prepended to the left in case the text was longer than the required length.
        aMoreTextMode - The MoreTextMode specifying on how to truncate the text.
        Returns:
        The accordingly "mored" text array.
      • asMoreText

        public static String asMoreText​(String aText,
                                        int aLength,
                                        String aMore,
                                        MoreTextMode aMoreTextMode,
                                        boolean hasAnsiEscapeCodes)
        The text is "mored" depending on the provided MoreTextMode. In case it is MoreTextMode.NONE, then the text is returned untouched. In case it is MoreTextMode.LEFT, then the text is "mored" to the left. In case it is MoreTextMode.RIGHT, then the text is "mored" the the right.
        Parameters:
        aText - The text to be truncated.
        aLength - The length to be reached.
        aMore - The text to be prepended to the left in case the text was longer than the required length.
        aMoreTextMode - The MoreTextMode specifying on how to truncate the text.
        hasAnsiEscapeCodes - Whether to take any (non printable) ANSI escape codes into account which would, when not being considered, cause wrong results.
        Returns:
        The accordingly "mored" text.
      • getText

        public String[] getText()
        Retrieves the text from the text property.
        Specified by:
        getText in interface TextAccessor
        Returns:
        The text stored by the text property.
      • setText

        public void setText​(String... aText)
        Sets the text for the text property.
        Specified by:
        setText in interface TextAccessor.TextMutator
        Parameters:
        aText - The text to be stored by the text property.