Using commands without eclipse.ui plugin. [message #313177] |
Tue, 06 March 2007 06:51  |
Eclipse User |
|
|
|
Hello,
I'm building a JFace based application (not a full-blown RCP) and I want
to use the declarative commands.
I know that the API for command support resides in
org.eclipse.core.runtime, but commands extension point is in
org.eclipse.ui, which I do not want to use.
What is the recommended way of registering commands declaratively
without requiring org.eclipse.ui plug-in?
--
Roland Tepp
|
|
|
|
Re: Using commands without eclipse.ui plugin. [message #313756 is a reply to message #313177] |
Mon, 26 March 2007 09:18  |
Eclipse User |
|
|
|
Roland Tepp wrote:
> Hello,
>
> I'm building a JFace based application (not a full-blown RCP) and I want
> to use the declarative commands.
>
> I know that the API for command support resides in
> org.eclipse.core.runtime, but commands extension point is in
> org.eclipse.ui, which I do not want to use.
>
> What is the recommended way of registering commands declaratively
> without requiring org.eclipse.ui plug-in?
>
It's theoretically possible to use at least part of the command
framework outside of eclipse ... most of the command stuff is in
org.eclipse.core.commands, which only depends on
org.eclipse.equinox.common. They should both be able to be run outside
of eclipse (just like JFace). Also, the keybinding stuff is in JFace.
What you get from org.eclipse.ui is the extension points to read in all
of the declarative stuff, and the code that hooks it all up together:
1) read in all of the commands and create them in the CommandManager
2) read in all of the handlers and hold on to them
3) evaluate core expressions, and determine which IHandler the Command
should execute.
4) read in all of the bindings, and populate the BindingManager
If you're in a JFace app, can you use the extension registry outside of
eclipse? That would be one hurdle. If not, you could write your own
XML parser. When you read your XML, you would populate the
CommandManager (and BindingManager if you wanted keybindings). Then you
would have to write the code that decided which IHandler was currently
working for which Command, and set it (there's actually a pattern around
setting handlers, but it may or may not be to complicated for what you
are trying to do).
Basically some of the command framework parts are available to you, but
the code that hooks them all together is not. If you're still
considering it, ask some more questions :-)
PW
|
|
|
Powered by
FUDForum. Page generated in 0.03162 seconds