Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » accept key input in Composite Editor Part.
accept key input in Composite Editor Part. [message #172585] Mon, 09 August 2004 23:52 Go to next message
Eclipse UserFriend
Originally posted by: tanut.sanuk.biz

I do visual editor for UI. Now I want it to delete component by DEL key...
But after I add keyListener ...

comp.addKeyListener(new KeyListener(){

public void keyPressed(KeyEvent e) {
System.out.println("Key press");
}

public void keyReleased(KeyEvent e) {
System.out.println("Key Release");
}
});

comp is Composite that had been create in createPartControl() by

Composite comp = new Composite(parent, SWT.NONE);

So I wonder why it not work

ps.
- My editor is all graphic interface
- Mouse event is accept
- When I open another java editor the focus of text cursor will not in
my editor.. It alway focus in soonly another actived editor/view

Thank you very much..

Tanut Apiwong.
Re: accept key input in Composite Editor Part. [message #172593 is a reply to message #172585] Tue, 10 August 2004 00:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tanut.sanuk.biz

I found the problem! :)
solved by make comp to has focus..
comp.setFocus();



"Tanut Apiwong" <tanut@sanuk.biz> wrote in message
news:cf9glb$epl$1@eclipse.org...
> I do visual editor for UI. Now I want it to delete component by DEL key...
> But after I add keyListener ...
>
> comp.addKeyListener(new KeyListener(){
>
> public void keyPressed(KeyEvent e) {
> System.out.println("Key press");
> }
>
> public void keyReleased(KeyEvent e) {
> System.out.println("Key Release");
> }
> });
>
> comp is Composite that had been create in createPartControl() by
>
> Composite comp = new Composite(parent, SWT.NONE);
>
> So I wonder why it not work
>
> ps.
> - My editor is all graphic interface
> - Mouse event is accept
> - When I open another java editor the focus of text cursor will not in
> my editor.. It alway focus in soonly another actived editor/view
>
> Thank you very much..
>
> Tanut Apiwong.
>
>
>
>
>
Re: accept key input in Composite Editor Part. [message #172601 is a reply to message #172593] Tue, 10 August 2004 00:30 Go to previous message
Eclipse UserFriend
Originally posted by: tanut.sanuk.biz

another problem -_-''
when I use Composite to accept key input for editor, it alway lost focus
when I click to another widgets and can't force to set focus back to
Composite.

What kind of Object that I should add its KeyListener?
Shell, Composite, EditorPart or ...

Thank you

------------------------------------

"Tanut Apiwong" <tanut@sanuk.biz> wrote in message
news:cf9hlv$fts$1@eclipse.org...
> I found the problem! :)
> solved by make comp to has focus..
> comp.setFocus();
>
>
>
> "Tanut Apiwong" <tanut@sanuk.biz> wrote in message
> news:cf9glb$epl$1@eclipse.org...
> > I do visual editor for UI. Now I want it to delete component by DEL
key...
> > But after I add keyListener ...
> >
> > comp.addKeyListener(new KeyListener(){
> >
> > public void keyPressed(KeyEvent e) {
> > System.out.println("Key press");
> > }
> >
> > public void keyReleased(KeyEvent e) {
> > System.out.println("Key Release");
> > }
> > });
> >
> > comp is Composite that had been create in createPartControl() by
> >
> > Composite comp = new Composite(parent, SWT.NONE);
> >
> > So I wonder why it not work
> >
> > ps.
> > - My editor is all graphic interface
> > - Mouse event is accept
> > - When I open another java editor the focus of text cursor will not
in
> > my editor.. It alway focus in soonly another actived editor/view
> >
> > Thank you very much..
> >
> > Tanut Apiwong.
> >
> >
> >
> >
> >
>
>
Previous Topic:searchAllTypeNames(..) no longer working in Eclipse 3
Next Topic:Multiple duplicate entries in plugin classloader, bug?
Goto Forum:
  


Current Time: Sun Jul 20 16:51:42 EDT 2025

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

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

Back to the top