Skip to main content


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 HossainFriend
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
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

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

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
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 HossainFriend
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 HossainFriend
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: Fri Apr 19 23:52:32 GMT 2024

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

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

Back to the top