-5

Can someone convert this into Clojure, I don't know to do the line setMainWindow(argument) like things....

import com.vaadin.Application;

class something {
    public void init() {
        Window main = new Window("The Main Window");
        setMainWindow(main);
        addComponent(new WindowOpener("Window Opener", main));
    }
}

Update:



package app;

import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Window;

/**
 * The Application's "main" class
 */
@SuppressWarnings("serial")
public class MyVaadinApplication extends Application{
    private Window window;

    @Override
    public void init(){
        window = new Window("My Vaadin Application");
        setMainWindow(window);
        window.addComponent(new Button("Click Me"));
    }
} 

There is a "/lib/vaadin.jar" which contains all "com.vaadin.*" things.
I think setMainWindow(window); is from the extended class. I am not going to write that method.

Donato Szilagyi
  • 4,279
  • 4
  • 36
  • 53
Thilina
  • 695
  • 2
  • 7
  • 20

2 Answers2

5

Literal translation:

(defn init []
  (let [main (Window. "The Main Window")]
    (setMainWindow main)
    (addComponent (WindowOpener. "Window Opener" main))))

Though it doesn't make much sense without the context.

Abhinav Sarkar
  • 23,534
  • 11
  • 81
  • 97
0

See http://dev.vaadin.com/wiki/Articles/ClojureScripting. Also I would suggest http://www.odesk.com.

yazz.com
  • 57,320
  • 66
  • 234
  • 385
  • I saw this... But I cant do this with that codings.. I am not a Clojure expert....!! But thanks a lot...!! – Thilina Dec 31 '10 at 04:04