Modifying the SWT through an external bundle [message #65685] |
Mon, 01 May 2006 12:49 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jaco.magicmail.co.za
Hi All
I've recently started investigating OSGi and RCP and I'm having some
trouble doing what I'm trying to do. I'm fairly new to all of this, so if
I'm on the wrong track please let me know.
I'm trying to extend the RCP Mail Template in order to dynamically add
Views as new bundles are deployed on Equinox. What I want to do is to run
my product with 'java -jar startup.jar -console', which will bring up the
SWT and then through installing and starting my own custom bundle (from
the console), add a new message View as if I clicked on the green 'plus'
sign.
What I did thus far is to create and register a service for my RCP bundle
called AddWindowService which makes use of the interface
IAddWindowService. In my manifest I exported the package containing
IAddWindowService and on load I registered the service with my
AbstractUIPlugin class. I then created my own Bundle with an Activator
class which retrieves that service and calls a method on it to create a
new view.
So far so good, when I startup Equinox it successfully loads my RCP plugin
and registers the service. When I install my custom bundle it manages to
resolve successfully. However, when I try and start my bundle I receive
the following exception:
org.eclipse.swt.SWTException: Invalid threat access
I read up on that exception and it has to do with only a single Display
being allowed to modify the UI etc. - but I have no idea how to bypass
that constraint. Here's the method inside my service which tries to create
a new View:
public void createView()
{
if(window != null)
{
try
{
window.getActivePage().showView(View.ID, "1",
IWorkbenchPage.VIEW_ACTIVATE);
}
catch (PartInitException e)
{
MessageDialog.openError(window.getShell(), "Error", "Error
opening view:" + e.getMessage());
}
}
}
Also, I've read up on extension points and it seems somewhat relevant, but
as I understand it extension points are only for modifying existing
plugins and/or the Eclipse IDE by outside developers. Can extension points
be applied to do what I require for my RCP and if so how?
Thank you
Jaco
|
|
|
Re: Modifying the SWT through an external bundle [message #65888 is a reply to message #65685] |
Tue, 02 May 2006 07:06 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jaco.notchecked.com
I've managed to get past my first problem with:
Display.getDefault().syncExec()
But now I need a way to display new Views supplied by the external bundle.
I've modified the service to accept an object of type ViewPart, but I'm
not sure how to add that view as an extension. Should I use an extension
point for this?
Can someone point me to a good tutorial or help document?
Thank you
|
|
|
Re: Modifying the SWT through an external bundle [message #66721 is a reply to message #65888] |
Sun, 14 May 2006 03:54 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com
You should try the eclipse.platform or eclipse.platform.rcp newsgroups
for this kind of question.
Jeff
Jaco wrote:
> I've managed to get past my first problem with:
>
> Display.getDefault().syncExec()
>
> But now I need a way to display new Views supplied by the external bundle.
> I've modified the service to accept an object of type ViewPart, but I'm
> not sure how to add that view as an extension. Should I use an extension
> point for this?
> Can someone point me to a good tutorial or help document?
>
> Thank you
>
|
|
|
Powered by
FUDForum. Page generated in 0.03672 seconds