Bug 211065 - [Palette] Cannot cancel changes made in Customize Palette dialog
Summary: [Palette] Cannot cancel changes made in Customize Palette dialog
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-27 10:00 EST by Cherie Revells CLA
Modified: 2013-10-17 09:49 EDT (History)
4 users (show)

See Also:


Attachments
I've created default save and restoreToSaved methods. (6.97 KB, patch)
2009-02-05 16:58 EST, Brendan Curran-Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cherie Revells CLA 2007-11-27 10:00:20 EST
Currently, when a property is changed in the Customize Palette dialog, the PaletteCustomizer applies the change immediately to the palette model.  When the Cancel button is pressed the changes are not reverted.

Why not keep track of the changes to be made and only change the palette model when the Apply or Ok buttons are pressed?
Comment 1 Cherie Revells CLA 2007-11-27 10:23:57 EST
I see that the TreeViewer in the PaletteCustomizeDialog is also based on the palette model, so if the palette model isn't updated until later, the tree viewer won't be updated on the fly either.
Comment 2 Randy Hudson CLA 2007-11-27 10:29:13 EST
Cancel calls revert to saved on the customizer. Can the customizer not undo the effects of the dialog? The customizer saves and restores the state. The intention is that revertToSaved() would reload the last saved state, hopefully applying it to the palette being displayed.
Comment 3 Cherie Revells CLA 2007-11-27 10:53:13 EST
Yes, I think that is what I will need to do, but why it isn't done in GEF?  Couldn't the GEF PaletteCustomizer generically save and restore the state?  Seems to me that every client would need to do this.
Comment 4 Randy Hudson CLA 2007-11-27 12:41:59 EST
> Yes, I think that is what I will need to do, but why it isn't done in GEF? 
> Couldn't the GEF PaletteCustomizer generically save and restore the state? 
> Seems to me that every client would need to do this.

Probably so in the simple case of just hiding and reordering entries, although even that is not very simple (number of entries changes between releases).  As long as the entries, groups, and drawers all had IDs, GEF could probably use mementos to persist the default properties.

In more complex cases, the user can create their own entries, specifying icons, creation parameters, etc., all of which is domain specific, so its persistence can't be handled generically. There are also cases where the palette is a contribution from multiple sources, which means the changes must be persisted in multiple places.
Comment 5 Cherie Revells CLA 2007-11-30 11:08:33 EST
So I guess this is something that we most likely wouldn't do in GEF?  If so, I will close this bugzilla.  

By the way, in GMF, we try to enforce that all palette entries have ids.  We subclassed the GEF palette entry classes so that id is passed in the constructor.
Comment 6 Brendan Curran-Johnson CLA 2009-02-05 16:58:28 EST
Created attachment 124892 [details]
I've created default save and restoreToSaved methods.

Since the methods were previously abstract, in order to see the change, you must go into a projects PaletteCustomizer class (in the logic diagram it is LogicPaletteCustomizer.java) and either remove the empty save and restoreToSaved methods, or add calls to the superclass.
Comment 7 Alexander Nyßen CLA 2013-10-17 09:45:14 EDT
Unset target milestone as the specified one is already passed.
Comment 8 Alexander Nyßen CLA 2013-10-17 09:49:53 EDT
Assigning back to gef-inbox (and state to new), as specified assignee is no current GEF committer.