no selection feedback / resize handles with ResizableEditPolicy [message #162435] |
Tue, 21 December 2004 18:25  |
Eclipse User |
|
|
|
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 #163141 is a reply to message #162719] |
Mon, 03 January 2005 04:37  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04415 seconds