Class StyledText.Printing

java.lang.Object
org.eclipse.swt.custom.StyledText.Printing
All Implemented Interfaces:
Runnable
Enclosing class:
StyledText

static class StyledText.Printing extends Object implements Runnable
The Printing class implements printing of a range of text. An instance of Printing is returned in the StyledText#print(Printer) API. The run() method may be invoked from any thread.
  • Field Details

  • Constructor Details

    • Printing

      Printing(StyledText styledText, Printer printer, StyledTextPrintOptions printOptions)
      Creates an instance of Printing. Copies the widget content and rendering data that needs to be requested from listeners.
      Parameters:
      printer - printer device to print on.
      printOptions - print options
      parent - StyledText widget to print.
  • Method Details

    • cacheLineData

      void cacheLineData(StyledText styledText)
      Caches all line data that needs to be requested from a listener.
      Parameters:
      printerContent - StyledTextContent to request line data for.
    • copyContent

      StyledTextContent copyContent(StyledTextContent original)
      Copies the text of the specified StyledTextContent.
      Parameters:
      original - the StyledTextContent to copy.
    • dispose

      void dispose()
      Disposes of the resources and the PrintRenderer.
    • init

      void init()
    • print

      void print()
      Prints the lines in the specified page range.
    • printDecoration

      void printDecoration(int page, boolean header, TextLayout layout)
      Print header or footer decorations.
      Parameters:
      page - page number to print, if specified in the StyledTextPrintOptions header or footer.
      header - true = print the header, false = print the footer
    • printDecorationSegment

      void printDecorationSegment(String segment, int alignment, int page, boolean header, TextLayout layout)
      Print one segment of a header or footer decoration. Headers and footers have three different segments. One each for left aligned, centered, and right aligned text.
      Parameters:
      segment - decoration segment to print
      alignment - alignment of the segment. 0=left, 1=center, 2=right
      page - page number to print, if specified in the decoration segment.
      header - true = print the header, false = print the footer
    • printLine

      void printLine(int x, int y, GC gc, Color foreground, Color background, TextLayout layout, TextLayout printLayout, int index)
    • run

      public void run()
      Starts a print job and prints the pages specified in the constructor.
      Specified by:
      run in interface Runnable