mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Permit modes to enhance the text editor by adding their own typographical effects to the Painter.
This permits Python mode to draw an indentation indicator, which is common in Python editors.
This commit is contained in:
@@ -103,7 +103,7 @@ public class JEditTextArea extends JComponent
|
||||
}
|
||||
|
||||
// Initialize some misc. stuff
|
||||
painter = new TextAreaPainter(this, defaults);
|
||||
painter = createPainter(defaults);
|
||||
documentHandler = new DocumentHandler();
|
||||
eventListenerList = new EventListenerList();
|
||||
caretEvent = new MutableCaretEvent();
|
||||
@@ -176,6 +176,16 @@ public class JEditTextArea extends JComponent
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Override this to provide your own painter for this {@link JEditTextArea}.
|
||||
* @param defaults
|
||||
* @return a newly constructed {@link TextAreaPainter}.
|
||||
*/
|
||||
protected TextAreaPainter createPainter(final TextAreaDefaults defaults) {
|
||||
return new TextAreaPainter(this, defaults);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inline Input Method Support for Japanese.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user