Package io.github.jwharm.javagi.gtk.util
Class BuilderJavaScope
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.gtk.BuilderCScope
io.github.jwharm.javagi.gtk.util.BuilderJavaScope
- All Implemented Interfaces:
Proxy
,BuilderScope
The
BuilderJavaScope
class can be used with a GtkBuilder
to
refer to Java instance methods from a ui file.
When a ui file contains, for example, the following element:
<signal name="clicked" handler="okButtonClicked"/>
the Java instance method okButtonClicked()
will be called on
the widget that is being built with the GtkBuilder
.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gnome.gtk.BuilderCScope
BuilderCScope.Builder<B extends BuilderCScope.Builder<B>>, BuilderCScope.BuilderCScopeClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.BuilderScope
BuilderScope.BuilderScopeImpl, BuilderScope.BuilderScopeInterface
-
Constructor Summary
ConstructorDescriptionBuilderJavaScope
(MemorySegment address) Memory address constructor for instantiating a Java proxy object -
Method Summary
Modifier and TypeMethodDescriptioncreateClosure
(GtkBuilder builder, String function, Set<BuilderClosureFlags> flags, GObject object) Called by a GtkBuilder to create aClosure
from the name that was specified in an attribute of a UI file.static Type
getType()
Return the GType ofBuilderJavaScope
getTypeFromFunction
(GtkBuilder builder, String functionName) getTypeFromName
(GtkBuilder builder, String typeName) static BuilderJavaScope
Instantiates a newBuilderScope
Methods inherited from class org.gnome.gtk.BuilderCScope
addCallbackSymbol, addCallbackSymbols, asParent, builder, getMemoryLayout, lookupCallbackSymbol
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
-
BuilderJavaScope
Memory address constructor for instantiating a Java proxy object- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
newInstance
Instantiates a newBuilderScope
-
createClosure
public Closure createClosure(GtkBuilder builder, String function, Set<BuilderClosureFlags> flags, GObject object) throws GErrorException Called by a GtkBuilder to create aClosure
from the name that was specified in an attribute of a UI file. Thefunction
should refer to a method in the Java class (aBuildable
instance). If that fails, as a fallback mechanism theBuilderScope.createClosure(GtkBuilder, String, Set, GObject)
is called and the result of that function is returned.- Specified by:
createClosure
in interfaceBuilderScope
- Parameters:
builder
- the GtkBuilder instancefunction
- the function name for which aClosure
will be returnedflags
- options for creating the closureobject
- unused- Returns:
- a new
JavaClosure
instance for the requestedfunction
- Throws:
GErrorException
- when an error occurs
-
getTypeFromFunction
- Specified by:
getTypeFromFunction
in interfaceBuilderScope
- Parameters:
builder
- the GtkBuilder instancefunctionName
- the name of the function that will return a GType- Returns:
- the GType returned by
functionName
-
getTypeFromName
- Specified by:
getTypeFromName
in interfaceBuilderScope
- Parameters:
builder
- the GtkBuilder instancetypeName
- the name of the GType- Returns:
- the requested GType
-