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

Bug 335987

Summary: [General][Enhancement] Show/Hide Connectors Labels and External Nodes Labels
Product: [Modeling] Papyrus Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: CoreAssignee: Vincent Lorenzo <vincent.lorenzo>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: antonio.petrelli
Version: 0.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 335989, 343347, 343359    
Bug Blocks:    

Description Vincent Lorenzo CLA 2011-02-01 11:45:32 EST
GMF provides actions to Show/Hide all labels for a connector. In Papyrus, we need to have an action more specific with a dialog to allow to the user to select which labels he wants for a connector  and which labels he doesn't want. The command for this new action should be provided by an Editpolicy owned by the ConnectionEditParts. 


FYI : currently this action is done by org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy, with a ToggleConnectionLabelsRequest.
Comment 1 Vincent Lorenzo CLA 2011-02-01 12:03:36 EST
The specific EditPolicy should be added to the ConnectionEditPart in the Papyrus Class UMLConnectionNodeEditPart, because each Connection used in Papyrus extends this class!
Comment 2 Vincent Lorenzo CLA 2011-02-02 08:22:47 EST
In R3871 : 
First commit for the new action Show/Hide Connector Label (which allow to select for a connector which labels to display)
a new request is created for this action
add a new Editpolicy (added to UMLConnectionNodeEditPart)

The binding is not yet done (CTRL+F5).
Currently, in the dialog, we display the text value for each label, but we can't provide its role (name, stereotype, multiplicity,...) neither an icon for it.
In order to do that, we should modify the possibilities of the gmfgen to store and get this information.
Comment 3 Vincent Lorenzo CLA 2011-04-15 08:52:32 EDT
Commited in R4459.
	- Allow to define label visibility in the GMFGen
	- Add a label group in the preferences (for the labels which use the Label Role Node in the GMFGen)
	- Add the Label Manager Action for each labels which provides the EditPolicy ShowLabelsEditPolicy 
			- provided by default for each UML Links
			- we need to add it to the nodes which have External Node Label

Main changes : 
	in oep.diagram.common : 
		- add ShowHideLabelsEditPolicy which replace ConnectionLabelsEditPolicy
		- the class UMLConnectionNodeEditPolicy (super class of all UmlConnection) provides ShowHideLabelsEditPolicy
		- a new icons folder named label_rode, used to regroup the icon used for the label
		- a new Interface ILabelRoleProvider
	in oep.def
		- ExternalNodeLabelEditPart.xpt and LinkLabelEditPart.xpt are modified to provides ILabelRoleProvider
		- NodeEditPart : modification of  handleNotificationEvent
		- ViewProvider : add the initialization of the labels for Node and Link
		- LinkPreferencePage and NodePreferencePage : add the default initialization for the visibility of the labels
	in oep.preferences : 
	   some modification to add the label group to the Connection Preference Page and the Node Preference Page (only if they have External Node Label)
	in oep.gmfgenextension :
		modifications to provides the Label Role Node
	in oep.diagram.menu : 
	   add the actions to manages the connectors

For further informations, please see the SVN log.

Each diagram should be regenerated, but it is better to wait some days, because I'm going to work on others things which will need an regeneration too.
Comment 4 Vincent Lorenzo CLA 2011-04-15 09:02:15 EDT
Warning : if you have a node representation and a link representation for the same element (for example, AssociationNodeEditPart and AssociationEditPart),

when you define the Metamodel Type or the Specialization Type of the element, you can't specify the same "Display Name" for each EditPart.

This "Display Name" is used to generate the Preferences Pages. So, before you had one Preference Page by Element (I think) and after you get 2 Preferences Pages :

    Before :
        AssociationPreferencePage 

    After :
        AssociationNodePreferencePage
        AssociationLinkPreferencePage
        (you should destroy AssociationPreferencePage)
Comment 5 Vincent Lorenzo CLA 2011-04-16 04:12:30 EDT
In R4462 : change the name of LabelRole into LabelVisibilityPreference (oep.def and oep.gmfgenextension are modified!)
Comment 6 Vincent Lorenzo CLA 2011-04-18 03:36:31 EDT
In R4477 : correct a rename error in oep.def
Comment 7 Vincent Lorenzo CLA 2011-04-18 08:25:10 EDT
In R4485 : improve the xpt template to avoid some empty lines.
Comment 8 Vincent Lorenzo CLA 2011-04-20 05:27:22 EDT
Committed in R4503 : 
Add useful methds for the preferences pages + Template enhancement
Comment 9 Vincent Lorenzo CLA 2013-03-13 09:50:28 EDT
This bug can be marked as closed fixed.