Project: Eclipse_Platform_UI
Bug 306545 The changes in the Saveable Service causes the Save button to disable for our modeling resources
Reported: 2010-03-19 12:09:23 | Status: verified fixed

Build Identifier: I20100313-1044 (eclipse version 3.6.0) The code changes in eclipse break our saveable provider functionality. class: org.eclipse.ui.internal.navigator.NavigatorSaveablesService method: createSaveablesProvider changed: calling internalGetContentProvider instead of getContentProvider cause: In previous older build, the return value from getContentProvider() for the contentProvider is UMLNavigatorContentProviderWrapper. But in the new build, the value from internalGetContentProvider() is org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider (wrapper of UMLNavigatorContentProviderWrapper) and it is not an adaptable. ===== new code ===== private SaveablesProvider createSaveablesProvider(NavigatorContentDescriptor descriptor) { NavigatorContentExtension extension = contentService.getExtension(descriptor, true); ITreeContentProvider contentProvider = extension.internalGetContentProvider(); return (SaveablesProvider)AdaptabilityUtility.getAdapter(contentProvider, SaveablesProvider.class); } ===== Old code ===== private SaveablesProvider createSaveablesProvider(NavigatorContentDescriptor descriptor) { NavigatorContentExtension extension = contentService.getExtension(descriptor, true); ITreeContentProvider contentProvider = extension.getContentProvider(); return (SaveablesProvider)AdaptabilityUtility.getAdapter(contentProvider, SaveablesProvider.class); } Reproducible: Always Steps to Reproduce: 1.Create a UML modeling project P1 and a UML model file (such as M.emx) 2.Restart the workspace 3.After the workbench shown up, switch to Modeling Perspective. 4.In the Project Explorer, click the + infront of the project P1 to expand and show it contents. Expect: The ModelerSaveablesProvider is created and added to eclipse's saveablesProviderMap in the org.eclipse.ui.internal.navigator.NavigatorSaveablesService class. Result: The ModelerSaveablesProvider is NOT added to the eclipse's saveablesProviderMap. So, when user selected the model tree item in dirty state, the Save button on the toolbar and main menu bar always disable. Thus, user can not save the dirty model.

Files changed in fix:
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java