Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Refreshing Decorations
Refreshing Decorations [message #65722] Thu, 19 October 2006 15:41 Go to next message
Eclipse UserFriend
Originally posted by: john.campaner.s1.com

I have an action which converts a node on my diagram from a regular model
node to a shortcut.

This action relocates the underlying EMF model object to a different
resource then makes the annotation on the diagram view object to identify it
as a shortcut (in the same way the create shortcut action does).

Everything works great except I have to close the diagram and reopen it to
see the shortcut decoration showup on the node which has been converted.

Any suggestions on how I can force the redecoration of a node? I tried
refresh, activating, deactivating then activating again. None of that
worked.

Thanks

John
Re: Refreshing Decorations [message #65744 is a reply to message #65722] Thu, 19 October 2006 17:02 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello John,

Can you put a breakpoint into the generated ShortcutsDecoratorProvider and
ensure that corresponding methods will be called after your attempts to reefresh
editor + required annotation was created correctly on the correct instance
of View.

-----------------
Alex Shatalin
Re: Refreshing Decorations [message #65887 is a reply to message #65744] Thu, 19 October 2006 21:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.campaner.s1.com

Hi,

I set the breakpoints as requrested.

I'm not too experienced with GMF but what it looks like the issue may be
that the shortcuts decorator is not installed on the EditPart in question
(which makes total sense as the node was not a shortcut when it was
originally created...it only became a shortcut after creation).

Even if I somehow install the decorator, the refresh() method on Shortcuts
decorator says:

public void refresh() {

removeDecoration();

}

Which removes any decorations on the target


Any recommendation on how best to resolve these issues?


"Alex Shatalin" <vano@borland.com> wrote in message
news:cd695fb3122fb8c8c1c850464fbf@news.eclipse.org...
> Hello John,
>
> Can you put a breakpoint into the generated ShortcutsDecoratorProvider and
> ensure that corresponding methods will be called after your attempts to
> reefresh editor + required annotation was created correctly on the correct
> instance of View.
>
> -----------------
> Alex Shatalin
>
>
Re: Refreshing Decorations [message #66184 is a reply to message #65887] Fri, 20 October 2006 10:34 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello John,

If corresponding annotation was not found in view then probably refresh action
was called before the code installing an annotation. Yu can check it by putting
breakpoint in createDecorators method and into the code installing an annotation
and comparing id of the view inside your code and ShortcutsDecoratorProvider.

> Even if I somehow install the decorator, the refresh() method on
> Shortcuts decorator says:
>
> public void refresh() {
>
> removeDecoration();
>
> }
Decorations should be added later on. You can see them if you reopen the
diagram, isn't it? The same code will be executed there as well.

-----------------
Alex Shatalin
Previous Topic:Re: how to add to an existing edit policy?
Next Topic:modeling a typed graph with gmf
Goto Forum:
  


Current Time: Sat Jul 27 17:18:05 GMT 2024

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

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

Back to the top