Class SearchSettings
- All Implemented Interfaces:
Proxy
A GtkSourceSearchSettings object represents the settings of a search. The
search settings can be associated with one or several
SearchContexts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSearchSettings.Builder<B extends SearchSettings.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
ConstructorsConstructorDescriptionCreates a new SearchSettings.SearchSettings(MemorySegment address) Create a SearchSettings proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SearchSettingsasParent()Returns this instance as if it were its parent type.static SearchSettings.Builder<? extends SearchSettings.Builder> builder()ASearchSettings.Builderobject constructs aSearchSettingswith the specified properties.booleanbooleanstatic MemoryLayoutThe memory layout of the native struct.boolean@Nullable StringGets the text to search.static @Nullable TypegetType()Get the GType of the SearchSettings classbooleanbooleanvoidsetAtWordBoundaries(boolean atWordBoundaries) Change whether the search is done at word boundaries.voidsetCaseSensitive(boolean caseSensitive) Enables or disables the case sensitivity for the search.voidsetRegexEnabled(boolean regexEnabled) Enables or disables whether to search by regular expressions.voidsetSearchText(@Nullable String searchText) Sets the text to search.voidsetVisibleOnly(boolean visibleOnly) Enables or disables whether to exclude invisible text from the search.voidsetWrapAround(boolean wrapAround) Enables or disables the wrap around search.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
-
SearchSettings
Create a SearchSettings proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
SearchSettings
public SearchSettings()Creates a new SearchSettings.
-
-
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. -
getAtWordBoundaries
public boolean getAtWordBoundaries() -
getCaseSensitive
public boolean getCaseSensitive() -
getRegexEnabled
public boolean getRegexEnabled() -
getSearchText
Gets the text to search.The return value must not be freed.
You may be interested to call
GtkSource.utilsEscapeSearchText(java.lang.String)after this function.- Returns:
- the text to search, or
nullif the search is disabled.
-
getVisibleOnly
public boolean getVisibleOnly() -
getWrapAround
public boolean getWrapAround() -
setAtWordBoundaries
public void setAtWordBoundaries(boolean atWordBoundaries) Change whether the search is done at word boundaries.If
atWordBoundariesistrue, a search match must start and end a word. The match can span multiple words. See alsoTextIter.startsWord()andTextIter.endsWord().- Parameters:
atWordBoundaries- the setting.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Enables or disables the case sensitivity for the search.- Parameters:
caseSensitive- the setting.
-
setRegexEnabled
public void setRegexEnabled(boolean regexEnabled) Enables or disables whether to search by regular expressions.If enabled, the
SearchSettings:search-textproperty contains the pattern of the regular expression.SearchContextusesGRegexwhen regex search is enabled. See the Regular expression syntax page in the GLib reference manual.- Parameters:
regexEnabled- the setting.
-
setSearchText
Sets the text to search.If
searchTextisnullor is empty, the search will be disabled. A copy ofsearchTextwill be made, so you can safely freesearchTextafter a call to this function.You may be interested to call
GtkSource.utilsUnescapeSearchText(java.lang.String)before this function.- Parameters:
searchText- the nul-terminated text to search, ornullto disable the search.
-
setVisibleOnly
public void setVisibleOnly(boolean visibleOnly) Enables or disables whether to exclude invisible text from the search.If enabled, only visible text will be searched. A search match may have invisible text interspersed.
- Parameters:
visibleOnly- the setting.- Since:
- 5.12
-
setWrapAround
public void setWrapAround(boolean wrapAround) Enables or disables the wrap around search.If
wrapAroundistrue, the forward search continues at the beginning of the buffer if no search occurrences are found. Similarly, the backward search continues to search at the end of the buffer.- Parameters:
wrapAround- the setting.
-
builder
ASearchSettings.Builderobject constructs aSearchSettingswith the specified properties. Use the variousset...()methods to set properties, and finish construction withSearchSettings.Builder.build().- Returns:
- the builder object
-