[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] [jira] Created: (UDIG-734) The IOp framework needs a 'cancel' mechanism
|
The IOp framework needs a 'cancel' mechanism
--------------------------------------------
Key: UDIG-734
URL: http://jira.codehaus.org/browse/UDIG-734
Project: uDIG
Type: Bug
Components: API libs
Versions: UDIG 1.1.M8
Environment: all
Reporter: Adrian Custer
Assigned to: David Zwiers
The IOp framework needs a way for developers to bail out of an operation. Cory suggests the following workaround, which may be the way uDig wants to do things.
>> In my IOp code, I launch a dialog for user input. If the user closes
>> that dialog or pushes a "Cancel" button, I'd like to make the IOp
>> cleanup and close. However, since this is being done inside inner
>> classes (eventListeners), I don't see how to bail out of the op()
>> method.
>> Is there a way to do this? If not would it be possible to change the
>> interface to add a cancel() method?
>>
> Hi Adrian,
>
> I'd think you could tell your ProgressMonitor that you've canceled
> the task with monitor.setCanceled(true), and check the
> monitor.isCanceled flag throughout your code. You could also
> override the Dialog methods close(), cancelPressed()... and perform
> your cleanup there...
>
> Does that work?
>
> Cheers,
> Cory.
--adrian
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira