/** * 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); }
/** * 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 }
/** * {@inheritDoc} */ @Override public void setComponentOrientation(ComponentOrientation o) { // Some LaFs might do fun stuff, resulting in this method being called // before a border is installed. if (getBorder() instanceof GutterBorder) { // Reuse the border to preserve its color. if (o.isLeftToRight()) { ((GutterBorder)getBorder()).setEdges(0, 0, 0, 1); } else { ((GutterBorder)getBorder()).setEdges(0, 1, 0, 0); } } super.setComponentOrientation(o); }
/** * Sets the color for the "border" line. * * @param color The new color. * @see #getBorderColor() */ public void setBorderColor(Color color) { ((GutterBorder)getBorder()).setColor(color); repaint(); }
/** * Sets the color for the "border" line. * * @param color The new color. * @see #getBorderColor() */ public void setBorderColor(Color color) { ((GutterBorder)getBorder()).setColor(color); repaint(); }
/** * Sets the color for the "border" line. * * @param color The new color. * @see #getBorderColor() */ public void setBorderColor(Color color) { ((GutterBorder)getBorder()).setColor(color); repaint(); }
/** * Returns the color of the "border" line. * * @return The color. * @see #setBorderColor(Color) */ public Color getBorderColor() { return ((GutterBorder)getBorder()).getColor(); }
/** * Returns the color of the "border" line. * * @return The color. * @see #setBorderColor(Color) */ public Color getBorderColor() { return ((GutterBorder)getBorder()).getColor(); }
/** * Returns the color of the "border" line. * * @return The color. * @see #setBorderColor(Color) */ public Color getBorderColor() { return ((GutterBorder)getBorder()).getColor(); }
/** * 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); }
/** * {@inheritDoc} */ @Override public void setComponentOrientation(ComponentOrientation o) { // Some LaFs might do fun stuff, resulting in this method being called // before a border is installed. if (getBorder() instanceof GutterBorder) { // Reuse the border to preserve its color. if (o.isLeftToRight()) { ((GutterBorder)getBorder()).setEdges(0, 0, 0, 1); } else { ((GutterBorder)getBorder()).setEdges(0, 1, 0, 0); } } super.setComponentOrientation(o); }
/** * Sets the color for the "border" line. * * @param color The new color. * @see #getBorderColor() */ public void setBorderColor(Color color) { ((GutterBorder)getBorder()).setColor(color); repaint(); }
/** * Returns the color of the "border" line. * * @return The color. * @see #setBorderColor(Color) */ public Color getBorderColor() { return ((GutterBorder)getBorder()).getColor(); }