Class DragSource.Builder<B extends DragSource.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
DragSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theDragSourceobject.onDragBegin(DragSource.DragBeginCallback handler) Emitted on the drag source when a drag is started.Emitted on the drag source when a drag has failed.onDragEnd(DragSource.DragEndCallback handler) Emitted on the drag source when a drag is finished.onPrepare(DragSource.PrepareCallback handler) Emitted when a drag is about to be initiated.setActions(Set<DragAction> actions) The actions that are supported by drag operations from the source.setActions(DragAction... actions) The actions that are supported by drag operations from the source.setContent(ContentProvider content) The data that is offered by drag operations from this source.Methods inherited from class org.gnome.gtk.GestureSingle.Builder
setButton, setExclusive, setTouchOnlyMethods inherited from class org.gnome.gtk.Gesture.Builder
onBegin, onCancel, onEnd, onSequenceStateChanged, onUpdate, setNPointsMethods inherited from class org.gnome.gtk.EventController.Builder
setName, setPropagationLimit, setPropagationPhaseMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theDragSourceobject. 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 toDragSource.- Overrides:
buildin classGestureSingle.Builder<B extends DragSource.Builder<B>>- Returns:
- a new instance of
DragSourcewith the properties that were set in the Builder object.
-
setActions
The actions that are supported by drag operations from the source.Note that you must handle the
Gtk.DragSource::drag-endsignal if the actions includeDragAction.MOVE.- Parameters:
actions- the value for theactionsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setContent
The data that is offered by drag operations from this source.- Parameters:
content- the value for thecontentproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setActions
The actions that are supported by drag operations from the source.Note that you must handle the
Gtk.DragSource::drag-endsignal if the actions includeDragAction.MOVE.- Parameters:
actions- the value for theactionsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
onDragBegin
Emitted on the drag source when a drag is started.It can be used to e.g. set a custom drag icon with
DragSource.setIcon(org.gnome.gdk.Paintable, int, int).- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDragCancel
Emitted on the drag source when a drag has failed.The signal handler may handle a failed drag operation based on the type of error. It should return
trueif the failure has been handled and the default "drag operation failed" animation should not be shown.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDragEnd
Emitted on the drag source when a drag is finished.A typical reason to connect to this signal is to undo things done in
Gtk.DragSource::prepareorGtk.DragSource::drag-beginhandlers.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onPrepare
Emitted when a drag is about to be initiated.It returns the
GdkContentProviderto use for the drag that is about to start. The default handler for this signal returns the value of theGtk.DragSource:contentproperty, so if you set up that property ahead of time, you don't need to connect to this signal.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-