You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Manoj Kumar S <m4...@gmail.com> on 2009/10/08 08:50:02 UTC

Use pivot in Eclipse RCP

Hi,

Was trying to use pivot in an Eclipse RCP application.  When I try to
instantiate any object (like Label) within a view, i get a run time
exception of NoClassDefenition found.

Any one has tried this before?  Any examples?

Appreciate your help.

Thanks,
-Manoj.

Re: Use pivot in Eclipse RCP

Posted by Greg Brown <gk...@mac.com>.
I'm not terribly familiar with SWT, but that all seems reasonable.  
Given the generated Frame instance, you'll need to add an instance of  
ApplicationContext.DisplayHost to it (be sure the frame is using a  
layout manager that will size it to fit; e.g. BorderLayout). Then you  
will need to ensure that your Pivot Application instance is properly  
instantiated, and that startup() and shutdown() are called on it as  
needed. Let us know how it goes.

Greg

On Oct 13, 2009, at 4:19 AM, Manoj Kumar S wrote:

> Hi Greg,
>
> Well, we are trying to enable pivot to be used within the Eclipse  
> RCP context so that same code can work across UI screens (desktop/ 
> browser/eclipse).
>
> Thanks for the info.  We've done the following:
> Created a copy of DesktopApplicationContext as RCPApplicationContext
> Pass the Eclipse's Composite parent object reference to  
> RCPApplicationContext
> When the windowedHostFrame is getting instantiated, we instantiate  
> it via the SWT_AWT bridge as below:
> windowedHostFrame = (Frame) SWT_AWT.new_Frame( p );
> Now, because the SWT_AWT.new_Frame returns a Frame object, we cant  
> typecast it to HostFrame, that's why we had to make the HostFrame as  
> Frame
> After this, We are able to render the frame within the eclipse RCP  
> view context, however we get a blank frame without any objects  
> getting rendered.
> We are trying to understand how the SWT Display gets attached to the  
> frame.  Are we missing anything else? Any help is appreciated.
>
> Thanks,
> -Manoj.
>
>
>
>
> On Fri, Oct 9, 2009 at 7:28 PM, Greg Brown <gk...@mac.com> wrote:
> It is theoretically possible, but it is not something we currently  
> support. You will most likely need to create a custom subclass of  
> ApplicationContext that uses the AWT/SWT bridge to host the  
> context's DisplayHost in the SWT Composite.
>
> Out of curiosity, what is the use case you are trying to address?
>
> Greg
>
> On Oct 9, 2009, at 9:41 AM, Manoj Kumar S wrote:
>
>> Thanks  for the pointer.  I was able to integrate pivot jars into  
>> the RCP.
>> Now the next step i was trying is to render the labels,text, etc  
>> onto the eclipse view.
>>
>> For swt we use the Composite object to render.
>> Eg:
>> Composite parent;
>> label l = new label(parent, SWT.WRAP);
>> l.setText("Test Label");
>>
>> Was wondering if its possible to render the pivot label object onto  
>> the RCP's Composite parent object?
>>
>> Thanks,
>> -Manoj.
>>
>>
>>
>>
>> On Thu, Oct 8, 2009 at 8:58 PM, Noel Grandin  
>> <no...@gmail.com> wrote:
>>
>> With Eclipse RCP, you're operating in a plugin (OSGi-type)  
>> environment, so you'll probably need to configure something in the  
>> manifest or one of the plugin declaration files.
>>
>> There should be a tutorial somewhere about integrating third-party  
>> jars.
>>
>> -- Noel.
>>
>>
>> Manoj Kumar S wrote:
>>>
>>> Thanks for the reply.  I do have all the jars in the build path  
>>> already.  Still it never works.
>>>
>>> Thanks,
>>> -Manoj.
>>>
>>>
>>>
>>>
>>> On Thu, Oct 8, 2009 at 7:44 PM, Greg Brown <gk...@mac.com> wrote:
>>>
>>> Sounds like you need to make sure the Pivot JARs are on your  
>>> classpath.
>>>
>>> However, you are somewhat in uncharted waters. Pivot is based on  
>>> AWT and Java2D, whereas Eclipse uses SWT. You may need to use the  
>>> AWT/SWT bridge to accomplish what you are trying to do. This is  
>>> not something we have tested, so you may run into issues that we  
>>> are not aware of and may not be able to resolve.
>>>
>>> But please let us know how it goes. Others may be able to share  
>>> some experience that may help, and we will try to be of assistance  
>>> if we can.
>>>
>>> Greg
>>>
>>>
>>> On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4manoj@gmail.com 
>>> > wrote:
>>> >
>>> Hi,
>>>
>>> Was trying to use pivot in an Eclipse RCP application.  When I try  
>>> to instantiate any object (like Label) within a view, i get a run  
>>> time exception of NoClassDefenition found.
>>>
>>> Any one has tried this before?  Any examples?
>>>
>>> Appreciate your help.
>>>
>>> Thanks,
>>> -Manoj.
>>>
>>
>>
>
>


