/** * Constructor. * * @param textArea The parent text area. */ public Gutter(RTextArea textArea) { listener = new TextAreaListener(); lineNumberColor = Color.gray; lineNumberFont = RTextArea.getDefaultFont(); lineNumberingStartIndex = 1; iconRowHeaderInheritsGutterBackground = false; setTextArea(textArea); setLayout(new BorderLayout()); if (this.textArea!=null) { // Enable line numbers our first time through if they give us // a text area. setLineNumbersEnabled(true); if (this.textArea instanceof RSyntaxTextArea) { RSyntaxTextArea rsta = (RSyntaxTextArea)this.textArea; setFoldIndicatorEnabled(rsta.isCodeFoldingEnabled()); } } setBorder(new GutterBorder(0, 0, 0, 1)); // Assume ltr Color bg = null; if (textArea!=null) { bg = textArea.getBackground(); // May return null if image bg } setBackground(bg!=null ? bg : Color.WHITE); }
public void install(RTextArea textArea) { if (installed) { uninstall(); } textArea.addComponentListener(this); textArea.getDocument().addDocumentListener(this); textArea.addPropertyChangeListener(this); installed = true; }
/** * Constructor. * * @param textArea The parent text area. */ public Gutter(RTextArea textArea) { listener = new TextAreaListener(); lineNumberColor = Color.gray; lineNumberFont = RTextArea.getDefaultFont(); lineNumberingStartIndex = 1; iconRowHeaderInheritsGutterBackground = false; setTextArea(textArea); setLayout(new BorderLayout()); if (this.textArea!=null) { // Enable line numbers our first time through if they give us // a text area. setLineNumbersEnabled(true); if (this.textArea instanceof RSyntaxTextArea) { RSyntaxTextArea rsta = (RSyntaxTextArea)this.textArea; setFoldIndicatorEnabled(rsta.isCodeFoldingEnabled()); } } setBorder(new GutterBorder(0, 0, 0, 1)); // Assume ltr Color bg = null; if (textArea!=null) { bg = textArea.getBackground(); // May return null if image bg } setBackground(bg!=null ? bg : Color.WHITE); }
/** * Sets the text area being displayed. This will clear any tracking * icons currently displayed. * * @param textArea The text area. */ void setTextArea(RTextArea textArea) { if (this.textArea!=null) { listener.uninstall(); } if (lineNumberList==null) { lineNumberList = new LineNumberList(textArea); } else { lineNumberList.setTextArea(textArea); } if (iconArea==null) { iconArea = new IconRowHeader(textArea); } else { iconArea.setTextArea(textArea); } if (textArea!=null) { listener.install(textArea); } this.textArea = textArea; }
/** * Sets the text area being displayed. This will clear any tracking * icons currently displayed. * * @param textArea The text area. */ void setTextArea(RTextArea textArea) { if (this.textArea!=null) { listener.uninstall(); } if (lineNumberList==null) { lineNumberList = new LineNumberList(textArea); } else { lineNumberList.setTextArea(textArea); } if (iconArea==null) { iconArea = new IconRowHeader(textArea); } else { iconArea.setTextArea(textArea); } if (textArea!=null) { listener.install(textArea); } this.textArea = textArea; }
/** * Constructor. * * @param textArea The parent text area. */ public Gutter(RTextArea textArea) { listener = new TextAreaListener(); setTextArea(textArea); setLayout(new BorderLayout()); if (this.textArea!=null) { // Enable line numbers our first time through if they give us // a text area. setLineNumbersEnabled(true); } setBorder(new GutterBorder(0, 0, 0, 1)); // Assume ltr Color bg = null; if (textArea!=null) { bg = textArea.getBackground(); // May return null if image bg } setBackground(bg!=null ? bg : Color.WHITE); }
/** * Constructor. * * @param textArea The parent text area. */ public Gutter(RTextArea textArea) { listener = new TextAreaListener(); setTextArea(textArea); setLayout(new BorderLayout()); if (this.textArea!=null) { // Enable line numbers our first time through if they give us // a text area. setLineNumbersEnabled(true); } setBorder(new GutterBorder(0, 0, 0, 1)); // Assume ltr }
public void insertUpdate(DocumentEvent e) { handleDocumentEvent(e); }
public void removeUpdate(DocumentEvent e) { handleDocumentEvent(e); }
public void insertUpdate(DocumentEvent e) { handleDocumentEvent(e); }
public void removeUpdate(DocumentEvent e) { handleDocumentEvent(e); }
@Override public void insertUpdate(DocumentEvent e) { handleDocumentEvent(e); }
public void install(RTextArea textArea) { if (installed) { uninstall(); } textArea.addComponentListener(this); textArea.getDocument().addDocumentListener(this); textArea.addPropertyChangeListener(this); if (textArea instanceof RSyntaxTextArea) { RSyntaxTextArea rsta = (RSyntaxTextArea)textArea; rsta.addActiveLineRangeListener(this); rsta.getFoldManager().addPropertyChangeListener(this); } installed = true; }
@Override public void removeUpdate(DocumentEvent e) { handleDocumentEvent(e); }
public void install(RTextArea textArea) { if (installed) { uninstall(); } textArea.addComponentListener(this); textArea.getDocument().addDocumentListener(this); textArea.addPropertyChangeListener(this); installed = true; }
@Override public void insertUpdate(DocumentEvent e) { handleDocumentEvent(e); }
public void install(RTextArea textArea) { if (installed) { uninstall(); } textArea.addComponentListener(this); textArea.getDocument().addDocumentListener(this); textArea.addPropertyChangeListener(this); if (textArea instanceof RSyntaxTextArea) { RSyntaxTextArea rsta = (RSyntaxTextArea)textArea; rsta.addActiveLineRangeListener(this); rsta.getFoldManager().addPropertyChangeListener(this); } installed = true; }
@Override public void removeUpdate(DocumentEvent e) { handleDocumentEvent(e); }