Class SnippetChunk
- All Implemented Interfaces:
Proxy
The GtkSourceSnippetChunk represents a single chunk of text that
may or may not be an edit point within the snippet. Chunks that are
an edit point (also called a tab stop) have the
SnippetChunk:focus-position property set.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSnippetChunk.Builder<B extends SnippetChunk.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SnippetChunk.SnippetChunk(MemorySegment address) Create a SnippetChunk proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SnippetChunkasParent()Returns this instance as if it were its parent type.static SnippetChunk.Builder<? extends SnippetChunk.Builder> builder()ASnippetChunk.Builderobject constructs aSnippetChunkwith the specified properties.copy()Copies the source snippet.Gets the context for the snippet insertion.intGets theSnippetChunk:focus-position.@Nullable StringgetSpec()Gets the specification for the chunk.getText()Gets theSnippetChunk:textproperty.booleanGets theSnippetChunk:text-setproperty.static @Nullable TypegetType()Get the GType of the SnippetChunk classvoidsetContext(SnippetContext context) voidsetFocusPosition(int focusPosition) Sets theSnippetChunk:focus-positionproperty.voidSets the specification for the chunk.voidSets the text for the snippet chunk.voidsetTextSet(boolean textSet) Sets theSnippetChunk:text-setproperty.voidsetTooltipText(String tooltipText) Methods inherited from class org.gnome.gobject.InitiallyUnowned
getMemoryLayoutMethods 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
-
SnippetChunk
Create a SnippetChunk proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
SnippetChunk
public SnippetChunk()Creates a new SnippetChunk.
-
-
Method Details
-
getType
-
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.- Overrides:
asParentin classInitiallyUnowned
-
copy
-
getContext
Gets the context for the snippet insertion.- Returns:
- A
GtkSourceSnippetContext
-
getFocusPosition
public int getFocusPosition()Gets theSnippetChunk:focus-position.The focus-position is used to determine how many tabs it takes for the snippet to advanced to this chunk.
A focus-position of zero will be the last focus position of the snippet and snippet editing ends when it has been reached.
A focus-position of -1 means the chunk cannot be focused by the user.
- Returns:
- the focus-position
-
getSpec
Gets the specification for the chunk.The specification is evaluated for variables when other chunks are edited within the snippet context. If the user has changed the text, the
SnippetChunk:textandSnippetChunk:text-setproperties are updated.- Returns:
- the specification, if any
-
getText
Gets theSnippetChunk:textproperty.The text property is updated when the user edits the text of the chunk. If it has not been edited, the
SnippetChunk:specproperty is returned.- Returns:
- the text of the chunk
-
getTextSet
public boolean getTextSet()Gets theSnippetChunk:text-setproperty.This is typically set when the user has edited a snippet chunk.
-
getTooltipText
-
setContext
-
setFocusPosition
public void setFocusPosition(int focusPosition) Sets theSnippetChunk:focus-positionproperty.The focus-position is used to determine how many tabs it takes for the snippet to advanced to this chunk.
A focus-position of zero will be the last focus position of the snippet and snippet editing ends when it has been reached.
A focus-position of -1 means the chunk cannot be focused by the user.
- Parameters:
focusPosition- the focus-position
-
setSpec
Sets the specification for the chunk.The specification is evaluated for variables when other chunks are edited within the snippet context. If the user has changed the text, the
SnippetChunk:text andSnippetChunk:text-setproperties are updated.- Parameters:
spec- the new specification for the chunk
-
setText
Sets the text for the snippet chunk.This is usually used by the snippet engine to update the text, but may be useful when creating custom snippets to avoid expansion of any specification.
- Parameters:
text- the text of the property
-
setTextSet
public void setTextSet(boolean textSet) Sets theSnippetChunk:text-setproperty.This is typically set when the user has edited a snippet chunk by the snippet engine.
- Parameters:
textSet- the property value
-
setTooltipText
-
builder
ASnippetChunk.Builderobject constructs aSnippetChunkwith the specified properties. Use the variousset...()methods to set properties, and finish construction withSnippetChunk.Builder.build().- Returns:
- the builder object
-