Re: Use pivot in Eclipse RCP

Posted by Manoj Kumar S <m4...@gmail.com>.
Hi Greg,

Well, we are trying to enable pivot to be used within the Eclipse RCP
context so that same code can work across UI screens
(desktop/browser/eclipse).

Thanks for the info.  We've done the following:

   1. Created a copy of DesktopApplicationContext as RCPApplicationContext
   2. Pass the Eclipse's Composite parent object reference to
   RCPApplicationContext
   3. When the windowedHostFrame is getting instantiated, we instantiate it
   via the SWT_AWT bridge as below:
   4. windowedHostFrame = (Frame) SWT_AWT.new_Frame( p );
   5. Now, because the SWT_AWT.new_Frame returns a Frame object, we cant
   typecast it to HostFrame, that's why we had to make the HostFrame as Frame
   6. After this, We are able to render the frame within the eclipse RCP
   view context, however we get a blank frame without any objects getting
   rendered.

We are trying to understand how the SWT Display gets attached to the frame.
Are we missing anything else? Any help is appreciated.

Thanks,
-Manoj.




On Fri, Oct 9, 2009 at 7:28 PM, Greg Brown <gk...@mac.com> wrote:

> It is theoretically possible, but it is not something we currently support.
> You will most likely need to create a custom subclass of ApplicationContext
> that uses the AWT/SWT bridge to host the context's DisplayHost in the SWT
> Composite.
>
> Out of curiosity, what is the use case you are trying to address?
>
> Greg
>
> On Oct 9, 2009, at 9:41 AM, Manoj Kumar S wrote:
>
> Thanks  for the pointer.  I was able to integrate pivot jars into the RCP.
> Now the next step i was trying is to render the labels,text, etc onto the
> eclipse view.
>
> For swt we use the Composite object to render.
> Eg:
> Composite parent;
> label l = new label(parent, SWT.WRAP);
> l.setText("Test Label");
>
> Was wondering if its possible to render the pivot label object onto the
> RCP's Composite parent object?
>
> Thanks,
> -Manoj.
>
>
>
>
> On Thu, Oct 8, 2009 at 8:58 PM, Noel Grandin <no...@gmail.com>wrote:
>
>>
>> With Eclipse RCP, you're operating in a plugin (OSGi-type) environment, so
>> you'll probably need to configure something in the manifest or one of the
>> plugin declaration files.
>>
>> There should be a tutorial somewhere about integrating third-party jars.
>>
>> -- Noel.
>>
>>
>> Manoj Kumar S wrote:
>>
>> Thanks for the reply.  I do have all the jars in the build path already.
>> Still it never works.
>>
>> Thanks,
>> -Manoj.
>>
>>
>>
>>
>> On Thu, Oct 8, 2009 at 7:44 PM, Greg Brown <gk...@mac.com> wrote:
>>
>>>
>>> Sounds like you need to make sure the Pivot JARs are on your classpath.
>>>
>>> However, you are somewhat in uncharted waters. Pivot is based on AWT and Java2D, whereas Eclipse uses SWT. You may need to use the AWT/SWT bridge to accomplish what you are trying to do. This is not something we have tested, so you may run into issues that we are not aware of and may not be able to resolve.
>>>
>>> But please let us know how it goes. Others may be able to share some experience that may help, and we will try to be of assistance if we can.
>>>
>>> Greg
>>>
>>>
>>> On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4...@gmail.com> wrote:
>>> >
>>>
>>>   Hi,
>>>
>>> Was trying to use pivot in an Eclipse RCP application.  When I try to
>>> instantiate any object (like Label) within a view, i get a run time
>>> exception of NoClassDefenition found.
>>>
>>> Any one has tried this before?  Any examples?
>>>
>>> Appreciate your help.
>>>
>>> Thanks,
>>> -Manoj.
>>>
>>
>>
>>
>
>

