|
Re: Newbie: Jface and Actions [message #439863 is a reply to message #439858] |
Mon, 19 July 2004 09:33 |
Eclipse User |
|
|
|
Originally posted by: bram.eresmas.net
Hello,
I'm not an expert , but I would say that u have to add a SelectionListener
to the button and implement the method mouseDown. There u can place ur
Action. I'm not sure, but I think u can call the method run () of the
Action, and then, everytime that u call the mouseDown method, the run() of
the action will be performed.
Have a nice day
bram
/**************************/
exquisitus wrote:
> How can I add an action to a button? I know, I can do it with menues, for
> example:
> myAction = new MyAction();
> MenuManager mm = new MenuManager();
> MenuManager fileMenu = new MenuManager("File");
> mm.add(fileMenu);
> fileMenu.add(myAction);
> Can I do something similiar with a simple push button?
> Help is appreciated!
> -J
|
|
|
Re: Newbie: Jface and Actions [message #439865 is a reply to message #439863] |
Mon, 19 July 2004 09:46 |
exquisitus Messages: 211 Registered: July 2009 |
Senior Member |
|
|
Hi,
Calling myAction.run() was what I missed.
Thanks for your help!
-Joachim
Abraham wrote:
> Hello,
> I'm not an expert , but I would say that u have to add a SelectionListener
> to the button and implement the method mouseDown. There u can place ur
> Action. I'm not sure, but I think u can call the method run () of the
> Action, and then, everytime that u call the mouseDown method, the run() of
> the action will be performed.
> Have a nice day
> bram
> /**************************/
> exquisitus wrote:
> > How can I add an action to a button? I know, I can do it with menues, for
> > example:
> > myAction = new MyAction();
> > MenuManager mm = new MenuManager();
> > MenuManager fileMenu = new MenuManager("File");
> > mm.add(fileMenu);
> > fileMenu.add(myAction);
> > Can I do something similiar with a simple push button?
> > Help is appreciated!
> > -J
|
|
|
Powered by
FUDForum. Page generated in 0.03799 seconds