Wednesday, September 15, 2010

Re: Re: function as parameter

Command is a simple java interface.
You can define your own.

public interface YourFunction {
void execute(String value);
}

public void processFunction(YourFunction f) {
f.execute("yeah");
}

To call:
processFunction(new YourFunction() {
    public void execute(String value) {
         // Do something
    }
});

On Wed, Sep 15, 2010 at 2:21 AM, Marco Gadaleta <gadaleta.marco@gmail.com> wrote:
yes it's clear but in the execute of the command i can't pass an argument (for example a return of a call)

2010/9/14 Gal Dolber <gal.dolber@gmail.com>

sendFunction(new Command() {

public void execute() {
// Do something
}

});


On Tue, Sep 14, 2010 at 4:23 PM, Marco Gadaleta <gadaleta.marco@gmail.com> wrote:

Thank-you for the help. Can you post me an example of the calling ?

Il giorno 14/set/2010 20:02, "Gal Dolber" <gal.dolber@gmail.com> ha scritto:


You can use Command.

public void sendFunction(Command command) {
command.execute();
}

On Tue, Sep 14, 2010 at 12:43 PM, Marco Gadaleta <gadaleta.marco@gmail.com> wrote:

>
> here's a way to send  a function to another function as attribute?
>
> --
> Marco

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Marco

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment