Class TextView.Builder<B extends TextView.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
,Scrollable.Builder<B>
- Direct Known Subclasses:
View.Builder
- Enclosing class:
TextView
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theTextView
object.onBackspace
(TextView.BackspaceCallback handler) Gets emitted when the user asks for it.Gets emitted to copy the selection to the clipboard.Gets emitted to cut the selection to the clipboard.Gets emitted when the user initiates a text deletion.Emitted when the selection needs to be extended atlocation
.Gets emitted when the user initiates the insertion of a fixed string at the cursor.Gets emitted to present the Emoji chooser for thetextView
.onMoveCursor
(TextView.MoveCursorCallback handler) Gets emitted when the user initiates a cursor movement.Gets emitted to move the viewport.Gets emitted to paste the contents of the clipboard into the text view.Emitted when preedit text of the active IM changes.onSelectAll
(TextView.SelectAllCallback handler) Gets emitted to select or unselect the complete contents of the text view.onSetAnchor
(TextView.SetAnchorCallback handler) Gets emitted when the user initiates settings the "anchor" mark.Gets emitted to toggle thecursor-visible
property.Gets emitted to toggle the overwrite mode of the text view.setAcceptsTab
(boolean acceptsTab) Whether Tab will result in a tab character being entered.setBottomMargin
(int bottomMargin) The bottom margin for text in the text view.setBuffer
(TextBuffer buffer) The buffer which is displayed.setCursorVisible
(boolean cursorVisible) If the insertion cursor is shown.setEditable
(boolean editable) Whether the text can be modified by the user.setExtraMenu
(MenuModel extraMenu) A menu model whose contents will be appended to the context menu.setImModule
(String imModule) Which IM (input method) module should be used for this text_view.setIndent
(int indent) Amount to indent the paragraph, in pixels.setInputHints
(Set<InputHints> inputHints) Additional hints (beyondGtk.TextView:input-purpose
) that allow input methods to fine-tune their behaviour.setInputHints
(InputHints... inputHints) Additional hints (beyondGtk.TextView:input-purpose
) that allow input methods to fine-tune their behaviour.setInputPurpose
(InputPurpose inputPurpose) The purpose of this text field.setJustification
(Justification justification) Left, right, or center justification.setLeftMargin
(int leftMargin) The default left margin for text in the text view.setMonospace
(boolean monospace) Whether text should be displayed in a monospace font.setOverwrite
(boolean overwrite) Whether entered text overwrites existing contents.setPixelsAboveLines
(int pixelsAboveLines) Pixels of blank space above paragraphs.setPixelsBelowLines
(int pixelsBelowLines) Pixels of blank space below paragraphs.setPixelsInsideWrap
(int pixelsInsideWrap) Pixels of blank space between wrapped lines in a paragraph.setRightMargin
(int rightMargin) The default right margin for text in the text view.Custom tabs for this text.setTopMargin
(int topMargin) The top margin for text in the text view.setWrapMode
(WrapMode wrapMode) Whether to wrap lines never, at word boundaries, or at character boundaries.Methods inherited from class org.gnome.gtk.Widget.Builder
onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, setCanFocus, setCanTarget, setCssClasses, setCssName, setCursor, setFocusable, setFocusOnClick, setHalign, setHasTooltip, setHeightRequest, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequest
Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRole
Methods inherited from interface io.github.jwharm.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
Methods inherited from interface org.gnome.gtk.Scrollable.Builder
setHadjustment, setHscrollPolicy, setVadjustment, setVscrollPolicy
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theTextView
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toTextView
.- Overrides:
build
in classWidget.Builder<B extends TextView.Builder<B>>
- Returns:
- a new instance of
TextView
with the properties that were set in the Builder object.
-
setAcceptsTab
Whether Tab will result in a tab character being entered.- Parameters:
acceptsTab
- the value for theaccepts-tab
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setBottomMargin
The bottom margin for text in the text view.Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
Don't confuse this property with
Gtk.Widget:margin-bottom
.- Parameters:
bottomMargin
- the value for thebottom-margin
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setBuffer
The buffer which is displayed.- Parameters:
buffer
- the value for thebuffer
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setCursorVisible
If the insertion cursor is shown.- Parameters:
cursorVisible
- the value for thecursor-visible
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEditable
Whether the text can be modified by the user.- Parameters:
editable
- the value for theeditable
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setExtraMenu
-
setImModule
Which IM (input method) module should be used for this text_view.See
IMMulticontext
.Setting this to a non-
null
value overrides the system-wide IM module setting. See the GtkSettingsGtk.Settings:gtk-im-module
property.- Parameters:
imModule
- the value for theim-module
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setIndent
Amount to indent the paragraph, in pixels.A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.
- Parameters:
indent
- the value for theindent
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setInputHints
Additional hints (beyondGtk.TextView:input-purpose
) that allow input methods to fine-tune their behaviour.- Parameters:
inputHints
- the value for theinput-hints
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setInputPurpose
The purpose of this text field.This property can be used by on-screen keyboards and other input methods to adjust their behaviour.
- Parameters:
inputPurpose
- the value for theinput-purpose
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setJustification
Left, right, or center justification.- Parameters:
justification
- the value for thejustification
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setLeftMargin
The default left margin for text in the text view.Tags in the buffer may override the default.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
- Parameters:
leftMargin
- the value for theleft-margin
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMonospace
Whether text should be displayed in a monospace font.If
true
, set the .monospace style class on the text view to indicate that a monospace font is desired.- Parameters:
monospace
- the value for themonospace
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setOverwrite
Whether entered text overwrites existing contents.- Parameters:
overwrite
- the value for theoverwrite
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setPixelsAboveLines
Pixels of blank space above paragraphs.- Parameters:
pixelsAboveLines
- the value for thepixels-above-lines
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setPixelsBelowLines
Pixels of blank space below paragraphs.- Parameters:
pixelsBelowLines
- the value for thepixels-below-lines
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setPixelsInsideWrap
Pixels of blank space between wrapped lines in a paragraph.- Parameters:
pixelsInsideWrap
- the value for thepixels-inside-wrap
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setRightMargin
The default right margin for text in the text view.Tags in the buffer may override the default.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
- Parameters:
rightMargin
- the value for theright-margin
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTabs
-
setTopMargin
The top margin for text in the text view.Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
Don't confuse this property with
Gtk.Widget:margin-top
.- Parameters:
topMargin
- the value for thetop-margin
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setWrapMode
-
setInputHints
Additional hints (beyondGtk.TextView:input-purpose
) that allow input methods to fine-tune their behaviour.- Parameters:
inputHints
- the value for theinput-hints
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onBackspace
Gets emitted when the user asks for it.The ::backspace signal is a keybinding signal.
The default bindings for this signal are
Backspace
andShift
+Backspace
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onCopyClipboard
Gets emitted to copy the selection to the clipboard.The ::copy-clipboard signal is a keybinding signal.
The default bindings for this signal are
Ctrl
+c
andCtrl
+Insert
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onCutClipboard
Gets emitted to cut the selection to the clipboard.The ::cut-clipboard signal is a keybinding signal.
The default bindings for this signal are
Ctrl
+x
andShift
+Delete
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onDeleteFromCursor
Gets emitted when the user initiates a text deletion.The ::delete-from-cursor signal is a keybinding signal.
If the
type
isDeleteType.CHARS
, GTK deletes the selection if there is one, otherwise it deletes the requested number of characters.The default bindings for this signal are
Delete
for deleting a character,Ctrl
+Delete
for deleting a word andCtrl
+Backspace
for deleting a word backwards.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onExtendSelection
Emitted when the selection needs to be extended atlocation
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onInsertAtCursor
Gets emitted when the user initiates the insertion of a fixed string at the cursor.The ::insert-at-cursor signal is a keybinding signal.
This signal has no default bindings.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onInsertEmoji
Gets emitted to present the Emoji chooser for thetextView
.The ::insert-emoji signal is a keybinding signal.
The default bindings for this signal are
Ctrl
+.
andCtrl
+;
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onMoveCursor
Gets emitted when the user initiates a cursor movement.The ::move-cursor signal is a keybinding signal. If the cursor is not visible in
textView
, this signal causes the viewport to be moved instead.Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.
The default bindings for this signal come in two variants, the variant with the
Shift
modifier extends the selection, the variant without it does not. There are too many key combinations to list them all here.←
,→
,↑
,↓
move by individual characters/linesCtrl
+←
, etc. move by words/paragraphsHome
andEnd
move to the ends of the bufferPgUp
andPgDn
move vertically by pagesCtrl
+PgUp
andCtrl
+PgDn
move horizontally by pages
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onMoveViewport
Gets emitted to move the viewport.The ::move-viewport signal is a keybinding signal, which can be bound to key combinations to allow the user to move the viewport, i.e. change what part of the text view is visible in a containing scrolled window.
There are no default bindings for this signal.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onPasteClipboard
Gets emitted to paste the contents of the clipboard into the text view.The ::paste-clipboard signal is a keybinding signal.
The default bindings for this signal are
Ctrl
+v
andShift
+Insert
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onPreeditChanged
Emitted when preedit text of the active IM changes.If an input method is used, the typed text will not immediately be committed to the buffer. So if you are interested in the text, connect to this signal.
This signal is only emitted if the text at the given position is actually editable.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSelectAll
Gets emitted to select or unselect the complete contents of the text view.The ::select-all signal is a keybinding signal.
The default bindings for this signal are
Ctrl
+a
andCtrl
+/
for selecting andShift
+Ctrl
+a
andCtrl
+\\
for unselecting.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSetAnchor
Gets emitted when the user initiates settings the "anchor" mark.The ::set-anchor signal is a keybinding signal which gets emitted when the user initiates setting the "anchor" mark. The "anchor" mark gets placed at the same position as the "insert" mark.
This signal has no default bindings.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onToggleCursorVisible
Gets emitted to toggle thecursor-visible
property.The ::toggle-cursor-visible signal is a keybinding signal.
The default binding for this signal is
F7
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onToggleOverwrite
Gets emitted to toggle the overwrite mode of the text view.The ::toggle-overwrite signal is a keybinding signal.
The default binding for this signal is
Insert
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-