Class Inscription.Builder<B extends Inscription.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
,Accessible.Builder<B>
- Enclosing class:
Inscription
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theInscription
object.setAttributes
(AttrList attributes) A list of style attributes to apply to the text of the inscription.Utility property that sets both theGtk.Inscription:text
andGtk.Inscription:attributes
properties, mainly intended for use in GtkBuilder ui files to ease translation support and bindings.setMinChars
(int minChars) The number of characters that should fit into the inscription at minimum.setMinLines
(int minLines) The number of lines that should fit into the inscription at minimum.setNatChars
(int natChars) The number of characters that should ideally fit into the inscription.setNatLines
(int natLines) The number of lines that should ideally fit into the inscription.The displayed text.setTextOverflow
(InscriptionOverflow textOverflow) The overflow method to use for the text.setWrapMode
(WrapMode wrapMode) Controls how the line wrapping is done.setXalign
(float xalign) The horizontal alignment of the text inside the allocated size.setYalign
(float yalign) The vertical alignment of the text inside the allocated size.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
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theInscription
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 toInscription
.- Overrides:
build
in classWidget.Builder<B extends Inscription.Builder<B>>
- Returns:
- a new instance of
Inscription
with the properties that were set in the Builder object.
-
setAttributes
-
setMarkup
Utility property that sets both theGtk.Inscription:text
andGtk.Inscription:attributes
properties, mainly intended for use in GtkBuilder ui files to ease translation support and bindings.This function uses
Pango.parseMarkup(java.lang.String, int, int, io.github.jwharm.javagi.base.Out<org.gnome.pango.AttrList>, io.github.jwharm.javagi.base.Out<java.lang.String>, io.github.jwharm.javagi.base.Out<java.lang.Integer>)
to parse the markup into text and attributes. The markup must be valid. If you cannot ensure that, consider usingPango.parseMarkup(java.lang.String, int, int, io.github.jwharm.javagi.base.Out<org.gnome.pango.AttrList>, io.github.jwharm.javagi.base.Out<java.lang.String>, io.github.jwharm.javagi.base.Out<java.lang.Integer>)
and setting the two properties yourself.- Parameters:
markup
- the value for themarkup
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMinChars
The number of characters that should fit into the inscription at minimum.This influences the requested width, not the width actually given to the widget, which might turn out to be larger.
Note that this is an approximate character width, so some characters might be wider and some might be thinner, so do not expect the number of characters to exactly match.
If you set this property to 0, the inscription will not request any width at all and its width will be determined entirely by its surroundings.
- Parameters:
minChars
- the value for themin-chars
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setMinLines
The number of lines that should fit into the inscription at minimum.This influences the requested height, not the height actually given to the widget, which might turn out to be larger.
Note that this is an approximate line height, so if the text uses things like fancy Unicode or attribute that influence the height, the text might not fit.
If you set this property to 0, the inscription will not request any height at all and its height will be determined entirely by its surroundings.
- Parameters:
minLines
- the value for themin-lines
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setNatChars
The number of characters that should ideally fit into the inscription.This influences the requested width, not the width actually given to the widget. The widget might turn out larger as well as smaller.
If this property is set to a value smaller than
Gtk.Inscription:min-chars
, that value will be used. In particular, for the default value of 0, this will always be the case.- Parameters:
natChars
- the value for thenat-chars
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setNatLines
The number of lines that should ideally fit into the inscription.This influences the requested height, not the height actually given to the widget. The widget might turn out larger as well as smaller.
If this property is set to a value smaller than
Gtk.Inscription:min-lines
, that value will be used. In particular, for the default value of 0, this will always be the case.- Parameters:
natLines
- the value for thenat-lines
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setText
-
setTextOverflow
The overflow method to use for the text.- Parameters:
textOverflow
- the value for thetext-overflow
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setWrapMode
Controls how the line wrapping is done.Note that unlike
GtkLabel
, the default here isWrapMode.WORD_CHAR
.- Parameters:
wrapMode
- the value for thewrap-mode
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setXalign
The horizontal alignment of the text inside the allocated size.Compare this to
Gtk.Widget:halign
, which determines how the inscription's size allocation is positioned in the available space.- Parameters:
xalign
- the value for thexalign
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setYalign
The vertical alignment of the text inside the allocated size.Compare this to
Gtk.Widget:valign
, which determines how the inscription's size allocation is positioned in the available space.- Parameters:
yalign
- the value for theyalign
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-