Package org.fife.ui.rtextarea

Examples of org.fife.ui.rtextarea.Gutter


    });
    RTextScrollPane sp = new RTextScrollPane(textArea);
    sp.setFoldIndicatorEnabled(true);
    sp.setIconRowHeaderEnabled(true);
   
    Gutter gutter = sp.getGutter();
    try {
      Icon icon = new ImageIcon(ImageIO.read(getClass().getResource("/breakpoint.png")));
      GutterIconInfo info = gutter.addLineTrackingIcon(0, icon);
     
   
    } catch(Exception 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

    }

    public void setRowHeaderView(Component view) {
        super.setRowHeaderView(view);
        setIconRowHeaderEnabled(true);
        Gutter g = getGutter();
        Component[] components = g.getComponents();
        for (Component c : components)
            c.addMouseListener(this);
    }
View Full Code Here

    public GutterIconInfo getBreakpointAt(int line) {
        ScriptEditorPane editor = (ScriptEditorPane) getTextArea();
        try {
            int offs = editor.getLineStartOffset(line);
            Gutter g = getGutter();
            Rectangle view = editor.modelToView(offs); // null if this is on load...
            if (view != null) {
                for (GutterIconInfo i : g.getTrackingIcons(view.getLocation())) {
                    if (i.getIcon() == breakpointIcon) {
                        return i;
                    }
                }
            }
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();
      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.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

        requestFocusInWindow();
        super.configurePopupMenu(popupMenu);
    }

    @Override public void paint(Graphics g) {
        Gutter gutter = scrollPane.getGutter();
        gutter.removeAllTrackingIcons();
        IGutterListener[] gutterListeners = listeners.getListeners(IGutterListener.class);
        for (IGutterListener listener : gutterListeners) {
            for (int line = 0; line < getLineCount(); line++) {
                Icon icon = listener.getIconAtLine(line);
                if (icon != null)
                    try {
                        gutter.addLineTrackingIcon(line, icon);
                    } catch (BadLocationException e) {
                        e.printStackTrace();
                    }
            }
        }
        if (currentLineTrackingInfo != null) {
            try {
                currentLineTrackingInfo = gutter.addOffsetTrackingIcon(currentLineTrackingInfo.getMarkedOffset(),
                        currentLineTrackingInfo.getIcon());
            } catch (BadLocationException e) {
                e.printStackTrace();
            }
        }
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.