Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Custom Flash Widget(problems creating or including custom widget)
Custom Flash Widget [message #534257] Tue, 18 May 2010 13:57 Go to next message
Danny Venier is currently offline Danny VenierFriend
Messages: 2
Registered: May 2010
Junior Member
I'm new to RAP and I'm attempting to build some custom flash widgets, but objective 1 is building just a basic custom widget. I think there is great potential here in combining RAP and Flash.

I have read the Eclipse Help/RAP Developer Guide/Advanced Topics/Custom Widgets and the example there has been very useful in getting me to point where I have the bare bones of a widget but because there is no full example code, I'm missing a few key details, and there doesn't seem to be enough user community out there doing custom widgets yet to have enough examples to get me going.

I built a custom widget inside it's own project. As in the example, I created a new plug-in project based or target Eclipse 3.5 and unchecked the options to generate an activator or include UI components, and didn't select a template. Then I used a simple example widget following the flow of the developer guide.

I built a "wrapper" project that will incorporate the widget. It was based on the RAP view template and added the widget to the view.

The first confusion I have is about generating the widget plug-in jar and secondly adding it's dependency to the wrapper project. The widget project didn't have a launch script automagically generated, I'm assuming because I didn't use a template on project creation. However, to generate the jar I used the manifest editor overview tab where you can "Export the plug-in in a format suitable for deployment using the Export Wizard". This successully generated the widget jar...I think, in which I had a ComboWidget that I wanted added to the view.

Without reference to the ComboWidget, and without adding the dependency to that jar that I exported from the widget project, the wrapper application ran fine, as it should since it was reduced to just the view template project. When the ComboWidget was included and dependency was added for the widget plugin, I got a "Missing Constraint" exception as shown below.

One more thing, on the manifest dependencies tab, there was no way to browse to or reference that widget jar I created - it only saw the plugins from the target. So to add it as a dependency, I used the package explorer, right clicked on plug-in dependencies, selected import and then was able to browse to the jar in the other project folder where I exported it. It shows up in the dependency list on the manifest but I had to reference it that way. My manifest dependency list is:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: RapViewTest1
Bundle-SymbolicName: RapViewTest1; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: rapviewtest1.Activator
Bundle-Vendor: e-val Software Corporation
Require-Bundle: org.eclipse.rap.ui,
ca.eval.rap.demos.flexwidgetdemo;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Import-Package: javax.servlet;version="2.4.0",
javax.servlet.http;version="2.4.0"

Am I building the widget jar correctly or should I be creating a build/launch script. How do I successfully add the widget to the wrapper project? The way I did it, code-assist sees the widget class inside the jar and lets me use it in my view, but still I get a missing constraint problem. Why can't I add it through the manifest editor?
.....what am I doing wrong?
Thanks,


--Danny

!ENTRY RapViewTest1 4 0 2010-05-18 08:35:02.187
!MESSAGE
!STACK 0
org.osgi.framework.BundleException: The bundle "RapViewTest1_1.0.0.qualifier [39]" could not be resolved. Reason: Missing Constraint: Require-Bundle: ca.eval.rap.demos.flexwidgetdemo; bundle-version="1.0.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getR esolverError(AbstractBundle.java:1317)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getR esolutionFailureException(AbstractBundle.java:1301)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:319)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:374)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1073)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:561)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:546)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.i ncFWSL(StartLevelManager.java:459)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.d oSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.d ispatchEvent(StartLevelManager.java:440)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread .run(EventManager.java:337)

!ENTRY org.eclipse.osgi 4 0 2010-05-18 08:35:02.250
!MESSAGE Bundle initial@reference:file:../../Documents and Settings/Danny/workspaceRAP2/RapViewTest1/ was not resolved.
Re: Custom Flash Widget [message #534769 is a reply to message #534257] Thu, 20 May 2010 09:24 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Danny,

welcome to RAP! Find my comments below:

Danny Venier wrote:
> I'm new to RAP and I'm attempting to build some custom flash widgets,
> but objective 1 is building just a basic custom widget. I think there
> is great potential here in combining RAP and Flash.
>
> I have read the Eclipse Help/RAP Developer Guide/Advanced Topics/Custom
> Widgets and the example there has been very useful in getting me to
> point where I have the bare bones of a widget but because there is no
> full example code, I'm missing a few key details, and there doesn't seem
> to be enough user community out there doing custom widgets yet to have
> enough examples to get me going.

There is an example project in our sandbox CVS:
dev.eclipse.org/cvsroot/rt/org.eclipse.rap/sandbox/org.eclip se.rap.demo.gmaps
We'll refer to this project in the next version of the Custom Widgets
tutorial.

> I built a custom widget inside it's own project. As in the example, I
> created a new plug-in project based or target Eclipse 3.5 and unchecked
> the options to generate an activator or include UI components, and
> didn't select a template. Then I used a simple example widget following
> the flow of the developer guide.
>
> I built a "wrapper" project that will incorporate the widget. It was
> based on the RAP view template and added the widget to the view.

Ok, fine. So you have two new plug-in projects, one that provides the
custom widget and one that uses it.

> The first confusion I have is about generating the widget plug-in jar
> and secondly adding it's dependency to the wrapper project. The widget
> project didn't have a launch script automagically generated, I'm
> assuming because I didn't use a template on project creation. However,
> to generate the jar I used the manifest editor overview tab where you
> can "Export the plug-in in a format suitable for deployment using the
> Export Wizard". This successully generated the widget jar...I think, in
> which I had a ComboWidget that I wanted added to the view.

As long as you launch your custom widget example from the IDE, you don't
have to export anything. Just include both new projects in your existing
launch configuration Run -> Run Configurations ... (Bundles tab).

> Without reference to the ComboWidget, and without adding the dependency
> to that jar that I exported from the widget project, the wrapper
> application ran fine, as it should since it was reduced to just the view
> template project. When the ComboWidget was included and dependency was
> added for the widget plugin, I got a "Missing Constraint" exception as
> shown below.

Your custom widget plug-in (the one that provides the custom widget)
will depend on org.eclipse.rap.rwt. The plug-in that uses it, must of
course depend on the custom widget plug-in. Take the gmaps example from
the sandbox as an example.

> One more thing, on the manifest dependencies tab, there was no way to
> browse to or reference that widget jar I created - it only saw the
> plugins from the target. So to add it as a dependency, I used the
> package explorer, right clicked on plug-in dependencies, selected import
> and then was able to browse to the jar in the other project folder where
> I exported it. It shows up in the dependency list on the manifest but I
> had to reference it that way. My manifest dependency list is:

You should not add dependencies to jars but to either plug-in projects
in you workspace or bundles in your target platform.

Hope this helps,
Re: Custom Flash Widget [message #537467 is a reply to message #534257] Wed, 02 June 2010 14:43 Go to previous message
Danny Venier is currently offline Danny VenierFriend
Messages: 2
Registered: May 2010
Junior Member
Ralf,

thanks very much for your feedback. It allowed me to quickly overcome that particular problem, which happened to be a runtime problem because I hadn't referenced a bundle in my bundles tab of my run configuration.

After that I did get some exceptions, and I've seen some related posts about use Composite in 1.3 but I have had other priorities so I have not gotten down to resolving it.

cheers,
Danny
Previous Topic:Animations
Next Topic:UICallback does not work on Mac OS X?
Goto Forum:
  


Current Time: Wed Dec 01 04:20:47 GMT 2021

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

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

Back to the top