Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to call forward / back manually?
How to call forward / back manually? [message #303402] Mon, 15 May 2006 08:01 Go to next message
Eclipse UserFriend
How can I call forward and back actions manually from code? I want to
create my own buttons for those actions into a view and all I want is to
forward the action handling to the eclipse platform. I just can't seem
to find proper places in API to do this.

Thanks.
-Pasi
Re: How to call forward / back manually? [message #303413 is a reply to message #303402] Mon, 15 May 2006 09:28 Go to previous messageGo to next message
Eclipse UserFriend
It's good if you can find the commands for these actions, usually by
command ID.


In 3.2:
ICommandService service=getSite().getService(ICommandService.class);
Command cmd = service.getCommand(FORWARD_ID).
if (cmd.isDefined()) {
cmd.executeWithChecks(new ExecutionEvent());
}

In 3.1.2, you can get the ICommandService from IWorkbench, either
getService() or getAdapter().

As for finding the ID, you can search through the Plug-in Registry view
or import binary plugins with linked content and search through the
plugin.xml yourself. The extension is org.eclipse.ui.commands

Later,
PW
Re: How to call forward / back manually? [message #303463 is a reply to message #303413] Tue, 16 May 2006 04:28 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Paul.
I got it working using "org.eclipse.ui.navigate.backwardHistory" as back
and "org.eclipse.ui.navigate.forwardHistory" as forward. But I wasn't
able to find any constants for those.

Paul Webster wrote:
> It's good if you can find the commands for these actions, usually by
> command ID.
>
>
> In 3.2:
> ICommandService service=getSite().getService(ICommandService.class);
> Command cmd = service.getCommand(FORWARD_ID).
> if (cmd.isDefined()) {
> cmd.executeWithChecks(new ExecutionEvent());
> }
>
> In 3.1.2, you can get the ICommandService from IWorkbench, either
> getService() or getAdapter().
>
> As for finding the ID, you can search through the Plug-in Registry view
> or import binary plugins with linked content and search through the
> plugin.xml yourself. The extension is org.eclipse.ui.commands
>
> Later,
> PW
Re: How to call forward / back manually? [message #303473 is a reply to message #303463] Tue, 16 May 2006 07:12 Go to previous message
Eclipse UserFriend
Pasi Lehtimaki wrote:
> Thanks Paul.
> I got it working using "org.eclipse.ui.navigate.backwardHistory" as back
> and "org.eclipse.ui.navigate.forwardHistory" as forward. But I wasn't
> able to find any constants for those.

That's OK, often there are no constants for actions that weren't
specifically designed to be used by client code.

Later,
PW
Previous Topic:Classpath: JUnit tests in Plugins
Next Topic:Frame Embedded using SWT_AWT
Goto Forum:
  


Current Time: Sat Jun 07 15:56:47 EDT 2025

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

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

Back to the top