Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » getModifier() protected in AbstractTool
getModifier() protected in AbstractTool [message #231252] Thu, 01 March 2007 11:59 Go to next message
Eclipse User
Originally posted by: none.gmail.com

I have created a new tool that allows a user to select an EditPart or if
they drag, create a connection. This way they don't have to switch
tools. To create this tool I extended the
org.eclipse.gef.tools.TargetingTool. In the implementation of the
SelectionTool.updateTargetRequest() method the modifiers (keys) pressed
during the selection are added to the SelectionRequest using the
following call:
request.setModifiers(getCurrentInput().getModifiers());

I need to do the same thing in my new tool, but I get a compile error
when I make the same call, because the getModifiers() method from the
AbstractTool$Input class is protected. Is there a workaround to get the
modifiers into the request?
Re: getModifier() protected in AbstractTool [message #231269 is a reply to message #231252] Thu, 01 March 2007 13:25 Go to previous messageGo to next message
Eclipse User
Originally posted by: none.gmail.com

I found a workaround. It only works for the cntrl key though.

if(getCurrentInput().isControlKeyDown()){
request.setModifiers(MouseEvent.CONTROL);
}else
request.setModifiers(0);
}

Scott Hathaway wrote:
> I have created a new tool that allows a user to select an EditPart or if
> they drag, create a connection. This way they don't have to switch
> tools. To create this tool I extended the
> org.eclipse.gef.tools.TargetingTool. In the implementation of the
> SelectionTool.updateTargetRequest() method the modifiers (keys) pressed
> during the selection are added to the SelectionRequest using the
> following call:
> request.setModifiers(getCurrentInput().getModifiers());
>
> I need to do the same thing in my new tool, but I get a compile error
> when I make the same call, because the getModifiers() method from the
> AbstractTool$Input class is protected. Is there a workaround to get the
> modifiers into the request?
Re: getModifier() protected in AbstractTool [message #231323 is a reply to message #231269] Fri, 02 March 2007 11:35 Go to previous message
Eclipse User
Originally posted by: none.unknown.com

Doesn't Input have a bunch of other methods as well to determine which
modifiers are set? If you still feel the need to have the modifiers field
exposed, open a bug report requesting that.

"Scott Hathaway" <none@gmail.com> wrote in message
news:es75qt$914$1@utils.eclipse.org...
>I found a workaround. It only works for the cntrl key though.
>
> if(getCurrentInput().isControlKeyDown()){
> request.setModifiers(MouseEvent.CONTROL);
> }else
> request.setModifiers(0);
> }
>
> Scott Hathaway wrote:
>> I have created a new tool that allows a user to select an EditPart or if
>> they drag, create a connection. This way they don't have to switch tools.
>> To create this tool I extended the org.eclipse.gef.tools.TargetingTool.
>> In the implementation of the SelectionTool.updateTargetRequest() method
>> the modifiers (keys) pressed during the selection are added to the
>> SelectionRequest using the following call:
>> request.setModifiers(getCurrentInput().getModifiers());
>>
>> I need to do the same thing in my new tool, but I get a compile error
>> when I make the same call, because the getModifiers() method from the
>> AbstractTool$Input class is protected. Is there a workaround to get the
>> modifiers into the request?
Previous Topic:ManhattanConnectionRouter ?
Next Topic:logic example animation !!
Goto Forum:
  


Current Time: Fri Jul 25 13:37:52 EDT 2014

Powered by FUDForum. Page generated in 0.01910 seconds