Re: Use pivot in Eclipse RCP

Posted by Greg Brown <gk...@mac.com>.
It is theoretically possible, but it is not something we currently  
support. You will most likely need to create a custom subclass of  
ApplicationContext that uses the AWT/SWT bridge to host the context's  
DisplayHost in the SWT Composite.

Out of curiosity, what is the use case you are trying to address?

Greg

On Oct 9, 2009, at 9:41 AM, Manoj Kumar S wrote:

> Thanks  for the pointer.  I was able to integrate pivot jars into  
> the RCP.
> Now the next step i was trying is to render the labels,text, etc  
> onto the eclipse view.
>
> For swt we use the Composite object to render.
> Eg:
> Composite parent;
> label l = new label(parent, SWT.WRAP);
> l.setText("Test Label");
>
> Was wondering if its possible to render the pivot label object onto  
> the RCP's Composite parent object?
>
> Thanks,
> -Manoj.
>
>
>
>
> On Thu, Oct 8, 2009 at 8:58 PM, Noel Grandin <no...@gmail.com>  
> wrote:
>
> With Eclipse RCP, you're operating in a plugin (OSGi-type)  
> environment, so you'll probably need to configure something in the  
> manifest or one of the plugin declaration files.
>
> There should be a tutorial somewhere about integrating third-party  
> jars.
>
> -- Noel.
>
>
> Manoj Kumar S wrote:
>>
>> Thanks for the reply.  I do have all the jars in the build path  
>> already.  Still it never works.
>>
>> Thanks,
>> -Manoj.
>>
>>
>>
>>
>> On Thu, Oct 8, 2009 at 7:44 PM, Greg Brown <gk...@mac.com> wrote:
>>
>> Sounds like you need to make sure the Pivot JARs are on your  
>> classpath.
>>
>> However, you are somewhat in uncharted waters. Pivot is based on  
>> AWT and Java2D, whereas Eclipse uses SWT. You may need to use the  
>> AWT/SWT bridge to accomplish what you are trying to do. This is not  
>> something we have tested, so you may run into issues that we are  
>> not aware of and may not be able to resolve.
>>
>> But please let us know how it goes. Others may be able to share  
>> some experience that may help, and we will try to be of assistance  
>> if we can.
>>
>> Greg
>>
>>
>> On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4manoj@gmail.com 
>> > wrote:
>> >
>> Hi,
>>
>> Was trying to use pivot in an Eclipse RCP application.  When I try  
>> to instantiate any object (like Label) within a view, i get a run  
>> time exception of NoClassDefenition found.
>>
>> Any one has tried this before?  Any examples?
>>
>> Appreciate your help.
>>
>> Thanks,
>> -Manoj.
>>
>
>


Re: Use pivot in Eclipse RCP

Posted by Manoj Kumar S <m4...@gmail.com>.
Thanks  for the pointer.  I was able to integrate pivot jars into the RCP.
Now the next step i was trying is to render the labels,text, etc onto the
eclipse view.

For swt we use the Composite object to render.
Eg:
Composite parent;
label l = new label(parent, SWT.WRAP);
l.setText("Test Label");

Was wondering if its possible to render the pivot label object onto the
RCP's Composite parent object?

Thanks,
-Manoj.




On Thu, Oct 8, 2009 at 8:58 PM, Noel Grandin <no...@gmail.com> wrote:

