Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Qualified names on referance labels
Qualified names on referance labels [message #1053673] Tue, 07 May 2013 04:29 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 #1053751 is a reply to message #1053673] Tue, 07 May 2013 09:42 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

did you try the expression labels in GMF. You can define OCL expressions to calculate the text which is displayed in the label.

Ralph
Re: Qualified names on referance labels [message #1053756 is a reply to message #1053751] Tue, 07 May 2013 09:57 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi,

No i dont try this. Because i am so new to gmf and dont know how can i do this. Can u

explain me this approach ?

Regards

[Updated on: Wed, 08 May 2013 09:57]

Report message to a moderator

Re: Qualified names on referance labels [message #1058218 is a reply to message #1053756] Mon, 13 May 2013 05:14 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

it is quite easy go to to your gmfmap file. Instead of adding a feature label you can add an expression label. To this expression label you can add ocl expressions computing the value of the label.

Ralph
Re: Qualified names on referance labels [message #1058523 is a reply to message #1058218] Tue, 14 May 2013 07:56 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi,

Yes i try and labels on diagram look like qualified name but i must do this for

properties section too. so i must do this same way ?

Regards
Re: Qualified names on referance labels [message #1058987 is a reply to message #1058523] Thu, 16 May 2013 02:58 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
What do you want in the properties section? Derive a semantic attribute of the model? You could do this by using EMF and OCL.
Re: Qualified names on referance labels [message #1059101 is a reply to message #1058987] Thu, 16 May 2013 13:20 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
i cant do this it works only labels i think. But i need to show instances name as

qualified name on properties section of diagram. So i try another way, i change

the emf model getXXX(); method but when this method activated my element names change

too because when i save my diagram, Diagram thinks I changed the name of the model

instance. So if i can do this with expression label way, i think it works same as

another way too.

(on attached image u can see properties section. Its in the lower left of picture)

Regards
Re: Qualified names on referance labels [message #1059425 is a reply to message #1059101] Sat, 18 May 2013 04:59 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

where in the properties view do you want to show the fully qualified name? In the heading of it or in the table section? If you want to have it in the heading you can modify xxxSheetLabelProvider's getText() method.

Ralph
Re: Qualified names on referance labels [message #1059505 is a reply to message #1059425] Mon, 20 May 2013 02:21 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi,

(on attached picture i explain where i need to qualified name.)

When i write this code to ContentSheetLabelProvider;

public String getText(Object element) {
		element = unwrap(element);
		if (element instanceof ContentNavigatorGroup) {
			return ((ContentNavigatorGroup) element).getGroupName() + ".serhat";
		}
		IElementType etype = getElementType(getView(element));
		return etype == null ? "" : etype.getDisplayName() + ".serhat";
	}


I get attached picture. But i need changed name on 2. section (on Attache picture you can see 2. section)

regards
  • Attachment: aaaa.png
    (Size: 188.24KB, Downloaded 49 times)

[Updated on: Mon, 20 May 2013 02:22]

Report message to a moderator

Re: Qualified names on referance labels [message #1060008 is a reply to message #1059505] Wed, 22 May 2013 10:16 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Have no one did need this feature?
Re: Qualified names on referance labels [message #1060342 is a reply to message #1060008] Fri, 24 May 2013 04:35 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

you should be able to change the presentation here by modifying you generated .edit code provided by gmf. You should take a look at this http://wiki.eclipse.org/EMF/Recipes#Recipe:_Custom_Labels .

Ralph
Re: Qualified names on referance labels [message #1060377 is a reply to message #1060342] Fri, 24 May 2013 07:09 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi

Yes this is the solution of my problem thanks

Regards
Re: Qualified names on referance labels [message #1061333 is a reply to message #1060377] Fri, 31 May 2013 05:14 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

you could think of overwriting EMF's Jet Templates in case that you delete your generated code in future. This could save you some work then.

Ralph
Re: Qualified names on referance labels [message #1061812 is a reply to message #1061333] Tue, 04 June 2013 04:20 Go to previous message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi,

Thats look good i'll try

Thanks
Previous Topic:GMF Palette Stack Tool Group
Next Topic:Property Selection Filter on Property Section
Goto Forum:
  


Current Time: Wed Jul 23 08:01:16 EDT 2014

Powered by FUDForum. Page generated in 0.02581 seconds