Class MenuModel.Builder<B extends MenuModel.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Direct Known Subclasses:
DBusMenuModel.Builder
,Menu.Builder
- Enclosing class:
MenuModel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theMenuModel
object.Emitted when a change has occurred to the menu.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theMenuModel
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toMenuModel
.- Overrides:
build
in classGObject.Builder<B extends MenuModel.Builder<B>>
- Returns:
- a new instance of
MenuModel
with the properties that were set in the Builder object.
-
onItemsChanged
Emitted when a change has occurred to the menu.The only changes that can occur to a menu is that items are removed or added. Items may not change (except by being removed and added back in the same location). This signal is capable of describing both of those changes (at the same time).
The signal means that starting at the index
position
,removed
items were removed andadded
items were added in their place. Ifremoved
is zero then only items were added. Ifadded
is zero then only items were removed.As an example, if the menu contains items a, b, c, d (in that order) and the signal (2, 1, 3) occurs then the new composition of the menu will be a, b, _, _, _, d (with each _ representing some new item).
Signal handlers may query the model (particularly the added items) and expect to see the results of the modification that is being reported. The signal is emitted after the modification.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-