Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Help with edit policies
Help with edit policies [message #245524] Tue, 16 September 2008 09:39 Go to next message
Dominic Hanlan is currently offline Dominic HanlanFriend
Messages: 98
Registered: July 2009
Member
I have a GEF viewer contained in a graphical editor. It is showing the contents of a database, and has a figure for each entry. It
looks much like a directory listing when showing icons. I have an edit part which overrides performRequest to catch the double
click to handle REQ_OPEN, this causes another view to open. So far so good.

I don't have a palette on the viewer.

The problem comes when I want to be able to select a single figure and change it's appearance. I have tried installing an edit
policy SELECTION_FEEDBACK_ROLE, extending SelectionEditPolicy, this has no effect at all. I see the policy installed via the edit
part, but no call to activate or deactivate of the policy is made, let alone to hide or show the selection feedback.

I thought it maybe due to no active tool being set so in the configureGraphicalViewer method I added a edit domain set active tool
to new SelectionToolEntry().createTool;

This again makes no difference, what is the magic switch I have forgotten to flick? The viewer seems to react to nothing but the
edit parts performRequest REQ_OPEN request.

The viewer is connected into the workbench selection mechanism.

I have tried various other ROLES and edit policies, it's just not listening!!

Any ideas?

/Dominic
Re: Help with edit policies [message #245528 is a reply to message #245524] Tue, 16 September 2008 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

Selection Feed Role is can be used for figures been made on the handle layer, which are the Grey ghost figure when you drag or resize an object...

here if you want something like if you select the figure and the color will change of the figure, then you can do one thing is....
there is a method setSelected(int arg) in AbstractEditPart. This method is called when an edit part is selected or deselected. You need to override this call and do whatever changes you want to the figure..,
Re: Help with edit policies [message #245533 is a reply to message #245528] Tue, 16 September 2008 13:25 Go to previous messageGo to next message
Dominic Hanlan is currently offline Dominic HanlanFriend
Messages: 98
Registered: July 2009
Member
Excellent, that works perfectly!

The next question, how would I create a figure on the handle layer if I did want to use an edit policy / Role?

Regards
Re: Help with edit policies [message #245711 is a reply to message #245533] Tue, 30 September 2008 19:11 Go to previous message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

i will tell you two things which can help

1. check the methods decorateChild in the LayoutEditPolicy which is the super class of your xylayout edit policy.
this decorate child method install the primary drag role, because of which those handles on the edit part are created, this edit policy is actually ResizazbleEditPolicy.
Now these handles are also created on handle layer so by putting proper break points you can figure out from where the ghost images are created.

2. when you create the scalable root edit part in your editor class, go inside that class, there all the layers are created one after another including the handle layer, put some break points there also..,
Previous Topic:Problem creating RCP Editor with GEF
Next Topic:Edit Part life cycle
Goto Forum:
  


Current Time: Fri Apr 26 08:10:15 GMT 2024

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

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

Back to the top