Skip to main content



      Home
Home » Modeling » Epsilon » qualified names on referance labels
qualified names on referance labels [message #1053486] Mon, 06 May 2013 04:51 Go to next message
Eclipse UserFriend
Hi all,

I need qualified name on reference labels but don't know how can i implement this

feature anyone can help me to do ?

Sample scenario is on attached picture

regards.
Re: qualified names on referance labels [message #1053575 is a reply to message #1053486] Mon, 06 May 2013 11:00 Go to previous messageGo to next message
Eclipse UserFriend
Eugenia is not going to help you there, I'm afraid. You will need to customize the code generated by GMF. Have a look in the code used for the property pages and tell us how it goes for you Smile.

Update: I think you should look at the getText method of the *SheetLabelProvider in the "diagram.sheet" subpackage of your .diagram plugin.

[Updated on: Mon, 06 May 2013 11:10] by Moderator

Re: qualified names on referance labels [message #1060339 is a reply to message #1053575] Fri, 24 May 2013 04:24 Go to previous message
Eclipse UserFriend
Hi i found the solution.

we must do this feature on XXXEditor project.

This feature must be implemented to the meta clasess one by one.

Example;

i define a method which returns qualified name of Element (belongs to my model
so if u want to use this u must change this method. Because ContentUnit my abstract class and whole metaclasess extended from ContentUnit and its have name property)
	public static String returnQualifiedNameOfElement(EObject object) {
		String qualifiedName = "";
		while (object.eContainer() != null) {
			if (object.eContainer() instanceof ContentUnit)
				qualifiedName = ((ContentUnit) object.eContainer()).getName() + "." + qualifiedName;
				object = object.eContainer();
		}
		return qualifiedName;
	}


and then i use this method on ContentTypeItemProvider.java class. Which automatically generated after gmf. (ContentType is my meta class of my metamodel)

on ContentTypeItemProvider.java class getText() method. (getText() is used for represent property names on editor project) i used above method. like;

	@Override
	public String getText(Object object) {
		String label = Util.returnQualifiedNameOfElement((EObject) object) + ((ContentType)object).getName();
		return label == null || label.length() == 0 ?
			getString("_UI_ContentType_type") :
			getString("_UI_ContentType_type") + " " + label;
	}




I hope this helps another who searching qualified name on GMF

Regards

[Updated on: Fri, 24 May 2013 07:10] by Moderator

Previous Topic:Kepler build and Epsilon releases
Next Topic:EVL diagnostics in Problems View, but no decorators on Diagram
Goto Forum:
  


Current Time: Wed Jul 23 07:56:50 EDT 2025

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

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

Back to the top