Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selecting palette entry using keys.
Selecting palette entry using keys. [message #186652] Wed, 06 July 2005 10:10 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Dazhen Gao is currently offline Dazhen GaoFriend
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::..
>>
>
>
Previous Topic:Changes since 3.0
Next Topic:Auto-Sizing Thumbnails
Goto Forum:
  


Current Time: Mon Sep 23 23:39:46 GMT 2024

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

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

Back to the top