Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
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
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 304
Registered: January 2010
Senior Member
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]

Report message to a 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
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
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]

Report message to a 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 30 13:29:07 EDT 2014

Powered by FUDForum. Page generated in 0.02020 seconds