Package org.fife.ui.rtextarea

Examples of org.fife.ui.rtextarea.Gutter


        if (!linenumbers)
            scrollPane.setIconRowHeaderEnabled(true);
        Document document = getDocument();
        document.addDocumentListener(this);
        addCaretListener(this);
        Gutter gutter = scrollPane.getGutter();
        gutter.setLineNumberingStartIndex(startLineNumber);
        gutter.setBookmarkingEnabled(true);
        setupGutterListener(gutter);
    }
View Full Code Here


        setCaretPosition(insert.eoff);
        setBracketMatchingEnabled(b);
    }

    public void highlightLine(int line) {
        Gutter gutter = scrollPane.getGutter();
        if (line == -1) {
            if (currentLineTrackingInfo != null)
                gutter.removeTrackingIcon(currentLineTrackingInfo);
            currentLineTrackingInfo = null;
            return ;
        }
        setCaretLine(line);
        try {
            if (currentLineTrackingInfo != null)
                gutter.removeTrackingIcon(currentLineTrackingInfo);
            currentLineTrackingInfo = gutter.addLineTrackingIcon(line, CURRENTLINE);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        // have to repaint any views after the receiver.
        RSyntaxTextArea textArea = (RSyntaxTextArea)getContainer();
        textArea.repaint();
        // Must also revalidate container so gutter components, such
        // as line numbers, get updated for this line's new height
        Gutter gutter = RSyntaxUtilities.getGutter(textArea);
        if (gutter!=null) {
          gutter.revalidate();
          gutter.repaint();
        }
      }
      else if (a != null) {
        Component c = getContainer();
        Rectangle alloc = (Rectangle) a;
View Full Code Here

     * Repaints the gutter in a text area's scroll pane, if necessary.
     *
     * @param textArea The text area.
     */
    protected void possiblyRepaintGutter(RTextArea textArea) {
      Gutter gutter = RSyntaxUtilities.getGutter(textArea);
      if (gutter!=null) {
        gutter.repaint();
      }
    }
View Full Code Here

   * @param textArea The text area.
   * @return The color to use.
   */
  public static Color getFoldedLineBottomColor(RSyntaxTextArea textArea) {
    Color color = Color.gray;
    Gutter gutter = RSyntaxUtilities.getGutter(textArea);
    if (gutter!=null) {
      color = gutter.getFoldIndicatorForeground();
    }
    return color;
  }
View Full Code Here

   * @return The gutter, or <code>null</code> if the text area is not in
   *         an {@link RTextScrollPane}.
   * @see RTextScrollPane#getGutter()
   */
  public static Gutter getGutter(RTextArea textArea) {
    Gutter gutter = null;
    Container parent = textArea.getParent();
    if (parent instanceof JViewport) {
      parent = parent.getParent();
      if (parent instanceof RTextScrollPane) {
        RTextScrollPane sp = (RTextScrollPane)parent;
View Full Code Here

      secondaryLanguages[i]= textArea.getSecondaryLanguageBackground(i+1);
    }

    scheme = textArea.getSyntaxScheme();

    Gutter gutter = RSyntaxUtilities.getGutter(textArea);
    if (gutter!=null) {
      bgColor = gutter.getBackground();
      gutterBorderColor = gutter.getBorderColor();
      activeLineRangeColor = gutter.getActiveLineRangeColor();
      iconRowHeaderInheritsGutterBG = gutter.getIconRowHeaderInheritsGutterBackground();
      lineNumberColor = gutter.getLineNumberColor();
      lineNumberFont = gutter.getLineNumberFont().getFamily();
      lineNumberFontSize = gutter.getLineNumberFont().getSize();
      foldIndicatorFG = gutter.getFoldIndicatorForeground();
      foldBG = gutter.getFoldBackground();
    }

  }
View Full Code Here

      textArea.setSecondaryLanguageBackground(i+1, secondaryLanguages[i]);
    }

    textArea.setSyntaxScheme(scheme);

    Gutter gutter = RSyntaxUtilities.getGutter(textArea);
    if (gutter!=null) {
      gutter.setBackground(bgColor);
      gutter.setBorderColor(gutterBorderColor);
      gutter.setActiveLineRangeColor(activeLineRangeColor);
      gutter.setIconRowHeaderInheritsGutterBackground(iconRowHeaderInheritsGutterBG);
      gutter.setLineNumberColor(lineNumberColor);
      String fontName = lineNumberFont!=null ? lineNumberFont :
        baseFont.getFamily();
      int fontSize = lineNumberFontSize>0 ? lineNumberFontSize :
        baseFont.getSize();
      Font font = getFont(fontName, Font.PLAIN, fontSize);
      gutter.setLineNumberFont(font);
      gutter.setFoldIndicatorForeground(foldIndicatorFG);
      gutter.setFoldBackground(foldBG);
    }

  }
View Full Code Here

TOP

Related Classes of org.fife.ui.rtextarea.Gutter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.