Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » dynamic tooltips
dynamic tooltips [message #78710] Sat, 18 November 2006 13:36 Go to next message
Eclipse UserFriend
Hi,

I would like to display some attributes of semantic element as node's
tooltip. For a start I have overridden in MyEditPart
handleNotificationEvent(Notification notification) method. This way I
can reflect changes in semantic model to tooltip label. It works well,
but I have no idea how to preset tooltip during node's creation. Where
such code should be plugged-in?

Regards,
Seweryn Niemiec
Re: dynamic tooltips [message #78818 is a reply to message #78710] Mon, 20 November 2006 06:45 Go to previous messageGo to next message
Eclipse UserFriend
On Sat, 18 Nov 2006 19:36:06 +0100, Seweryn Niemiec
<ser@man.szczecin.pl> wrote:

>I would like to display some attributes of semantic element as node's
>tooltip. For a start I have overridden in MyEditPart
>handleNotificationEvent(Notification notification) method. This way I
>can reflect changes in semantic model to tooltip label. It works well,
>but I have no idea how to preset tooltip during node's creation. Where
>such code should be plugged-in?

When you need to update some related data structure, like a tooltip,
you'll both need to initialise the data when the edit part is
activated and react when new changes are made. The initialisation is
typically done in the refreshVisuals() method, while you react by
overriding handleNotificationEvent() (as you know). Here's code in an
edit part of mine:
The method for the tooltip is put in its own method, and this method
is called both from refreshVisuals and handleNotificationEvent.

protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
if (ModelPackage.eINSTANCE.getComputation_Function().equals(
feature)) {

refreshFunction((ComputationNodeFigure)getNodeFigure());
} else {
super.handleNotificationEvent(notification);
}
}

protected void refreshVisuals() {
super.refreshVisuals();
refreshFunction((ComputationNodeFigure)getNodeFigure());
}

protected void refreshFunction(ComputationNodeFigure nodeFigure) {
Function fun = getFunction();
setFunctionToolTip(nodeFigure, fun);
nodeFigure.setArity(getFunctionArity());
}
Re: dynamic tooltips [message #79181 is a reply to message #78818] Tue, 21 November 2006 07:51 Go to previous messageGo to next message
Eclipse UserFriend
On Mon, 2006-11-20 at 12:45 +0100, Hallvard Trætteberg wrote:

> When you need to update some related data structure, like a tooltip,
> you'll both need to initialise the data when the edit part is
> activated and react when new changes are made. The initialisation is
> typically done in the refreshVisuals() method, while you react by
> overriding handleNotificationEvent() (as you know). Here's code in an

Tank you. It works very good.

Regards,
Seweryn Niemiec
--
Szczecin University of Technology
Academic Center of Computer Science
Re: dynamic tooltips [message #88522 is a reply to message #79181] Sat, 30 December 2006 05:49 Go to previous messageGo to next message
Eclipse UserFriend
Hey Seweryn,

Would you plz send me a sample code to implement this dynamic tooltip?
I m using GMF2.0M2.

Regards,
Sandip
"Seweryn Niemiec" <ser@man.szczecin.pl> wrote in message
news:1164113517.4766.82.camel@wafel...
On Mon, 2006-11-20 at 12:45 +0100, Hallvard Tr
Re: dynamic tooltips [message #112145 is a reply to message #88522] Thu, 15 March 2007 06:39 Go to previous messageGo to next message
Eclipse UserFriend
Sat, 30 Dec 2006 16:19:17 +0530, Sandip Sahoo:

> Hey Seweryn,
>
> Would you plz send me a sample code to implement this dynamic tooltip? I
> m using GMF2.0M2.

check this post:

http://serdom.szn.pl:8001/Eclipse/GMF/Making_figures_sensiti ve_to_attributes_of_semantic_elements

regards,
seweryn niemiec
Re: dynamic tooltips [message #120450 is a reply to message #112145] Thu, 19 April 2007 04:09 Go to previous messageGo to next message
Eclipse UserFriend
Seweryn Niemiec wrote:
> Sat, 30 Dec 2006 16:19:17 +0530, Sandip Sahoo:
>
>> Hey Seweryn,
>>
>> Would you plz send me a sample code to implement this dynamic tooltip? I
>> m using GMF2.0M2.
>
> check this post:
>
> http://serdom.szn.pl:8001/Eclipse/GMF/Making_figures_sensiti ve_to_attributes_of_semantic_elements

Seems this site is down ?

Is the getComputation_Function() method a manually coded method ? I
don't have that in my (generated) model package ...


thx,
Armin
Re: dynamic tooltips [message #120463 is a reply to message #120450] Thu, 19 April 2007 04:52 Go to previous messageGo to next message
Eclipse UserFriend
>> http://serdom.szn.pl:8001/Eclipse/GMF/Making_figures_sensiti ve_to_attributes_of_semantic_elements
>>
>
> Seems this site is down ?

Ok, figured that one out:

http://serdom.szn.pl/serwiki/Eclipse/GMF/Making_figures_sens itive_to_attributes_of_semantic_elements

> Is the getComputation_Function() method a manually coded method ? I
> don't have that in my (generated) model package ...

Ok, too, these where classes from Hallvard's model, "translated" them to
my own. Now I'm stuck with setFunctionToolTip and the Function class.
Where is that coming from ?


thx,
Armin
Re: dynamic tooltips [message #120869 is a reply to message #120463] Thu, 19 April 2007 09:37 Go to previous message
Eclipse UserFriend
> http://serdom.szn.pl/serwiki/Eclipse/GMF/Making_figures_sens itive_to_attributes_of_semantic_elements

That code actually helped and I solved my problem.


Armin
Previous Topic:Using file picture instead of shapes
Next Topic:Building RCP version of my GMF diagram editor
Goto Forum:
  


Current Time: Sun Jul 13 02:27:09 EDT 2025

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

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

Back to the top