Export to GitHub

gwt-exporter - issue #6

A more java like syntax using annotations


Posted on Jul 19, 2008 by Happy Bear

example:

package org.example.yourcode.format.client; public class DateFormatterLib implements EntryPoint {

// Expose the following method into JavaScript. private static String formatAsCurrency(double x) { return NumberFormat.getCurrencyFormat().format(x); }

// Set up the JS-callable signature as a global JS function. @Publish(jsMethod="$wnd.formatAsCurrency" klass=DateFormatterLib.class method="formatAsCurrency(D)") private native void publish() /-{
}-
/;

// Auto-publish the method into JS when the GWT module loads. public void onModuleLoad() { publish(); } }

Comment #1

Posted on Jun 8, 2011 by Grumpy Elephant

The project already uses annotations

Status: Done

Labels:
Type-Defect Priority-Medium