Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » no selection feedback / resize handles with ResizableEditPolicy
no selection feedback / resize handles with ResizableEditPolicy [message #162435] Tue, 21 December 2004 23:25 Go to next message
Ulrich Küster is currently offline Ulrich KüsterFriend
Messages: 14
Registered: July 2009
Junior Member
Hi!

My problem: I don't get selection feedbeck nor resizable handles on my
child figures.

I'm using my own subclass of XYLayoutEditPolicy and install it with the
LAYOUT_ROLE:

installEditPolicy(EditPolicy.LAYOUT_ROLE,
new RuleXYLayoutEditPolicy(layout));

So from what I understood I should get ResizableEditPolicies via
createChildEditPolicy() by default. And those should give me selection
feedback and handles for resizing, but nothing appears. I can move my
objects (but don't get any feedback, neither selection nor drag
feedback). It seems I can't resize them.

I tried to override the createChildEditPolicy() to always return a new
ResizableEditPolicy but that didn't change anything.

I also tried to call setResizeDirections(PositionConstants.NSEW) but
that didn't change anything either.

Might it be possible, that my problem results from using GEF in a
ViewPart instead of an EditPart?

I create the viewer as follows:

public void createPartControl(Composite parent) {
// enable to listen for selection events of the schema editor!
//getSite().getPage().addSelectionListener("sortimenter.eclipse.schemagenerator.SchemaEditor ",
this);
getSite().getPage().addSelectionListener(this);
// create the GEF viewer
viewer = new ScrollingGraphicalViewer();
// create the control of that viewer
viewer.createControl(parent);
// contents are set in the selection changed method
// set RootEditPart
viewer.setRootEditPart(new FreeformGraphicalRootEditPart());
// set EditPartFactory
viewer.setEditPartFactory(new RuleEditorEditPartFactory());
// create an edit domain
EditDomain eDomain = new DefaultEditDomain(null);
eDomain.addViewer(viewer);
}

The content of the viewer is set in the selectionChanged() method and
that works fine.

Any hint what I might do wrong? Help would be greatly appreciated.

Thank you very much in advance,

Ulrich Küster
Re: no selection feedback / resize handles with ResizableEditPolicy [message #162548 is a reply to message #162435] Wed, 22 December 2004 15:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Do you know if the children are actually getting selected? Probably they
are if you are able to move them. Try putting a breakpoint in the
showSelection method, or analyzing the figure structure to see if the handle
layer contains handles, and is large enough to paint them.

"Ulrich K
Re: no selection feedback / resize handles with ResizableEditPolicy [message #162672 is a reply to message #162548] Thu, 23 December 2004 13:15 Go to previous messageGo to next message
Ulrich Küster is currently offline Ulrich KüsterFriend
Messages: 14
Registered: July 2009
Junior Member
> Do you know if the children are actually getting selected? Probably they
> are if you are able to move them. Try putting a breakpoint in the
> showSelection method, or analyzing the figure structure to see if the handle
> layer contains handles, and is large enough to paint them.
>

Hi!

The children do get selected. The method
AbstractEditPart.setSelected(int value) is called for my children edit
parts and in that message body a selection change is fired, however no
listeners are registered and nothing happens.

The method ResizableEditPart.showSelection() does never get called.

I suppose I'm making a real dumm newbie mistake but I can't figure out what.

Any idea where I should look at?

Thank you very much for your help.

Ulrich
Re: no selection feedback / resize handles with ResizableEditPolicy [message #162719 is a reply to message #162672] Fri, 24 December 2004 01:36 Go to previous messageGo to next message
cloudor Mising name is currently offline cloudor Mising nameFriend
Messages: 34
Registered: July 2009
Member
The ResizableEditPolicy will register a selection listener when being
activated.

Ulrich Küster wrote:
>
>> Do you know if the children are actually getting selected? Probably they
>> are if you are able to move them. Try putting a breakpoint in the
>> showSelection method, or analyzing the figure structure to see if the
>> handle
>> layer contains handles, and is large enough to paint them.
>>
>
> Hi!
>
> The children do get selected. The method
> AbstractEditPart.setSelected(int value) is called for my children edit
> parts and in that message body a selection change is fired, however no
> listeners are registered and nothing happens.
>
> The method ResizableEditPart.showSelection() does never get called.
>
> I suppose I'm making a real dumm newbie mistake but I can't figure out
> what.
>
> Any idea where I should look at?
>
> Thank you very much for your help.
>
> Ulrich

--
Cloudor Pu
http://cloudor.mysmth.net/
Re: no selection feedback / resize handles with ResizableEditPolicy [message #163141 is a reply to message #162719] Mon, 03 January 2005 09:37 Go to previous message
Ulrich Küster is currently offline Ulrich KüsterFriend
Messages: 14
Registered: July 2009
Junior Member
Hi,

I found my mistake (grrrrr). In one of my child edit parts, I had
overridden the activate() method without calling super.activate(). Thus
that child's edit policies did not get activated...

Thank you very much for your help and hints,

Uli

>
> The ResizableEditPolicy will register a selection listener when being
> activated.
>
> Ulrich Küster wrote:
>
>>
>>> Do you know if the children are actually getting selected? Probably
>>> they
>>> are if you are able to move them. Try putting a breakpoint in the
>>> showSelection method, or analyzing the figure structure to see if the
>>> handle
>>> layer contains handles, and is large enough to paint them.
>>>
>>
>> Hi!
>>
>> The children do get selected. The method
>> AbstractEditPart.setSelected(int value) is called for my children edit
>> parts and in that message body a selection change is fired, however no
>> listeners are registered and nothing happens.
>>
>> The method ResizableEditPart.showSelection() does never get called.
>>
>> I suppose I'm making a real dumm newbie mistake but I can't figure out
>> what.
>>
>> Any idea where I should look at?
>>
>> Thank you very much for your help.
>>
>> Ulrich
>
>
Previous Topic:Why my getOrphanChildrenCommand() never be called?
Next Topic:Question about which layout manager to use
Goto Forum:
  


Current Time: Sat Apr 27 01:26:19 GMT 2024

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

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

Back to the top