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
Modifier and TypeClassDescriptionstatic class
TextTag.Builder<B extends TextTag.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionTextTag()
CallsTextTag(java.lang.String)
with name =null
Creates aGtkTextTag
.TextTag
(MemorySegment address) Create a TextTag proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected TextTag
asParent()
Returns this instance as if it were its parent type.static TextTag.Builder
<? extends TextTag.Builder> builder()
ATextTag.Builder
object constructs aTextTag
with the specified properties.void
changed
(boolean sizeChanged) Emits theGtk.TextTagTable::tag-changed
signal on theGtkTextTagTable
where the tag is included.static MemoryLayout
The memory layout of the native struct.int
Get the tag priority.static Type
getType()
Get the GType of the TextTag classvoid
setPriority
(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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.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()CallsTextTag(java.lang.String)
with name =null
-
-
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 Javasuper
keyword, 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-changed
signal on theGtkTextTagTable
where the tag is included.The signal is already emitted when setting a
GtkTextTag
property. This function is useful for aGtkTextTag
subclass.- Parameters:
sizeChanged
- whether the change affects theGtkTextView
layout
-
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.Builder
object constructs aTextTag
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withTextTag.Builder.build()
.
-