Interface Indenter

All Superinterfaces:
Proxy
All Known Implementing Classes:
Indenter.IndenterImpl

@Generated("io.github.jwharm.JavaGI") public interface Indenter extends Proxy
Auto-indentation interface.

By default, View can auto-indent as you type when View:auto-indent is enabled. The indentation simply copies the previous lines indentation.

This can be changed by implementing GtkSourceIndenter and setting the View:indenter property.

Implementors of this interface should implement both isTrigger(org.gnome.gtksourceview.View, org.gnome.gtk.TextIter, java.util.Set<org.gnome.gdk.ModifierType>, int) and indent(org.gnome.gtksourceview.View, org.gnome.gtk.TextIter).

isTrigger(org.gnome.gtksourceview.View, org.gnome.gtk.TextIter, java.util.Set<org.gnome.gdk.ModifierType>, int) is called upon key-press to determine of the key press should trigger an indentation. The default implementation of the interface checks to see if the key was Gdk.KEY_Return or Gdk.KEY_KP_Enter without ModifierType.SHIFT_MASK set.

indent(org.gnome.gtksourceview.View, org.gnome.gtk.TextIter) is called after text has been inserted into Buffer when isTrigger(org.gnome.gtksourceview.View, org.gnome.gtk.TextIter, java.util.Set<org.gnome.gdk.ModifierType>, int) returned true. The Gtk.TextIter is placed directly after the inserted character or characters.

It may be beneficial to move the insertion mark using TextBuffer.selectRange(org.gnome.gtk.TextIter, org.gnome.gtk.TextIter) depending on how the indenter changes the indentation.

All changes are encapsulated within a single user action so that the user may undo them using standard undo/redo accelerators.