Bug 114117 - [Palette] Expose the customize palette capability from GEF
Summary: [Palette] Expose the customize palette capability from GEF
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P1 enhancement
Target Milestone: 2.1   Edit
Assignee: Cherie Revells CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 114217 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-28 11:11 EDT by Steven R. Shaw CLA
Modified: 2010-07-19 12:30 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven R. Shaw CLA 2005-10-28 11:11:03 EDT
- GEF allows for palette customization from the UI.
- Need to integrate this capability and persist it in the workspace.
Comment 1 Steven R. Shaw CLA 2005-10-28 11:18:45 EDT
Additional comments:
Partners need the ability to change the diagram editor toolbox to only have 
the items that their customers need.  To accomplish this, they will need to:

1. Remove toolbox items from existing tabs
2. Remove existing tabs
3. Add their own tabs
4. Add their own items to existing tabs or newly created tabs

This extensibility functionality will also be essential to OEM situations.

The persisted workspace settings may need to be sharable or configurable 
through API...
Comment 2 Richard Gronback CLA 2005-10-30 13:28:15 EST
*** Bug 114217 has been marked as a duplicate of this bug. ***
Comment 3 Guennadi V. Vanine CLA 2006-01-28 23:21:59 EST
IMHO would be nice to have it sooooooooooner
Comment 4 Steven R. Shaw CLA 2006-02-22 09:32:12 EST
Reassigning to Cherie who has related paletted work in M6.
Comment 5 Cherie Revells CLA 2006-03-09 10:10:00 EST
Steve, what do you mean by Comment #1?  Does this mean that they need to be able to do it before deploy time or just that items can be removed from the palette when the application is run like in the GEF logic example?
Comment 6 Steven R. Shaw CLA 2006-03-09 10:18:55 EST
The expectation is that the workspace would be customized at runtime.  Then teams could export and share their workspace to other team members if they wished to reuse the customization.

I did some investigation of this and it looks like to persist the settings we merely need to implement the PaletteCustomizer interface and set it into the PaletteViewer customer.

Here's some code from the EDiagramEditor:
protected PaletteViewerProvider createPaletteViewerProvider() {
	return new PaletteViewerProvider(getEditDomain()) {
		protected void configurePaletteViewer(PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			viewer.setCustomizer(new PaletteCustomizer() {
				public void revertToSaved() {}
				public void save() {}
			});
			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
		}
	};
}
Comment 7 Steven R. Shaw CLA 2006-03-09 14:58:30 EST
Descoped officially from M6.  May still be considered if time permits and if the fix as mentioned below is low barrier.
Comment 8 Cherie Revells CLA 2007-12-20 17:46:43 EST
I have hooked up this capability in GMF.  More specifically,
- I have extended the PaletteCustomizerDialog to remove the toolbar items which we will not support in GMF.  (We do not want to delete items as the user could never get them back and we have decided not to support reordering as it is questionable how this would be saved especially if capabilities are also adding/removing palette entries.)
- I have added the concept of an IPaletteState which saves the state of a palette entry.  This allows the PaletteCustomizer to revert the changes made in the Customize dialog if the user pressed Cancel (this did not work in GEF).
- I am storing the customizations made in the workspace preferences.

See the classes in the org.eclipse.gmf.runtime.gef.ui.palette.customize package for more details.

Note:  The saving of customizations does not currently work in GMF generated diagram editors because these editors do not have palette ids.  This feature requires palette ids as this is how the palette entry is identified in the workspace preferences.
Comment 9 Richard Gronback CLA 2008-08-13 13:08:34 EDT
[target cleanup] 2.1 M4 was the original target milestone for this bug
Comment 10 Jacek Pospychala CLA 2008-08-14 09:52:27 EDT
From this bug description I guess you mean customizing palette by editor users, who can right click on palette and choose "Customize..." button, yes?

Or is it possible to programatically customize palette for particular editor?
thanks
Comment 11 Anthony Hunter CLA 2008-09-04 09:52:20 EDT
(In reply to comment #10)
> From this bug description I guess you mean customizing palette by editor users,
> who can right click on palette and choose "Customize..." button, yes?
> 
> Or is it possible to programatically customize palette for particular editor?
> thanks
> 

This enhancement implemented the GEF feature in GMF allowing customizing palette by editor users, not programatically.
Comment 12 Eclipse Webmaster CLA 2010-07-19 12:30:33 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug