Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Editing of invisible labels when edit part is added bug or expected behaviour?
Editing of invisible labels when edit part is added bug or expected behaviour? [message #648314] Wed, 12 January 2011 11:44 Go to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi all,

I have the following scenario in my gmfmap:

Node
|
|- Feature Label Mapping: invisibleLabel (readOnly = false)
|- Feature Label Mapping: visibleLabel (readOnly = false)

In my addNotify method of NodeEditPart I have the following code:

invisibleLabelFigure.setVsisible(false);


The label gets visible as it moves into edit mode after adding the edipart. this can be corrected by changing the order of visibleLabel and invisibleLabel in my gmfgen to:

Node
|
|- Feature Label Mapping: visibleLabel (readOnly = false)
|- Feature Label Mapping: invisibleLabel (readOnly = false)

Is this expected behaviour or a bug in GMF? in my opinion the runtime should not make a invisible label visible for editing after a edit part is added to a diagram.

Ralph

[Updated on: Wed, 12 January 2011 11:45]

Report message to a moderator

Re: Editing of invisible labels when edit part is added bug or expected behaviour? [message #648554 is a reply to message #648314] Thu, 13 January 2011 13:56 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Hi,
I think you should use the Notation model feature VIEW_VISIBLE to set the visibility of your editpart instead of using the a setVisible on the figure.

Your can set the default visibility by extending the XXXViewProvider and use a the org.eclipse.gmf.runtime.diagram.core.viewProviders extension point.

This way, when a View is not visible, it should be not editable.

BR


R&D Engineer at BonitaSoft
Re: Editing of invisible labels when edit part is added bug or expected behaviour? [message #648913 is a reply to message #648554] Sat, 15 January 2011 11:30 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi Romain,

When I use

((xxxEditPart)children.get(1)).setStructuralFeatureValue(NotationPackage.eINSTANCE.getView_Visible(), false);


I get the following exception

Caused by: java.lang.IllegalArgumentException: Figure must be a child
	at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1581)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart.setLayoutConstraint(AbstractBorderedShapeEditPart.java:68)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.reorderChild(AbstractGraphicalEditPart.java:856)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart.reorderChild(AbstractBorderedShapeEditPart.java:123)
	at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:766)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.handleNotificationEvent(GraphicalEditPart.java:1464)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart.handleNotificationEvent(ShapeEditPart.java:183)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart.handleNotificationEvent(ShapeNodeEditPart.java:236)
	... 37 more


When using setVisible on my figure everything works fine..

Do you have an explanation for this behaviour?

Ralph

[Updated on: Sat, 15 January 2011 15:22]

Report message to a moderator

Re: Editing of invisible labels when edit part is added bug or expected behaviour? [message #649787 is a reply to message #648913] Thu, 20 January 2011 15:31 Go to previous message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
Hello,
I have use the following code to change the visibility of my EditPart
ChangePropertyValueRequest req = new ChangePropertyValueRequest(DiagramUIMessages.Command_hideLabel_Label, Properties.ID_ISVISIBLE, false) ;
editPartToHide.performRequest(req) ;


HTH
Romain


R&D Engineer at BonitaSoft
Previous Topic:Get mouse location
Next Topic:[Solved] Validate for Non Ascii characters
Goto Forum:
  


Current Time: Fri Apr 26 04:45:30 GMT 2024

Powered by FUDForum. Page generated in 0.02916 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top