Selecting palette entry using keys. [message #186652] |
Wed, 06 July 2005 10:10 |
Eclipse User |
|
|
|
Originally posted by: wjancz.\/\/asko.pl(change \/\/ with w)
Hi.
Is there any way to select an entry from palette by pressing key?
I would like to select or mark entry which starts by the letter I pressed.
For example:
Palete_group_1:
entry_1;
second_entry;
zzz_entry;
By activating Palete_group_1 and pressing 's' i would like GEF to scroll
entry list and select "second_entry" entry.
It is usefull when there is long list of entries and I need to select entry
which is on the end of the list. Because sometimes I need to click many
times to scroll to the end of list.
...::WojT::..
|
|
|
Re: Selecting palette entry using keys. [message #186696 is a reply to message #186652] |
Wed, 06 July 2005 14:41 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Currently you cannot do this for free. We plan on making activation of a
tool available using a keybinding in 3.2. However, the keystroke will
activate and select the tool, not just put focus on the button.
You could add a KeyListener to the Canvas and try to do this yourself.
"WojT" <wjancz@\/\/asko.pl(change \/\/ with w)> wrote in message
news:dagalv$t4d$1@news.eclipse.org...
> Hi.
> Is there any way to select an entry from palette by pressing key?
> I would like to select or mark entry which starts by the letter I pressed.
> For example:
> Palete_group_1:
> entry_1;
> second_entry;
> zzz_entry;
>
> By activating Palete_group_1 and pressing 's' i would like GEF to scroll
> entry list and select "second_entry" entry.
> It is usefull when there is long list of entries and I need to select
> entry which is on the end of the list. Because sometimes I need to click
> many times to scroll to the end of list.
>
> ..::WojT::..
>
|
|
|
Re: Selecting palette entry using keys. [message #186817 is a reply to message #186696] |
Thu, 07 July 2005 02:43 |
Dazhen Gao Messages: 21 Registered: July 2009 |
Junior Member |
|
|
If you want to implement now, my suggestion:
1:Create your keyhandle , catch the key event. The best way this class
extends the GraphicalViewerKeyHandler.
You can regist a default action, or write another keyhandle, and
set this key handle to the parent of the previous key handle to deal with
the key select.
2:Set the instance of first keyhandle to your PaletteViewer.
3: Your Editpart of all support the key select impleemnt interface ,
this interface has a method findEditpart(KeyEvent event).
about this step, I don't think carefully.
4:your default action or your parent keyhandle code like this:(support
the parent key handle)
public boolean keyPressed(KeyEvent event) {
GraphicalEditPart part = getFocusEditPart( );
if (part == null)
{
part = (GraphicalEditPart)getViewer().getRootEditPart().
)
loop from the this editpart(deeply research the editpart)
loop
{
if (part instanceof myDefineInterface)
{
if (myDefineInterface.findEditpart(event).)
{
(GraphicalEditPart)getViewer().setSelection(new
StructuredSelection( part));
break;
}
}
}
}
return parent != null && parent.keyPressed(event);
}
above is my idea, I don't test them
"Randy Hudson" <none@us.ibm.com> wrote in message
news:dagqjb$k36$1@news.eclipse.org...
> Currently you cannot do this for free. We plan on making activation of a
> tool available using a keybinding in 3.2. However, the keystroke will
> activate and select the tool, not just put focus on the button.
>
> You could add a KeyListener to the Canvas and try to do this yourself.
>
> "WojT" <wjancz@\/\/asko.pl(change \/\/ with w)> wrote in message
> news:dagalv$t4d$1@news.eclipse.org...
>> Hi.
>> Is there any way to select an entry from palette by pressing key?
>> I would like to select or mark entry which starts by the letter I
>> pressed.
>> For example:
>> Palete_group_1:
>> entry_1;
>> second_entry;
>> zzz_entry;
>>
>> By activating Palete_group_1 and pressing 's' i would like GEF to scroll
>> entry list and select "second_entry" entry.
>> It is usefull when there is long list of entries and I need to select
>> entry which is on the end of the list. Because sometimes I need to click
>> many times to scroll to the end of list.
>>
>> ..::WojT::..
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04689 seconds