how to move focus between two views with tab key press [message #460818] |
Thu, 08 September 2005 05:49 |
Eclipse User |
|
|
|
Originally posted by: sendtanmoy.yahoo.co.in
in a perspective i have 2 views, one in the left and the other in the right.
the left view contains different text boxes and the right view displays pdf documents.
i want to move focus from the left view to the right view (displaying pdfs) by key press (tab key).
Kindly help me to implement it.
|
|
|
|
Re: how to move focus between two views with tab key press [message #460865 is a reply to message #460834] |
Fri, 09 September 2005 05:06 |
Eclipse User |
|
|
|
Originally posted by: tanmoy.chakraborty.gmail.com
i tried to attach both traverseListener or keyListener(to catch key events) with the tabfolder.
the code is used is something like this:
for traverseListener (i was trying to move between two views with tab key press),
tabfolder.addTraverseListener(new TraverseListener () {
public void keyTraversed(TraverseEvent e) {
if(e.character == SWT.TAB) {
{
-- action
}}}});
and for keyListener (i was trying to move between different tab menus with key press) :
tabfolder.addKeyListener(new KeyAdapter(){
public void keyPressed(KeyEvent e){
switch(e.keyCode){
case SWT.F2:
tabfolder.setSelection(0);
break;
case SWT.F3:
tabfolder.setSelection(1);
break;
case SWT.F4:
tabfolder.setSelection(2);
break;
}}});
but i am not able to catch the key events in the tab folder.
kindly help to correct my error.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04977 seconds