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
SearchContext
s.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
SearchSettings.Builder<B extends SearchSettings.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
ConstructorDescriptionCreates a new search settings object.SearchSettings
(MemorySegment address) Create a SearchSettings proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SearchSettings
asParent()
Returns this instance as if it were its parent type.static SearchSettings.Builder
<? extends SearchSettings.Builder> builder()
ASearchSettings.Builder
object constructs aSearchSettings
with the specified properties.boolean
boolean
static MemoryLayout
The memory layout of the native struct.boolean
Gets the text to search.static Type
getType()
Get the GType of the SearchSettings classboolean
boolean
void
setAtWordBoundaries
(boolean atWordBoundaries) Change whether the search is done at word boundaries.void
setCaseSensitive
(boolean caseSensitive) Enables or disables the case sensitivity for the search.void
setRegexEnabled
(boolean regexEnabled) Enables or disables whether to search by regular expressions.void
setSearchText
(@Nullable String searchText) Sets the text to search.void
setVisibleOnly
(boolean visibleOnly) Enables or disables whether to exclude invisible text from the search.void
setWrapAround
(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, 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
-
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 search settings object.
-
-
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. -
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
null
if 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
atWordBoundaries
istrue
, 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-text
property contains the pattern of the regular expression.SearchContext
usesGRegex
when 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
searchText
isnull
or is empty, the search will be disabled. A copy ofsearchText
will be made, so you can safely freesearchText
after 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, ornull
to 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.
-
setWrapAround
public void setWrapAround(boolean wrapAround) Enables or disables the wrap around search.If
wrapAround
istrue
, 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.Builder
object constructs aSearchSettings
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withSearchSettings.Builder.build()
.
-