Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Dynamic extension of Perspective from other Bundles(Trying to extend my Application through perspectiveExstension, Doesn't work, error: unable to load class)
icon5.gif  Dynamic extension of Perspective from other Bundles [message #487485] Wed, 23 September 2009 12:13 Go to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Hello Eclipse Community!

I am working on an RCP application which perspective must be extended through views which are coming from other Plugins. This should happen while the apllication is running on the fly. If I install a plugin through the console, the view extension should show up in my apllication. If I uninstall it, it should go away.

I tried it with the perspectiveExtension extension point by following that example: http://www.eclipsezone.com/eclipse/forums/t53312.html

So, my main apllication has only one perspective. Inside is folder with a certain ID. My view is coming from antoher plug-in. This plugin provides an extension to an view and to an perspective extension point.

So far so good.

When I start my application and manually install and start the bundle with that view, I get asked to reset the perspektive. Then the view shows up. Bur there a re two problems.

1. I get an error inside the view. The class for the view could not be loaded.
2. The view is not shown inside the folder. Its shown below the folder part. (see picture) I also get an Warning in the plugin.xml, that the id of the relative (the folder id) could not be resolved. How could I make that ID visible? There are not extension points for folders.

Anybody have an idea how to fix it and get it running?

Best Regards
Eduard

PS:
http://www.wartower.de/rcp.jpg
Code of the Perspective:
public class Perspective implements IPerspectiveFactory{

	public static final String FOLDER_ID = "org.wt.test.perspective.folder";

	public void createInitialLayout(IPageLayout layout) {

        layout.setFixed( false );
        layout.setEditorAreaVisible(false);
		layout.createFolder(FOLDER_ID, IPageLayout.TOP, 0.5f,
				IPageLayout.ID_EDITOR_AREA);

		
	}
}


The plugin.xml of the bundle with the View:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.ui.views">
      <view
            allowMultiple="false"
            class="org.wt.test.im.extension.ViewIM"
            id="org.wt.test.im.extension.viewIM"
            name="IM"
            restorable="true">
      </view>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="org.wt.test.perspective">
         <view
               id="org.wt.test.im.extension.viewIM"
               relationship="stack"
               relative="org.wt.test.perspective.folder">
         </view>
      </perspectiveExtension>
   </extension>

</plugin>

[Updated on: Wed, 23 September 2009 12:15]

Report message to a moderator

Re: Dynamic extension of Perspective from other Bundles [message #487504 is a reply to message #487485] Wed, 23 September 2009 13:18 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Your error says there's something wrong with your view definition itself ... i.e. the id and class doesn't match, because it says that your plugin cannot load "org.wt.test.im.extension.ViewIM"

As for the other, perspectiveExtension doesn't work with a folder, only with a known view. i.e. you must have at least one view in the folder before you can stack another view on top of it.

PW


Re: Dynamic extension of Perspective from other Bundles [message #487514 is a reply to message #487504] Wed, 23 September 2009 13:40 Go to previous messageGo to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Paul Webster wrote on Wed, 23 September 2009 09:18
Your error says there's something wrong with your view definition itself ... i.e. the id and class doesn't match, because it says that your plugin cannot load "org.wt.test.im.extension.ViewIM"

As for the other, perspectiveExtension doesn't work with a folder, only with a known view. i.e. you must have at least one view in the folder before you can stack another view on top of it.

PW



Ok, the second problem makes sense.

In the first problem, I still don't see the problem. The defenition in the plugin for the view is fine. The plugin.xml was created automaticly and used only the PDE Manifest-Editor to configure the view extension.

class="org.wt.test.im.extension.ViewIM"

The class for the view is in the package wt.test.im.extension named ViewIM.class.

The bundles name is "org.wt.test.im.extension".

And the ID of the extension is also fine. It's "org.wt.test.im.extension.viewIM".

So, what should be wrong? Confused
Re: Dynamic extension of Perspective from other Bundles [message #487785 is a reply to message #487514] Thu, 24 September 2009 12:29 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

What code are you using to install your bundle? Are you using PackageAdmin to refresh your packages? I'm not sure if that effects this issue.

PW


Re: Dynamic extension of Perspective from other Bundles [message #487786 is a reply to message #487514] Thu, 24 September 2009 12:31 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The other test is to bring up a self-hosted eclipse with your plugins, and try and open your view using Window>Show view>Other.

PW


Re: Dynamic extension of Perspective from other Bundles [message #487839 is a reply to message #487485] Thu, 24 September 2009 14:35 Go to previous message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Ok I found the problem with the class not found exception.

My bundles are all im project directories and are not packed to .jar files like bundles usually are. For some reason the class loeader could not find the classes, although the bundle was successfuly installed through the OSGi console ('install "file:/D:\Programmierung\RCP + RAP\Projekte\vs.instantx.gui.im.extension" start').

In my run configuration I added "-dev bin" to my program arguments and now everything works fine. I install a bundle it appears. On deinstallation it disappears without any restart. Like I waned it Smile!

But when a view is installed with an contribution to my perspective in the main app, I get an promt window which asks me to reset my persepektive (yes or no). Is there a possibiliy to subress this window and just accept it automatically?

http://www.wartower.de/reset.gif

Best reagrds
Eduard

[Updated on: Thu, 24 September 2009 14:37]

Report message to a moderator

Previous Topic:life cycle of RCP app?
Next Topic:Weird linkage error
Goto Forum:
  


Current Time: Sat Dec 20 19:39:38 GMT 2014

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

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