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
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfaceNested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Field Summary
FieldsFields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleAction(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 ClassHandlerstatic intstatic longstatic TypeSystem.TypeSizestatic longstatic TypeSystem.TypeSizestatic SimpleActionnewStatefulSimpleAction(Str name, VariantType parameter_type, Variant state) Creates a new stateful action.static SimpleActionnewStatefulSimpleAction(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".voidsetEnabled(boolean enabled) Sets the action as enabled or not.voidSets the state of the action.voidsetStateHint(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, weakUnrefMethods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksMethods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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_ACTIVATEcontains 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_STATEcontains 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()
-