>
> With Eclipse RCP, you're operating in a plugin (OSGi-type) environment, so
> you'll probably need to configure something in the manifest or one of the
> plugin declaration files.
>
> There should be a tutorial somewhere about integrating third-party jars.
>
> -- Noel.
>
>
> Manoj Kumar S wrote:
>
> Thanks for the reply.  I do have all the jars in the build path already.
> Still it never works.
>
> Thanks,
> -Manoj.
>
>
>
>
> On Thu, Oct 8, 2009 at 7:44 PM, Greg Brown <gk...@mac.com> wrote:
>
>>
>> Sounds like you need to make sure the Pivot JARs are on your classpath.
>>
>> However, you are somewhat in uncharted waters. Pivot is based on AWT and Java2D, whereas Eclipse uses SWT. You may need to use the AWT/SWT bridge to accomplish what you are trying to do. This is not something we have tested, so you may run into issues that we are not aware of and may not be able to resolve.
>>
>> But please let us know how it goes. Others may be able to share some experience that may help, and we will try to be of assistance if we can.
>>
>> Greg
>>
>>
>> On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4...@gmail.com> wrote:
>> >
>>
>>   Hi,
>>
>> Was trying to use pivot in an Eclipse RCP application.  When I try to
>> instantiate any object (like Label) within a view, i get a run time
>> exception of NoClassDefenition found.
>>
>> Any one has tried this before?  Any examples?
>>
>> Appreciate your help.
>>
>> Thanks,
>> -Manoj.
>>
>
>
>

Re: Use pivot in Eclipse RCP

Posted by Noel Grandin <no...@gmail.com>.
With Eclipse RCP, you're operating in a plugin (OSGi-type) environment,
so you'll probably need to configure something in the manifest or one of
the plugin declaration files.

There should be a tutorial somewhere about integrating third-party jars.

-- Noel.

Manoj Kumar S wrote:
> Thanks for the reply.  I do have all the jars in the build path
> already.  Still it never works.
>
> Thanks,
> -Manoj.
>
>
>
>
> On Thu, Oct 8, 2009 at 7:44 PM, Greg Brown <gkbrown@mac.com
> <ma...@mac.com>> wrote:
>
>     Sounds like you need to make sure the Pivot JARs are on your classpath.
>
>     However, you are somewhat in uncharted waters. Pivot is based on AWT and Java2D, whereas Eclipse uses SWT. You may need to use the AWT/SWT bridge to accomplish what you are trying to do. This is not something we have tested, so you may run into issues that we are not aware of and may not be able to resolve. 
>
>     But please let us know how it goes. Others may be able to share some experience that may help, and we will try to be of assistance if we can.
>
>     Greg
>
>      
>     On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4manoj@gmail.com <ma...@gmail.com>> wrote:
>     >
>
>     Hi,
>
>     Was trying to use pivot in an Eclipse RCP application.  When I try
>     to instantiate any object (like Label) within a view, i get a run
>     time exception of NoClassDefenition found.
>
>     Any one has tried this before?  Any examples?
>
>     Appreciate your help.
>
>     Thanks,
>     -Manoj.
>
>


Re: Use pivot in Eclipse RCP

Posted by Manoj Kumar S <m4...@gmail.com>.
Thanks for the reply.  I do have all the jars in the build path already.
Still it never works.

Thanks,
-Manoj.




On Thu, Oct 8, 2009 at 7:44 PM, Greg Brown <gk...@mac.com> wrote:

>
> Sounds like you need to make sure the Pivot JARs are on your classpath.
>
> However, you are somewhat in uncharted waters. Pivot is based on AWT and Java2D, whereas Eclipse uses SWT. You may need to use the AWT/SWT bridge to accomplish what you are trying to do. This is not something we have tested, so you may run into issues that we are not aware of and may not be able to resolve.
>
> But please let us know how it goes. Others may be able to share some experience that may help, and we will try to be of assistance if we can.
>
> Greg
>
>
> On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4...@gmail.com> wrote:
> >
>
>  Hi,
>
> Was trying to use pivot in an Eclipse RCP application.  When I try to
> instantiate any object (like Label) within a view, i get a run time
> exception of NoClassDefenition found.
>
> Any one has tried this before?  Any examples?
>
> Appreciate your help.
>
> Thanks,
> -Manoj.
>

Re: Use pivot in Eclipse RCP

Posted by Greg Brown <gk...@mac.com>.
Sounds like you need to make sure the Pivot JARs are on your classpath.

However, you are somewhat in uncharted waters. Pivot is based on AWT and Java2D, whereas Eclipse uses SWT. You may need to use the AWT/SWT bridge to accomplish what you are trying to do. This is not something we have tested, so you may run into issues that we are not aware of and may not be able to resolve. 

But please let us know how it goes. Others may be able to share some experience that may help, and we will try to be of assistance if we can.

Greg

 
On Thursday, October 08, 2009, at 02:50AM, "Manoj Kumar S" <m4...@gmail.com> wrote:
>