Class TextTag
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
Tag
GtkTextBuffer.
You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.
Tags should be in the TextTagTable for a given
GtkTextBuffer before using them with that buffer.
TextBuffer.createTag(java.lang.String, java.lang.String, java.lang.Object...) is the best way to create tags.
See “gtk4-demo” for numerous examples.
For each property of GtkTextTag, there is a “set” property, e.g.
“font-set” corresponds to “font”. These “set” properties reflect
whether a property has been set or not.
They are maintained by GTK and you should not set them independently.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTextTag.Builder<B extends TextTag.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionTextTag()Creates a new TextTag.Creates aGtkTextTag.TextTag(MemorySegment address) Create a TextTag proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected TextTagasParent()Returns this instance as if it were its parent type.static TextTag.Builder<? extends TextTag.Builder> builder()ATextTag.Builderobject constructs aTextTagwith the specified properties.voidchanged(boolean sizeChanged) Emits theGtk.TextTagTable::tag-changedsignal on theGtkTextTagTablewhere the tag is included.static MemoryLayoutThe memory layout of the native struct.intGet the tag priority.static @Nullable TypegetType()Get the GType of the TextTag classvoidsetPriority(int priority) Sets the priority of aGtkTextTag.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TextTag
Create a TextTag proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TextTag
-
TextTag
public TextTag()Creates a new TextTag.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
changed
public void changed(boolean sizeChanged) Emits theGtk.TextTagTable::tag-changedsignal on theGtkTextTagTablewhere the tag is included.The signal is already emitted when setting a
GtkTextTagproperty. This function is useful for aGtkTextTagsubclass.- Parameters:
sizeChanged- whether the change affects theGtkTextViewlayout
-
getPriority
public int getPriority()Get the tag priority.- Returns:
- The tag’s priority.
-
setPriority
public void setPriority(int priority) Sets the priority of aGtkTextTag.Valid priorities start at 0 and go to one less than
TextTagTable.getSize(). Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag.Higher priority tags “win” if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with
TextBuffer.createTag(java.lang.String, java.lang.String, java.lang.Object...), which adds the tag to the buffer’s table automatically.- Parameters:
priority- the new priority
-
builder
ATextTag.Builderobject constructs aTextTagwith the specified properties. Use the variousset...()methods to set properties, and finish construction withTextTag.Builder.build().- Returns:
- the builder object
-