Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327438

Summary: [Menu Diagram] Initial State for the actions
Product: [Modeling] Papyrus Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: CoreAssignee: Vincent Lorenzo <vincent.lorenzo>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: vincent.lorenzo
Version: 0.7.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Vincent Lorenzo CLA 2010-10-11 08:32:03 EDT
When the actions were in the oepd.common, the initial state of the actions was disable (just after starting eclipse), because nothing was selected (common, r2910).

In the new plugin org.eclipse.papyrus.diagram.menu, all actions are enable because the plugin is not launched.
Ideas : 
	- Activator could implements org.eclipse.ui.IStartup and we could use this extension point in the plugin...
	- add refreshMenu() in ParametricAndListeningHandler.setInitializationData
	
	-> doesn't resolve all problems : autosize is always to true after the startup.
Comment 1 Vincent Lorenzo CLA 2010-10-19 06:14:14 EDT
in r2921 : add IStartup + an enableWHen for the autoSize in the toolbar.
Comment 2 Vincent Lorenzo CLA 2013-03-13 10:04:13 EDT
I think that we should remove the IStartup and find another way to correct this bug.
Comment 3 Vincent Lorenzo CLA 2013-03-13 10:04:36 EDT
This bug must not be closed!
Comment 4 Camille Letavernier CLA 2014-03-25 15:33:53 EDT
The enable state is never computed for Java-based property testers (Unless force activation is set to true in the plugin.xml, which is not recommended)

Possible solutions:

- Implement a *lightweight* property tester in a *low level* Papyrus plug-in (With as few dependencies as possible, to avoid starting N plug-ins)
- Implement the "isEnabled" state with XML-based Eclipse Expressions (Which are properly executed)

In all cases, it is important that testing the Actions enablement/visibility does not require to start any leaf Papyrus plug-in (Which takes time and memory, because all dependencies are loaded, and it is intrusive for non-Papyrus users)