Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to get properties element in EditPart programatically?
How to get properties element in EditPart programatically? [message #908789] Thu, 06 September 2012 02:16 Go to next message
Iqbal Hossain is currently offline Iqbal Hossain
Messages: 101
Registered: May 2011
Location: Bangladesh
Senior Member
Hello, How to get properties element in EditPart programatically? suppose i have a node NODE1 and it have some properties like name, size, startTime etc....what i am trying to do is in EditParts i will put some constrains. to do so i need to know what are the values of the elements. so is there any way or function that can get the values of the property elements?

thnxx
Re: How to get properties element in EditPart programatically? [message #908890 is a reply to message #908789] Thu, 06 September 2012 07:25 Go to previous messageGo to next message
Aurelien Pupier is currently offline Aurelien Pupier
Messages: 571
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

use XXXEditPart.resolveSematicElement() and then navigate to your properties.

Regards,


Aurélien Pupier - Bonitasoft S.A.
My company Eclipse-related blog
Re: How to get properties element in EditPart programatically? [message #938875 is a reply to message #908890] Wed, 10 October 2012 08:28 Go to previous messageGo to next message
Iqbal Hossain is currently offline Iqbal Hossain
Messages: 101
Registered: May 2011
Location: Bangladesh
Senior Member
anyone else can help?
Re: How to get properties element in EditPart programatically? [message #938879 is a reply to message #938875] Wed, 10 October 2012 08:31 Go to previous message
Iqbal Hossain is currently offline Iqbal Hossain
Messages: 101
Registered: May 2011
Location: Bangladesh
Senior Member
public class SFPDPFigure extends RectangleFigure {
private WrappingLabel fFigureSFPDPNameFigure;
public SFPDPFigure() {

FlowLayout layoutThis = new FlowLayout();
layoutThis.setStretchMinorAxis(false);
layoutThis.setMinorAlignment(FlowLayout.ALIGN_LEFTTOP);

layoutThis.setMajorAlignment(FlowLayout.ALIGN_LEFTTOP);
layoutThis.setMajorSpacing(5);
layoutThis.setMinorSpacing(5);
layoutThis.setHorizontal(true);

this.setLayoutManager(layoutThis);

**** if(value ==1) then setBackgroundColor is is light gray and else color is red**************
this.setBackgroundColor(ColorConstants.lightGray);
this.setBorder(new LineBorder(ColorConstants.black, getMapMode()
.DPtoLP(1)));
createContents();

}


this is a sample of my code. the line with **** means value is a attribute of sFPDP node and i need to change background color of sFPDP by value. but problem is how i can i read value??
Previous Topic:Date and timezones
Next Topic:OpenDiagramEditPolicy
Goto Forum:
  


Current Time: Thu Oct 23 10:26:21 GMT 2014

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

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