Class TextView.Builder<B extends TextView.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
Accessible.Builder<B>,Scrollable.Builder<B>,BuilderInterface
- Direct Known Subclasses:
View.Builder
- Enclosing class:
TextView
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theTextViewobject.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-visibleproperty.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, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setReceivesDefault, setSensitive, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setWidthRequestMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible.Builder
setAccessibleRoleMethods inherited from interface org.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArenaMethods inherited from interface org.gnome.gtk.Scrollable.Builder
setHadjustment, setHscrollPolicy, setVadjustment, setVscrollPolicy
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theTextViewobject. 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:
buildin classWidget.Builder<B extends TextView.Builder<B>>- Returns:
- a new instance of
TextViewwith 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-tabproperty- Returns:
- the
Builderinstance 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-marginproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setBuffer
The buffer which is displayed.- Parameters:
buffer- the value for thebufferproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setCursorVisible
If the insertion cursor is shown.- Parameters:
cursorVisible- the value for thecursor-visibleproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setEditable
Whether the text can be modified by the user.- Parameters:
editable- the value for theeditableproperty- Returns:
- the
Builderinstance 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-
nullvalue overrides the system-wide IM module setting. See the GtkSettingsGtk.Settings:gtk-im-moduleproperty.- Parameters:
imModule- the value for theim-moduleproperty- Returns:
- the
Builderinstance 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 theindentproperty- Returns:
- the
Builderinstance 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-hintsproperty- Returns:
- the
Builderinstance 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-purposeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setJustification
Left, right, or center justification.- Parameters:
justification- the value for thejustificationproperty- Returns:
- the
Builderinstance 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-marginproperty- Returns:
- the
Builderinstance 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 themonospaceproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setOverwrite
Whether entered text overwrites existing contents.- Parameters:
overwrite- the value for theoverwriteproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setPixelsAboveLines
Pixels of blank space above paragraphs.- Parameters:
pixelsAboveLines- the value for thepixels-above-linesproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setPixelsBelowLines
Pixels of blank space below paragraphs.- Parameters:
pixelsBelowLines- the value for thepixels-below-linesproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setPixelsInsideWrap
Pixels of blank space between wrapped lines in a paragraph.- Parameters:
pixelsInsideWrap- the value for thepixels-inside-wrapproperty- Returns:
- the
Builderinstance 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-marginproperty- Returns:
- the
Builderinstance 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-marginproperty- Returns:
- the
Builderinstance 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-hintsproperty- Returns:
- the
Builderinstance 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
BackspaceandShift+Backspace.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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+candCtrl+Insert.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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+xandShift+Delete.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
typeisDeleteType.CHARS, GTK deletes the selection if there is one, otherwise it deletes the requested number of characters.The default bindings for this signal are
Deletefor deleting a character,Ctrl+Deletefor deleting a word andCtrl+Backspacefor deleting a word backwards.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
Builderinstance 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
Builderinstance 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
Builderinstance 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
Shiftmodifier 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/paragraphsHomeandEndmove to the ends of the bufferPgUpandPgDnmove vertically by pagesCtrl+PgUpandCtrl+PgDnmove horizontally by pages
- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
Builderinstance 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+vandShift+Insert.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
Builderinstance 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+aandCtrl+/for selecting andShift+Ctrl+aandCtrl+\\for unselecting.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
Builderinstance is returned, to allow method chaining - See Also:
-
onToggleCursorVisible
Gets emitted to toggle thecursor-visibleproperty.The ::toggle-cursor-visible signal is a keybinding signal.
The default binding for this signal is
F7.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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
Builderinstance is returned, to allow method chaining - See Also:
-