Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » dialog box to confirm delete(Where to add dialog box to confirm delete?)
dialog box to confirm delete [message #508736] Wed, 20 January 2010 03:24 Go to next message
John Ye is currently offline John YeFriend
Messages: 20
Registered: July 2009
Junior Member
I am customizing an emf generated editor with tables and trees. I would like to add a dialog box to confirm delete and give user a chance to cancel. What is the best way to do it?

I can override Command's execute function to launch a MessageBox, but this creates coupling with UI. Besides, editor is marked as dirty already.

A related question is how to provide feedback on how many objects by type are deleted through statusLineManager, especially when delete cascade.

Thanks a lot.
Re: dialog box to confirm delete [message #508798 is a reply to message #508736] Wed, 20 January 2010 06:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
John,

Comments below.


John Ye wrote:
> I am customizing an emf generated editor with tables and trees. I
> would like to add a dialog box to confirm delete and give user a
> chance to cancel. What is the best way to do it?
Does delete have some permanent impact that's not undoable?
>
> I can override Command's execute function to launch a MessageBox, but
> this creates coupling with UI. Besides, editor is marked as dirty
> already.
And by then it's already been tested if it's executable and is expected
to execute properly.
>
> A related question is how to provide feedback on how many objects by
> type are deleted through statusLineManager, especially when delete
> cascade.
For all these things you'd need to override DeleteAction itself.
> Thanks a lot.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: dialog box to confirm delete [message #508903 is a reply to message #508798] Wed, 20 January 2010 16:39 Go to previous message
John Ye is currently offline John YeFriend
Messages: 20
Registered: July 2009
Junior Member
Ed,

Thanks a lot for your help. I will override DeleteAction's createCommand function to implement cascade deletion. I ran into problems when overriding ItemProviderAdapter's createRemoveCommand function.

I guess I can override run() function of DeleteAction to provide UI feedback.

The delete action is undoable. I plan to show a dialog box with "Do not show this dialog again" checkbox so that the dialog box is only shown the first time.

Thanks again,
John
Previous Topic:How to show an editable properties view
Next Topic:Is there a way to delete all generated code?
Goto Forum:
  


Current Time: Thu Apr 25 16:17:26 GMT 2024

Powered by FUDForum. Page generated in 0.03490 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top