|
|
|
|
|
|
Re: Has anyone used a workspace in thier RCP app? [message #448670 is a reply to message #448601] |
Thu, 27 April 2006 18:46 |
|
Martin Holmes wrote:
> I have just been checking out the Mail RCP template I see no obvious
> references either declaratively or programmatically to workspaces.
>
> If anyone knows of an example RCP that does I would be grateful! (apart from
> the ide! :).
>
As I found out in another thread, it wasn't available in the mail
template :-) Sorry.
So I have an RCP app based on the mail app template, and I use a
workspace. AFAIK, to use a workspace you just have to depend on
org.eclipse.core.resources.
Then something like this should work:
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject proj = root.getProject("org.example.project");
if (!proj.exists()) {
proj.create(null);
}
if (!proj.isOpen()) {
proj.open(null);
}
Depending on how you start up eclipse, you might have to put some
options in your .ini file, like
osgi.instance.area.default=@user.home/myRcpApp
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
Powered by
FUDForum. Page generated in 0.25611 seconds