Class SyncDialogUtil
java.lang.Object
org.eclipse.swt.internal.SyncDialogUtil
This class is an internal use utilities class introduced during the port
from GTK3 to GTK4. This class transforms a non-blocking show dialog call
to a blocking call. See bug 567371 for more information and where this
is applied.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voiddialogResponseProc(long dialog, long response_id, long user_data) Callback function for the "response" signal in GtkDialog widgets.(package private) static void(package private) static voidInitializes the response callback and resets the responseID of the dialog to the default value.static intA blocking call that waits for the handling of the signal before returningstatic longrun(Display display, AsyncReadyCallback callback) This method implements theAsyncReadyCallbackmechanism that is used in GTK4.
-
Field Details
-
responseID
static int responseID -
dialogResponseCallback
-
dialogAsyncFinish
-
dialogAsyncValue
-
-
Constructor Details
-
SyncDialogUtil
public SyncDialogUtil()
-
-
Method Details
-
run
This method implements theAsyncReadyCallbackmechanism that is used in GTK4. Most operations within GTK4 are executed asynchronously, where the user is given the option to respond to the completion of such an operation via a callback method, in order to e.g. process the result or to apply additional cleanup tasks.
When calling this method, the asynchronous operation is initiated via the {code asyncOpen} parameter. Callers have to ensure that the callback address is used as argument for theAsyncReadyCallbackparameter. From within the callback routine, theasyncFinishfunction is called, receiving theAsyncResultof the callback as argument and returning thelongvalue of the callback function.
This method blocks until the callback method has been called. It is therefore essential that callers use the address of theCallbackas address for theAsyncReadyCallbackobject. -
run
A blocking call that waits for the handling of the signal before returning- Returns:
- the response_id from the dialog presented to the user
-
initializeResponseCallback
static void initializeResponseCallback()Initializes the response callback and resets the responseID of the dialog to the default value. This function should be called before connect the dialog to the "response" signal, as this sets up the callback. -
disposeResponseCallback
static void disposeResponseCallback() -
dialogResponseProc
static void dialogResponseProc(long dialog, long response_id, long user_data) Callback function for the "response" signal in GtkDialog widgets. Responsibility of destroying the dialog is the owner of the dialog handle. Note: Native dialogs are platform dialogs that don't use GtkDialog or GtkWindow.
-