Print the specified text to the specified PrintWriter.

@param pw The printWriter to write the help to
@param width The number of characters to display per line
@param text The text to be written to the PrintWriter
439762
public void printWrapped(PrintWriter pw, int width, String text)
    {
        printWrapped(pw, width, 0, text);
    }
949114
public void println(final String str) throws IOException {
        this.writer.print(str);
        this.writer.print("\r\n");
        this.writer.flush();
    }
913337
protected void write(PrintWriter writer, String indent) {
        writer.print("(");

        if (!isEmpty()) {
            Token root = getRoot(true);
            int type = root.getType();
            int meaning = root.getMeaning();


            //
            // Display our type, text, and (optional) meaning

            writer.print(Types.getDescription(type));

            if (meaning != type) {
                writer.print(" as ");
                writer.print(Types.getDescription(meaning));
            }

            if (getStartLine() > -1) {
                writer.print(" at " + getStartLine() + ":" + getStartColumn());
            }

            String text = root.getText();
            int length = text.length();
            if (length > 0) {
                writer.print(": ");
                if (length > 40) {
                    text = text.substring(0, 17) + "..." + text.substring(length - 17, length);
                }

                writer.print(" \"");
                writer.print(text);
                writer.print("\" ");
            } else if (children() > 0) {
                writer.print(": ");
            }


            //
            // Recurse to display the children.

            int count = size();
            if (count > 1) {
                writer.println("");

                String indent1 = indent + "  ";
                String indent2 = indent + "   ";
                for (int i = 1; i < count; i++) {
                    writer.print(indent1);
                    writer.print(i);
                    writer.print(": ");

                    get(i, true).write(writer, indent2);
                }

                writer.print(indent);
            }
        }

        if (indent.length() > 0) {
            writer.println(")");
        } else {
            writer.print(")");
        }
    }
1364750
public void println(PrintStream ps, String message){
        print(ps, message);
        ps.println();
    }
648017
def write(self, text: str):
        
        # Default color is NORMAL.
        last_color = (self._DARK_CODE, 0)
        # We use splitlines with keepends in order to keep the line breaks.
        # Then we split by using the console width.
        original_lines = text.splitlines(True)
        lines = self._split_lines(original_lines) if self._width_limit else original_lines

        # Print the new width-formatted lines.
        for line in lines:
            # Print indents only at line beginnings.
            if not self._in_line:
                self._writer.write(' ' * self.indents_sum)
            # Remove colors if needed.
            if not self._colors:
                for color_code in self._ANSI_REGEXP.findall(line):
                    line = line.replace(self._ANSI_COLOR_CODE % (color_code[0], int(color_code[1])), '')
            elif not self._ANSI_REGEXP.match(line):
                # Check if the line starts with a color. If not, we apply the color from the last line.
                line = self._ANSI_COLOR_CODE % (last_color[0], int(last_color[1])) + line
            # Print the final line.
            self._writer.write(line)
            # Update the in_line status.
            self._in_line = not line.endswith(self.LINE_SEP)
            # Update the last color used.
            if self._colors:
                last_color = self._ANSI_REGEXP.findall(line)[-1]

        # Update last position (if there was no line break in the end).
        if len(lines) > 0:
            last_line = lines[-1]
            if not last_line.endswith(self.LINE_SEP):
                # Strip the colors to figure out the real number of characters in the line.
                if self._colors:
                    for color_code in self._ANSI_REGEXP.findall(last_line):
                        last_line = last_line.replace(self._ANSI_COLOR_CODE % (color_code[0], int(color_code[1])), '')
                self._last_position += len(last_line)
            else:
                self._last_position = 0
                self._is_first_line = False
        else:
            self._last_position = 0

        # Reset colors for the next print.
        if self._colors and not text.endswith(self.NORMAL):
            self._writer.write(self.NORMAL)
783808
final public void print(Object v)
  {
    if (v == null)
      write(_nullChars, 0, _nullChars.length);
    else {
      String s = v.toString();
      
      write(s, 0, s.length());
    }
  }
