Package ch.bailu.gtk.gio
Class SimpleAction
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.SimpleAction
- All Implemented Interfaces:
PointerInterface
A #GSimpleAction is the obvious simple implementation of the #GAction
interface. This is the easiest way to create an action for purposes of
adding it to a #GSimpleActionGroup.
See also #GtkAction.
interface. This is the easiest way to create an action for purposes of
adding it to a #GSimpleActionGroup.
See also #GtkAction.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionSimpleAction
(PointerContainer pointer) SimpleAction
(Str name, VariantType parameter_type) Creates a new action.SimpleAction
(String name, VariantType parameter_type) Creates a new action. -
Method Summary
Modifier and TypeMethodDescriptionasAction()
Implements interfaceAction
.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static SimpleAction
newStatefulSimpleAction
(Str name, VariantType parameter_type, Variant state) Creates a new stateful action.static SimpleAction
newStatefulSimpleAction
(String name, VariantType parameter_type, Variant state) Creates a new stateful action.onActivate
(SimpleAction.OnActivate signal) Connect to signal "activate".Connect to signal "change-state".void
setEnabled
(boolean enabled) Sets the action as enabled or not.void
Sets the state of the action.void
setStateHint
(Variant state_hint) Sets the state hint for the action.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_ACTIVATE
- See Also:
-
SIGNAL_ON_CHANGE_STATE
- See Also:
-
-
Constructor Details
-
SimpleAction
-
SimpleAction
Creates a new action.
The created action is stateless. See g_simple_action_new_stateful() to create
an action that has state.- Parameters:
name
- the name of the actionparameter_type
- the type of parameter that will be passed to handlers for the #GSimpleAction::activate signal, or %NULL for no parameter
-
SimpleAction
Creates a new action.
The created action is stateless. See g_simple_action_new_stateful() to create
an action that has state.- Parameters:
name
- the name of the actionparameter_type
- the type of parameter that will be passed to handlers for the #GSimpleAction::activate signal, or %NULL for no parameter
-
-
Method Details
-
getClassHandler
-
newStatefulSimpleAction
public static SimpleAction newStatefulSimpleAction(@Nonnull Str name, @Nullable VariantType parameter_type, @Nonnull Variant state) Creates a new stateful action.
All future state values must have the same #GVariantType as the initial
@state.
If the @state #GVariant is floating, it is consumed.- Parameters:
name
- the name of the actionparameter_type
- the type of the parameter that will be passed to handlers for the #GSimpleAction::activate signal, or %NULL for no parameterstate
- the initial state of the action- Returns:
- a new #GSimpleAction
-
newStatefulSimpleAction
public static SimpleAction newStatefulSimpleAction(String name, @Nullable VariantType parameter_type, @Nonnull Variant state) Creates a new stateful action.
All future state values must have the same #GVariantType as the initial
@state.
If the @state #GVariant is floating, it is consumed.- Parameters:
name
- the name of the actionparameter_type
- the type of the parameter that will be passed to handlers for the #GSimpleAction::activate signal, or %NULL for no parameterstate
- the initial state of the action- Returns:
- a new #GSimpleAction
-
setEnabled
public void setEnabled(boolean enabled) Sets the action as enabled or not.
An action must be enabled in order to be activated or in order to
have its state changed from outside callers.
This should only be called by the implementor of the action. Users
of the action should not attempt to modify its enabled flag.- Parameters:
enabled
- whether the action is enabled
-
setState
Sets the state of the action.
This directly updates the 'state' property to the given value.
This should only be called by the implementor of the action. Users
of the action should not attempt to directly modify the 'state'
property. Instead, they should call g_action_change_state() to
request the change.
If the @value GVariant is floating, it is consumed.- Parameters:
value
- the new #GVariant for the state
-
setStateHint
Sets the state hint for the action.
See g_action_get_state_hint() for more information about
action state hints.- Parameters:
state_hint
- a #GVariant representing the state hint
-
onActivate
Connect to signal "activate".
SeeSimpleAction.OnActivate.onActivate(ch.bailu.gtk.glib.Variant)
for signal description.
FieldSIGNAL_ON_ACTIVATE
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onChangeState
Connect to signal "change-state".
SeeSimpleAction.OnChangeState.onChangeState(ch.bailu.gtk.glib.Variant)
for signal description.
FieldSIGNAL_ON_CHANGE_STATE
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asAction
Implements interfaceAction
. Call this to get access to interface functions.- Returns:
Action
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-