Class DropTargetAsync.Builder<B extends DropTargetAsync.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
DropTargetAsync
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theDropTargetAsyncobject.onAccept(DropTargetAsync.AcceptCallback handler) Emitted on the drop site when a drop operation is about to begin.Emitted on the drop site when the pointer enters the widget.Emitted on the drop site when the pointer leaves the widget.Emitted while the pointer is moving over the drop target.onDrop(DropTargetAsync.DropCallback handler) Emitted on the drop site when the user drops the data onto the widget.setActions(Set<DragAction> actions) TheGdkDragActionsthat this drop target supports.setActions(DragAction... actions) TheGdkDragActionsthat this drop target supports.setFormats(ContentFormats formats) TheGdkContentFormatsthat determines the supported data formats.Methods 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 theDropTargetAsyncobject. 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 toDropTargetAsync.- Overrides:
buildin classEventController.Builder<B extends DropTargetAsync.Builder<B>>- Returns:
- a new instance of
DropTargetAsyncwith the properties that were set in the Builder object.
-
setActions
TheGdkDragActionsthat this drop target supports.- Parameters:
actions- the value for theactionsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setFormats
TheGdkContentFormatsthat determines the supported data formats.- Parameters:
formats- the value for theformatsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setActions
TheGdkDragActionsthat this drop target supports.- Parameters:
actions- the value for theactionsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
onAccept
Emitted on the drop site when a drop operation is about to begin.If the drop is not accepted,
falsewill be returned and the drop target will ignore the drop. Iftrueis returned, the drop is accepted for now but may be rejected later via a call toDropTargetAsync.rejectDrop(org.gnome.gdk.Drop)or ultimately by returningfalsefrom aGtk.DropTargetAsync::drophandler.The default handler for this signal decides whether to accept the drop based on the formats provided by the
drop.If the decision whether the drop will be accepted or rejected needs further processing, such as inspecting the data, this function should return
trueand proceed as isdropwas accepted and if it decides to reject the drop later, it should callDropTargetAsync.rejectDrop(org.gnome.gdk.Drop).- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDragEnter
Emitted on the drop site when the pointer enters the widget.It can be used to set up custom highlighting.
- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDragLeave
Emitted on the drop site when the pointer leaves the widget.Its main purpose it to undo things done in
GtkDropTargetAsync::drag-enter.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDragMotion
Emitted while the pointer is moving over the drop target.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onDrop
Emitted on the drop site when the user drops the data onto the widget.The signal handler must determine whether the pointer position is in a drop zone or not. If it is not in a drop zone, it returns
falseand no further processing is necessary.Otherwise, the handler returns
true. In this case, this handler will accept the drop. The handler must ensure thatDrop.finish(java.util.Set<org.gnome.gdk.DragAction>)is called to let the source know that the drop is done. The call toDrop.finish(java.util.Set<org.gnome.gdk.DragAction>)must only be done when all data has been received.To receive the data, use one of the read functions provided by
Dropsuch asDrop.readAsync(java.lang.String[], int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)orDrop.readValueAsync(org.gnome.glib.Type, int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback).- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-