Re: Tree vaadin?

2011-07-11 Thread Antonio Recio
Harsha Sanjeewa has translated the vaadin example of the tree in clojure. The source is here https://github.com/hsenid-mobile/clj-vaadin. It is very useful to begin working with clojure and vaadin. This tree example has 2 levels and I would like to have 4 levels. With the following code it

Re: Tree vaadin?

2011-06-27 Thread Antonio Recio
I have tried to use amap but I was too difficult for me and I have tried the map: (def tree (com.vaadin.ui.Tree. Planets)) (map #(.addItem tree (.toString (first %))) planets) But I get an error: IllegalArgumentException Don't know how to create ISeq from:

Tree vaadin?

2011-06-26 Thread Antonio Recio
I would like to translate a java example of tree vaadin to clojure. I have to files in the same folder: planets.clj and core.clj. I am having problems and I need help. What I am doing wrong? * * *;; In the file planets.clj:* (ns project.planets) (let [planets (doto (Object

Re: Tree vaadin?

2011-06-26 Thread .Bill Smith
Can you describe the problem you are having? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: Tree vaadin?

2011-06-26 Thread Robert Lally
First problem: In Java: new Object[]{Venus} On 26 June 2011 18:46, .Bill Smith william.m.sm...@gmail.com wrote: Can you describe the problem you are having? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Tree vaadin?

2011-06-26 Thread Robert Lally
Ooops - gmail malfunction First problem, in Java: new Object[]{Venus} creates a new object array - containing the String Venus. Your clojure code Object. [Venus]) is trying to call the constructor of Object passing in a single argument which is a Clojure Vector. This isn't going to

Re: Tree vaadin?

2011-06-26 Thread Antonio Recio
*Could* it *possible* to use a list with peek and pop to create the planets and moons list? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated -

Re: Tree vaadin?

2011-06-26 Thread Antonio Recio
Could anyone write the planet array of objects? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: Tree vaadin?

2011-06-26 Thread Antonio Recio
I could be fine this? (def planets (object-array [[Venus] [Earth The Moon] [Mars Phobos Deimos]])) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are

Re: Tree vaadin?

2011-06-26 Thread Antonio Recio
How I can translate this in clojure? for (int i=0; iplanets.length; i++) { String planet = (String) (planets[i][0]); tree.addItem(planet); -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Tree vaadin?

2011-06-26 Thread Linus Ericsson
Maybe (map #(.addItem tree (.toString (first %))) planets) where #(.addItem tree (.toString (first %))) should be replaced with the correct java interop for inserting into the tree, and the % becomes one and one of the items in the planets vector (that is regarded as a sequence) the argument.

Re: Tree vaadin?

2011-06-26 Thread Ambrose Bonnaire-Sergeant
I've never used it, but you would use amap instead of map in this situation, because it is a Java array. http://clojuredocs.org/clojure_core/clojure.core/amap Ambrose On Mon, Jun 27, 2011 at 1:08 PM, Linus Ericsson oscarlinuserics...@gmail.com wrote: Maybe (map #(.addItem tree (.toString