yubrshen | 1 Feb 01:18
Picon

[groovy-user] Example: how to construct UI at the runtime with SwingBuilder (add/delete/replace component)

I've learned to construct UI view with SwingBuilder statically by declaring
the components within application, frame, etc. 

However, for my application, I need to change the constructed the view, for
example, remove a button, add another filed, etc. at the run-time. 

I figure that I could use the components of the panel to remove certain
components. But how I can insert new components after an view is already
built?

I'm using Griffon. I find it hard to use multiple MVC groups, by switching
to a new view, a new construction, as I want the controller to be the same,
unless, I know how to make the new controller redirect to the original
controller?

I'm pretty new to Groovy/SwingBuilder, and Graffon. An example would be
appreciated. 

Thank you in advance. 

Yu

--
View this message in context: http://groovy.329449.n5.nabble.com/Example-how-to-construct-UI-at-the-runtime-with-SwingBuilder-add-delete-replace-component-tp5446147p5446147.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
(Continue reading)

Dinko Srkoc | 1 Feb 02:27
Picon
Gravatar

Re: [groovy-user] interesting one I'm not sure of the answer too

On 31 January 2012 23:48, Andrew Taylor <ataylor@...> wrote:
> On 1/31/2012 2:14 PM, Roger Studner wrote:
> [...]
> Collection.collectMany can handle cases where you want zero or more items
> collected per element.  Just enclose the element(s) in a list, empty list
> for zero.  The result gets flattened automatically. [...]

Let me further expand on this point. One might get the impression that
`collectMany` is functionally equivalent to `collect` + `flatten`, and
indeed for some cases it is:

    def foo = [[1, 2], [1], [3, 4]],
        expected = [2, 3, 4]
    assert foo.collect { it - 1 }.flatten() == expected
    assert foo.collectMany { it - 1 } == expected

However, while `flatten` flattens nested collections recursively,
`collectMany` peels only the first "layer":

    def coll = [[1, []], [], [2, [3]]]
    assert coll.flatten() == [1, 2, 3]
    assert coll.collectMany {it} == [1, [], 2, [3]]

In this regard `collectMany` works the same as Scala's `flatMap`, or
(I belive) C#'s `SelectMany`.

Parenthetically, the first example could also be written using `sum`,
albeit less efficiently:

    assert foo.sum { it - 1 } == expected
(Continue reading)

yubrshen | 1 Feb 14:26
Picon

[groovy-user] Re: Question on Views in Griffon

Hi Andres,

Is it possible to re-draw/re-build the application/view, such that I could
adaptively choose some of the view scripts? For example, 

application(title: "SwingPad") { 
   menuBar build(SwingPadMenuBar) 
   toolBar build(SwingPadToolBar) 
if new_user widget build(SwingNewUserPad) 
else
   widget build(SwingNormalPad)
   statusBar build(SwingPadStatusBar) 
} 

Suppose that I can repeat evaluation of the above script.

I want to achieve the purpose of present different UI for different
situation/scenario, even change the UI during the application's running.

Yu

--
View this message in context: http://groovy.329449.n5.nabble.com/Question-on-Views-in-Griffon-tp360391p5447486.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

(Continue reading)

Roger Studner | 1 Feb 15:07
Picon
Gravatar

[groovy-user] Groovy, Spring and ASM

Anyone have experience resolving the fact that Spring 2.5.6 depends on ASM 2.2.3 and Groovy 1.8.5 depends
on ASM 3.2 :)?

Thanks :)

Roger

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jochen Theodorou | 1 Feb 15:11
Picon
Gravatar

Re: [groovy-user] Groovy, Spring and ASM

Am 01.02.2012 15:07, schrieb Roger Studner:
> Anyone have experience resolving the fact that Spring 2.5.6 depends
> on ASM 2.2.3 and Groovy 1.8.5 depends on ASM 3.2 :)?

it should be no problem since we jarjar the asm lib to avoid such conflicts.

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Paul King | 1 Feb 15:18
Picon
Favicon
Gravatar

