Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How do package a widget in a jar file?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
IamRobertHanson@gmail.com  
View profile  
 More options May 22 2006, 11:40 pm
From: "IamRobertHan...@gmail.com" <IamRobertHan...@gmail.com>
Date: Mon, 22 May 2006 20:40:48 -0700
Local: Mon, May 22 2006 11:40 pm
Subject: How do package a widget in a jar file?
I am trying to package up some widgets for reuse, but when they live in
a referenced jar file it seems they can't be seen/used.

I have the proper gwt.xml file in the jar, which is referenced from my
project (inherited), and I also bundled the Java source for the widget
in the jar as well.  Still no luck, and the error messages aren't
overly helpful.

Has anyone had any luck with this?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
IamRobertHanson@gmail.com  
View profile  
 More options May 23 2006, 8:46 am
From: "IamRobertHan...@gmail.com" <IamRobertHan...@gmail.com>
Date: Tue, 23 May 2006 12:46:56 -0000
Local: Tues, May 23 2006 8:46 am
Subject: Re: How do package a widget in a jar file?
Nevermind, I figured it out.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Wolf  
View profile  
(1 user)  More options May 23 2006, 1:26 pm
From: "Christian Wolf" <christian.w...@gmail.com>
Date: Tue, 23 May 2006 17:26:45 -0000
Local: Tues, May 23 2006 1:26 pm
Subject: Re: How do package a widget in a jar file?
Would you mind sharing your solution? Or is this a trivial task?

I didn't bump into this, but I might in the future.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dabylon@gmail.com  
View profile  
 More options May 23 2006, 1:35 pm
From: "daby...@gmail.com" <daby...@gmail.com>
Date: Tue, 23 May 2006 17:35:41 -0000
Local: Tues, May 23 2006 1:35 pm
Subject: Re: How do package a widget in a jar file?
Yes - please post your solution - I'm having the same problem.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Hanson  
View profile  
(8 users)  More options May 23 2006, 2:07 pm
From: "Robert Hanson" <iamroberthan...@gmail.com>
Date: Tue, 23 May 2006 14:07:07 -0400
Local: Tues, May 23 2006 2:07 pm
Subject: Re: How do package a widget in a jar file?

I created a widget called "Heading" which wraps the text in the appropriate
<h1></h1> HTML tag.

The contents of the JAR file look like this:
 META-INF/
 META-INF/MANIFEST.MF
 org/
 org/hanson/
 org/hanson/gwt/
 org/hanson/gwt/client/
 org/hanson/gwt/client/Heading.class
 org/hanson/gwt/client/Heading.java
 org/hanson/gwt/Components.gwt.xml

The widget class AND source must be in the "client" package (you can change
this in the gwt.xml file if needed).  The source must be present for the
compiler to generate the JavaScript.

The structure of the JAR, in general, should be like this:

some.package.MyName.gwt.xml (project properties)
some.package.client.* (code to be compiled to JavaScript)
some.package.public.* (images or other files)
some.package.xyz.* (anything else)

==== The source for the Heading widget ====

package org.hanson.gwt.client;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;

public class Heading extends Widget
{
    public Heading ()
    {
        setElement(DOM.createElement("h1"));
        setStyleName("rhw-heading");
    }

    public void setText (String s)
    {
        DOM.setInnerText(getElement(), s);
    }

}

==== contents of Components.gwt.xml ====

<module>
    <inherits name='com.google.gwt.user.User'/>
</module>

NOTE: If you have your client code somewhere other than the "client" Java
package, you need to speficify that here.  Same goes for the "public"
package.  (See http://makeashorterlink.com/?G4332572D)

To use this JAR in your project you need to make a few changes:

1. Alter your *gwt.xml project file to reference the project file in the
JAR.

Example:
<module>
    <!-- Inherit the core Web Toolkit stuff -->
    <inherits name='com.google.gwt.user.User'/>

    <!-- ** ADD THIS ** Inherit the stuff from the jar ** ADD THIS ** -->
    <inherits name='org.hanson.gwt.Components'/>

    <!-- Specify the app entry point class. -->
    <entry-point class='org.hanson.gwt.client.MyApplication/>
</module>

2. Edit the MyApplication-shell.cmd and MyApplication-compile.cmd scripts,
add the jar to the classpath.

That should be it.

You should take a look at the gwt-user jar.  You will find several project
files in there, including com.google.gwt.user.User.  You will see that this
file references other projects, some of which use some currently
undocumented tags.  Note that for each project in the gwt-user.jar file
there is a "client" package, and optionally a "local" package.  You will see
that the images for the Tree widget are in one of the "local" packages.

Anyway, let me know if that helps.

On 5/23/06, daby...@gmail.com <daby...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dabylon@gmail.com  
View profile  
 More options May 23 2006, 2:43 pm
From: "daby...@gmail.com" <daby...@gmail.com>
Date: Tue, 23 May 2006 18:43:00 -0000
Subject: Re: How do package a widget in a jar file?
Thank you Robert - that helps. The crucial step was including the java
source.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Storey  
View profile  
(1 user)  More options Jun 19 2006, 2:42 pm
From: "Steve Storey" <ssto...@gmail.com>
Date: Mon, 19 Jun 2006 11:42:48 -0700
Local: Mon, Jun 19 2006 2:42 pm
Subject: Re: How do package a widget in a jar file?
Something else I've discovered on this topic - the compiler won't pick
up the "public" directory for a single package from 2 different JARs -
this becomes an issue if you have say:

gwt/org/something/Component1.gwt.xml
gwt/org/something/public/myResource1.gif

in Component1.jar and

gwt/org/something/Component2.gwt.xml
gwt/org/something/public/myOtherResource.gif

in Component2.jar - in this case, only one component's public directory
content will be included by the compiler (although it will compile
everything else fine). You need to ensure that all the components are
in different namespaces when in different JAR files.

Steve


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aglaforge  
View profile  
(1 user)  More options Jun 19 2006, 3:47 pm
From: "aglaforge" <aglafo...@gmail.com>
Date: Mon, 19 Jun 2006 12:47:17 -0700
Local: Mon, Jun 19 2006 3:47 pm
Subject: Re: How do package a widget in a jar file?
Figured a problem related to the default project google GWT creates,
which causes an Eclipse configuration issue.  The Project.launch file
has the "default classpath" disabled so it doesn't pull in the
approrpriate libraries for the project classpath.

The solution is to go into the Run menu, select the Run profile for
your project, click on Classpath, and add the GWT libraries to your
User Entries.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aglaforge  
View profile  
 More options Jun 19 2006, 3:50 pm
From: "aglaforge" <aglafo...@gmail.com>
Date: Mon, 19 Jun 2006 19:50:29 -0000
Local: Mon, Jun 19 2006 3:50 pm
Subject: Re: How do package a widget in a jar file?
Apologies, a better solution would be to add your project to the
Classpath, using the method described in the previous note.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google