1360656
public void newlineShowText(String text) {
        state.yTLM -= state.leading;
        showText2(text);
        content.append("'").append_i(separator);
    }
220402
public static void print(final CharSequence line) {
        print(new Applyable<ConsoleReaderWrapper>() {
            public void apply(ConsoleReaderWrapper consoleReaderWrapper) {
                consoleReaderWrapper.print(line);
            }
        });
    }
613214
protected void printHeader(Graphics2D g2d, String headerText)
    {
        FontMetrics fm = g2d.getFontMetrics();
        int textHeight = fm.getHeight();
        int stringWidth = fm.stringWidth(headerText);
        int textX = (pageRect.width - stringWidth) / 2 + pageRect.x;
        int textY = pageRect.y + textHeight + BORDER;
        g2d.drawString(headerText , textX, textY);
    }
958828
private void print(String text) {
    String indent = Strings.repeat(" ", mIndentationLevel * INDENT_SIZE);
    mPrintStream.println(indent + text);
  }
452157
public void printUsage(PrintWriter pw, int width, String cmdLineSyntax)
    {
        int argPos = cmdLineSyntax.indexOf(' ') + 1;

        printWrapped(pw, width, getSyntaxPrefix().length() + argPos, getSyntaxPrefix() + cmdLineSyntax);
    }
829516
@Override
  public void printStackTrace(java.io.PrintWriter pw) {
    synchronized (pw) {
      if (detail != null) {
        detail.printStackTrace(pw);
      }
      super.printStackTrace(pw);
    }
  }
488047
public void printRawLines(String msg) {
        PrintWriter noticeWriter = writers.get(WriterKind.NOTICE);
        printRawLines(noticeWriter, msg);
    }
860549
public void println(String text) {
        try {
            if(autoIndent) printIndent();
            out.write(text);
            println();
        } catch(IOException ioe) {
            throw new GroovyRuntimeException(ioe);
        }
    }
923141
public void addText(String text) {
        try {
            writer.append(text);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
1267217
private void printRawDiag(PrintWriter pw, String prefix, int pos, String msg) {
        if (source == null || pos == Position.NOPOS) {
            printRawLines(pw, prefix + msg);
        } else {
            int line = source.getLineNumber(pos);
            JavaFileObject file = source.getFile();
            if (file != null)
                printRawLines(pw,
                           file.getName() + ":" +
                           line + ": " + msg);
            printErrLine(pos, pw);
        }
        pw.flush();
    }
658757
public void print(java.io.PrintWriter printWriter)
    {
        synchronized (flushHelper) {
            synchronized (notifyHelper) {
                synchronized (logBufferLock) {
                    printWriter.println("State Dump for:" + cclass.getName()
                                        + " logFile=" + logFile + "(java.io.RandomaccessFile)"
                                        + " fileLogHeader=" + fileLogHeader + "(FileLogHeader)"
                                        + "\n filePosition=" + filePosition + "(long)"
                                        + " filePositionSectorByte=" + filePositionSectorByte + "(byte)"
                                        + " bufferFilePosition=" + bufferFilePosition + "(long)"
                                        + " bufferSectorByte=" + bufferSectorByte + "(byte)"
                                        + " fileSpaceLeft=" + fileSpaceLeft + "(long)"
                                    );
                    printWriter.println(" firstPageToFlush=" + firstPageToFlush + "(int)"
                                        + " lastPageNotified=" + lastPageNotified + "(int)"
                                        + " nextPageToNotify=" + nextPageToNotify + "(int)"
                                        + " firstPageFilling=" + firstPageFilling + "(int)"
                                        + " lastPageFilling=" + lastPageFilling + "(int)"
                                        + "\n nextFreeByteInLogBuffer=" + nextFreeByteInLogBuffer + "(int)"
                                        + " newLogBufferPages=" + newLogBufferPages + "(int)"
                                    );
                    printWriter.println();

                    logBuffer.print(printWriter);
                } // synchronized (logBufferLock).
            } // synchronized (notifyHelper).
        } // synchronized (flushHelper).
    }