Problems with Labels (DirectEditRequest) [message #245004] |
Tue, 19 August 2008 07:59  |
Eclipse User |
|
|
|
Originally posted by: andy.andy-n.org
Hi Im new in GEF, and I tried the sample application. Now I am writing my
own editor with a (container) figure with some labels. From the
(container) figure I get the correct
org.eclipse.gef.requests.DirectEditRequest after clicking on an EditPart
that has already been selected, but when I click on the labels I dont get
a DirectEditRequest! When I click on the Label once, the Label is not
being selected. When I double click on the Label, I get the
org.eclipse.gef.requests.SelectionRequest.
Can you help me?
Thanks Andy
|
|
|
Re: Problems with Labels (DirectEditRequest) [message #245014 is a reply to message #245004] |
Tue, 19 August 2008 11:39   |
Eclipse User |
|
|
|
Originally posted by: lifesting.gmail.com
Andy wrote:
> Hi I�m new in GEF, and I tried the sample application. Now I am writing
> my own editor with a (container) figure with some labels. From the
> (container) figure I get the correct
> org.eclipse.gef.requests.DirectEditRequest after clicking on an EditPart
> that has already been selected, but when I click on the labels I don�t
> get a DirectEditRequest! When I click on the Label once, the Label is
> not being selected. When I double click on the Label, I get the
> org.eclipse.gef.requests.SelectionRequest.
>
> Can you help me?
> Thanks Andy
>
>
That's right, DirectEditRequest is produced by SelectEditPartTracker
when you click an EditPart that was in in Selected state, it directly
invokes EditPart's method performRequest and pass a DirectEditReuqest as
parameter.
protected void performDirectEdit() {
DirectEditRequest req = new DirectEditRequest();
req.setLocation(getCurrentInput().getMouseLocation());
new DelayedDirectEditHelper(
getSourceEditPart().getViewer(),
req,
getSourceEditPart());
}
The label you added in container figure hasn't a corresponding EditPart,
How can it produces DirectEditRequest for you?
Once host EditPart receives a DirectEditRequest, display a CellEditor on
the position where label was placed.
|
|
|
Re: Problems with Labels (DirectEditRequest) [message #245019 is a reply to message #245014] |
Tue, 19 August 2008 15:49   |
Eclipse User |
|
|
|
Originally posted by: andy.andy-n.org
David BY Chan wrote:
> Andy wrote:
>> Hi Iᅵm new in GEF, and I tried the sample application. Now I am writing
>> my own editor with a (container) figure with some labels. From the
>> (container) figure I get the correct
>> org.eclipse.gef.requests.DirectEditRequest after clicking on an EditPart
>> that has already been selected, but when I click on the labels I donᅵt
>> get a DirectEditRequest! When I click on the Label once, the Label is
>> not being selected. When I double click on the Label, I get the
>> org.eclipse.gef.requests.SelectionRequest.
>>
>> Can you help me?
>> Thanks Andy
>>
>>
> That's right, DirectEditRequest is produced by SelectEditPartTracker
> when you click an EditPart that was in in Selected state, it directly
> invokes EditPart's method performRequest and pass a DirectEditReuqest as
> parameter.
> protected void performDirectEdit() {
> DirectEditRequest req = new DirectEditRequest();
> req.setLocation(getCurrentInput().getMouseLocation());
> new DelayedDirectEditHelper(
> getSourceEditPart().getViewer(),
> req,
> getSourceEditPart());
> }
> The label you added in container figure hasn't a corresponding EditPart,
> How can it produces DirectEditRequest for you?
> Once host EditPart receives a DirectEditRequest, display a CellEditor on
> the position where label was placed.
Thank you for your answer, but I have a Editpart for the Label. That is my
problem! The responsible Editpart serves in the method
performRequest(Request request) only the
org.eclipse.gef.requests.SelectionRequest, but what I need is the
DirectEditRequest!
Please help me,
Thanks Andy
|
|
|
Re: Problems with Labels (DirectEditRequest) [message #245034 is a reply to message #245019] |
Wed, 20 August 2008 10:42  |
Eclipse User |
|
|
|
Originally posted by: lifesting.gmail.com
Andy wrote:
> David BY Chan wrote:
>
>> Andy wrote:
>>> Hi Iᅵm new in GEF, and I tried the sample application. Now I am
>>> writing my own editor with a (container) figure with some labels.
>>> From the (container) figure I get the correct
>>> org.eclipse.gef.requests.DirectEditRequest after clicking on an
>>> EditPart that has already been selected, but when I click on the
>>> labels I donᅵt get a DirectEditRequest! When I click on the Label
>>> once, the Label is not being selected. When I double click on the
>>> Label, I get the org.eclipse.gef.requests.SelectionRequest.
>>>
>>> Can you help me?
>>> Thanks Andy
>>>
>>>
>> That's right, DirectEditRequest is produced by SelectEditPartTracker
>> when you click an EditPart that was in in Selected state, it directly
>> invokes EditPart's method performRequest and pass a DirectEditReuqest
>> as parameter.
>
>> protected void performDirectEdit() {
>> DirectEditRequest req = new DirectEditRequest();
>> req.setLocation(getCurrentInput().getMouseLocation());
>> new DelayedDirectEditHelper(
>> getSourceEditPart().getViewer(),
>> req,
>> getSourceEditPart());
>> }
>
>
>> The label you added in container figure hasn't a corresponding
>> EditPart, How can it produces DirectEditRequest for you?
>
>> Once host EditPart receives a DirectEditRequest, display a CellEditor
>> on the position where label was placed.
>
> Thank you for your answer, but I have a Editpart for the Label. That is
> my problem! The responsible Editpart serves in the method
> performRequest(Request request) only the
> org.eclipse.gef.requests.SelectionRequest, but what I need is the
> DirectEditRequest!
> Please help me,
> Thanks Andy
>
>
copy your editpart's definition for label please!
|
|
|
Powered by
FUDForum. Page generated in 0.03936 seconds