Re: [groovy-user] Groovy, Spring and ASM


It depends on exactly what you are trying to do but I usually have
no problems when using the groovy-all jar which jarjars the asm
dependency with an internal package name - effectively hiding it.

Cheers, Paul.

On 2/02/2012 12:07 AM, Roger Studner wrote:
> Anyone have experience resolving the fact that Spring 2.5.6 depends on ASM 2.2.3 and Groovy 1.8.5 depends
on ASM 3.2 :)?
>
> Thanks :)
>
> Roger
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

(Continue reading)

Guillaume Laforge | 1 Feb 15:22
Gravatar

Re: [groovy-user] Groovy, Spring and ASM

You just need to be sure to use the groovy-all.jar, not groovy.jar which is not "jarjar-ed".

On Wed, Feb 1, 2012 at 15:11, Jochen Theodorou <blackdrag-BA+cFGlbTmA@public.gmane.org> wrote:
Am 01.02.2012 15:07, schrieb Roger Studner:

Anyone have experience resolving the fact that Spring 2.5.6 depends
on ASM 2.2.3 and Groovy 1.8.5 depends on ASM 3.2 :)?

it should be no problem since we jarjar the asm lib to avoid such conflicts.

bye blackdrag

--
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
Sai | 1 Feb 20:45
Picon

[groovy-user] Re: eachRow issues

Stan, where do you specify the "driver property resourceBuffer:adaptive"? 

Thanks, 
Sai.

--
View this message in context: http://groovy.329449.n5.nabble.com/eachRow-issues-tp5075342p5448547.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Stanton W Derry | 2 Feb 00:53

Re: [groovy-user] Re: eachRow issues

I used properties and passed it to the Sql.newInstance

The properties I set are:

  Properties props = new Properties()
   props.setProperty('user','<username>)
   props.setProperty('password',<password>)
   props.setProperty('responseBuffering','adaptive')
   props.setProperty('resultSetConcurrency', 
ResultSet.CONCUR_READ_ONLY.toString())
   props.setProperty('resultSetType', 
ResultSet.TYPE_FORWARD_ONLY.toString())
   props.setProperty('selectMethod','cursor')

   
Sql.newInstance('jdbc:sqlserver://localhost',props,'com.microsoft.sqlserver.jdbc.SQLServerDriver')

The key to large result sets was the "selectMethod" being set to curosr.

Hope this helps
Stan

On 2/1/12 11:45 AM, Sai wrote:
> Stan, where do you specify the "driver property resourceBuffer:adaptive"?
>
> Thanks,
> Sai.
>
> --
> View this message in context: http://groovy.329449.n5.nabble.com/eachRow-issues-tp5075342p5448547.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>
>
>
>    

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Brian M Carr | 2 Feb 03:04
Picon

Re: [groovy-user] Example: how to construct UI at the runtime with SwingBuilder (add/delete/replace component)

You can retain the reference to the SwingBuilder and if you have given your UI elements IDs, you can navigate the object graph like a normal groovy object.


For example, if you had a panel with an ID of 'foo' to which you wanted to add a button, you could do swing.foo.add()

--b

On Tue, Jan 31, 2012 at 6:18 PM, yubrshen <yubrshen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I've learned to construct UI view with SwingBuilder statically by declaring
the components within application, frame, etc.

However, for my application, I need to change the constructed the view, for
example, remove a button, add another filed, etc. at the run-time.

I figure that I could use the components of the panel to remove certain
components. But how I can insert new components after an view is already
built?

I'm using Griffon. I find it hard to use multiple MVC groups, by switching
to a new view, a new construction, as I want the controller to be the same,
unless, I know how to make the new controller redirect to the original
controller?

I'm pretty new to Groovy/SwingBuilder, and Graffon. An example would be
appreciated.

Thank you in advance.

Yu

--
View this message in context: http://groovy.329449.n5.nabble.com/Example-how-to-construct-UI-at-the-runtime-with-SwingBuilder-add-delete-replace-component-tp5446147p5446147.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Gmane