Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problems with Labels (DirectEditRequest)
Problems with Labels (DirectEditRequest) [message #245004] Tue, 19 August 2008 11:59 Go to next message
Eclipse UserFriend
Originally posted by: andy.andy-n.org

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
Re: Problems with Labels (DirectEditRequest) [message #245014 is a reply to message #245004] Tue, 19 August 2008 15:39 Go to previous messageGo to next message
Eclipse UserFriend
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 19:49 Go to previous messageGo to next message
Eclipse UserFriend
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 14:42 Go to previous message
Eclipse UserFriend
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!
Previous Topic:gef and html
Next Topic:DPI & platform independent figure bounds
Goto Forum:
  


Current Time: Tue Mar 19 06:55:57 GMT 2024

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

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

Back to the top