Class SearchSettings
- All Implemented Interfaces:
Proxy
Search settings.
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 GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new SearchSettings.SearchSettings(MemorySegment address) Create a SearchSettings instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SearchSettingsasParent()Return 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 class.booleanbooleanvoidsetAtWordBoundaries(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 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
SearchSettings
Create a SearchSettings instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
SearchSettings
public SearchSettings()Create a new SearchSettings.
-
-
Method Details
-
getType
Get the GType of the SearchSettings class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
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(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 also TextIter#startsWord and TextIter#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(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
-