|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface MVCHandler
Base contract for classes that can manipulate MVC groups. There are 3 types of methods used for instantiating a group:
Method Summary | |
---|---|
MVCGroup
|
buildMVCGroup(String mvcType)
Instantiates an MVC group of the specified type. |
MVCGroup
|
buildMVCGroup(String mvcType, String mvcName)
Instantiates an MVC group of the specified type with a particular name. |
MVCGroup
|
buildMVCGroup(Map args, String mvcType)
Instantiates an MVC group of the specified type with additional variables. |
MVCGroup
|
buildMVCGroup(String mvcType, Map args)
Instantiates an MVC group of the specified type with additional variables. |
MVCGroup
|
buildMVCGroup(Map args, String mvcType, String mvcName)
Instantiates an MVC group of the specified type with a particular name. |
MVCGroup
|
buildMVCGroup(String mvcType, String mvcName, Map args)
Instantiates an MVC group of the specified type with a particular name. |
List
|
createMVCGroup(String mvcType)
Instantiates an MVC group of the specified type returning only the MVC parts. |
List
|
createMVCGroup(Map args, String mvcType)
Instantiates an MVC group of the specified type with additional variables. |
List
|
createMVCGroup(String mvcType, Map args)
Instantiates an MVC group of the specified type with additional variables. |
List
|
createMVCGroup(String mvcType, String mvcName)
Instantiates an MVC group of the specified type with a particular name. |
List
|
createMVCGroup(Map args, String mvcType, String mvcName)
Instantiates an MVC group of the specified type with a particular name. |
List
|
createMVCGroup(String mvcType, String mvcName, Map args)
Instantiates an MVC group of the specified type with a particular name. |
void
|
destroyMVCGroup(String mvcName)
Destroys an MVC group identified by a particular name. |
void
|
withMVCGroup(String mvcType, Closure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, String mvcName, Closure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, String mvcName, Map args, Closure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(Map args, String mvcType, String mvcName, Closure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, Map args, Closure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(Map args, String mvcType, Closure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, MVCClosure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, String mvcName, MVCClosure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, String mvcName, Map args, MVCClosure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(Map args, String mvcType, String mvcName, MVCClosure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(String mvcType, Map args, MVCClosure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
void
|
withMVCGroup(Map args, String mvcType, MVCClosure handler)
Instantiates an MVC group of the specified type then destroys it after it has been handled. |
Method Detail |
---|
public MVCGroup buildMVCGroup(String mvcType)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovy
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be created as follows
MapfooGroup = buildMVCGroup('foo') assert (fooGroup.controller instanceof FooController)
mvcType
- the type of group to build.
public MVCGroup buildMVCGroup(String mvcType, String mvcName)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovy
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be created as follows
MapMVC groups must have an unique name.fooGroup = buildMVCGroup('foo', 'foo' + System.currentTimeMillis()) assert (fooGroup.controller instanceof FooController)
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.
public MVCGroup buildMVCGroup(Map args, String mvcType)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } 'bar' { model = 'com.acme.FooModel' view = 'com.acme.BarView' controller = 'com.acme.BarController' } }Notice that groups "foo" and "bar share the same model type, We can make them share the same model instance by creating the groups in the following way:
MapfooGroup = buildMVCGroup('foo') Map barGroup = buildMVCGroup('bar', model: fooGroup.model) assert fooGroup.model == barGroup.model
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.
public MVCGroup buildMVCGroup(String mvcType, Map args)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } 'bar' { model = 'com.acme.FooModel' view = 'com.acme.BarView' controller = 'com.acme.BarController' } }Notice that groups "foo" and "bar share the same model type, We can make them share the same model instance by creating the groups in the following way:
MapfooGroup = buildMVCGroup('foo') Map barGroup = buildMVCGroup('bar', model: fooGroup.model) assert fooGroup.model == barGroup.model
mvcType
- the type of group to build.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.
public MVCGroup buildMVCGroup(Map args, String mvcType, String mvcName)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }We can create two instances of the same group that share the same model instance in the following way:
MapMVC groups must have an unique name.fooGroup1 = buildMVCGroup('foo', 'foo1') Map fooGroup2 = buildMVCGroup('bar', 'foo2', model: fooGroup1.model) assert fooGroup1.model == fooGroup2.model
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.mvcName
- the name to assign to the built group.
public MVCGroup buildMVCGroup(String mvcType, String mvcName, Map args)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }We can create two instances of the same group that share the same model instance in the following way:
MapMVC groups must have an unique name.fooGroup1 = buildMVCGroup('foo', 'foo1') Map fooGroup2 = buildMVCGroup('bar', 'foo2', model: fooGroup1.model) assert fooGroup1.model == fooGroup2.model
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.
public List createMVCGroup(String mvcType)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovy
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be created as follows
def (m, v, c) = createMVCGroup('foo') assert (c instanceof FooController)
mvcType
- the type of group to build.
public List createMVCGroup(Map args, String mvcType)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } 'bar' { model = 'com.acme.FooModel' view = 'com.acme.BarView' controller = 'com.acme.BarController' } }Notice that groups "foo" and "bar share the same model type, We can make them share the same model instance by creating the groups in the following way:
def (m1, v1, c1) = createMVCGroup('foo') def (m2, v2, c2) = createMVCGroup('bar', model: m1) assert fm1 == m2
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.
public List createMVCGroup(String mvcType, Map args)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } 'bar' { model = 'com.acme.FooModel' view = 'com.acme.BarView' controller = 'com.acme.BarController' } }Notice that groups "foo" and "bar share the same model type, We can make them share the same model instance by creating the groups in the following way:
def (m1, v1, c1) = createMVCGroup('foo') def (m2, v2, c2) = createMVCGroup('bar', model: m1) assert fm1 == m2
mvcType
- the type of group to build.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.
public List createMVCGroup(String mvcType, String mvcName)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovy
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be created as follows
def (m, v, c) = createMVCGroup('foo', 'foo' + System.currenttimeMillis()) assert (c instanceof FooController)MVC groups must have an unique name.
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.
public List createMVCGroup(Map args, String mvcType, String mvcName)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }We can create two instances of the same group that share the same model instance in the following way:
def (m1, v1, c1) = createMVCGroup('foo', 'foo1') def (m2, v2, c2) = createMVCGroup('foo', 'foo2', model: m1) assert fm1 == m2MVC groups must have an unique name.
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.mvcName
- the name to assign to the built group.
public List createMVCGroup(String mvcType, String mvcName, Map args)
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenarios
mvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }We can create two instances of the same group that share the same model instance in the following way:
def (m1, v1, c1) = createMVCGroup('foo', 'foo1') def (m2, v2, c2) = createMVCGroup('foo', 'foo2', model: m1) assert fm1 == m2MVC groups must have an unique name.
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.
public void destroyMVCGroup(String mvcName)
ATTENTION: make sure to call the super implementation if you override this method otherwise group references will not be kept up to date.
mvcName
- the name of the group to destroy and dispose.
public void withMVCGroup(String mvcType, Closure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovymvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup('foo') { m, v, c-> m.someProperty = someValue c.invokeAnAction() }
mvcType
- the type of group to build.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, String mvcName, Closure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovymvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup('foo', 'foo1') { m, v, c-> m.someProperty = someValue c.invokeAnAction() }MVC groups must have an unique name.
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, String mvcName, Map args, Closure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup('foo', 'foo1') { m, v, c-> m.someProperty = someValue c.invokeAnAction() }MVC groups must have an unique name.
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(Map args, String mvcType, String mvcName, Closure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup('foo', 'foo1') { m, v, c-> m.someProperty = someValue c.invokeAnAction() }MVC groups must have an unique name.
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.mvcName
- the name to assign to the built group.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, Map args, Closure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup('foo', 'foo1') { m, v, c-> m.someProperty = someValue c.invokeAnAction() }
mvcType
- the type of group to build.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(Map args, String mvcType, Closure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup('foo', 'foo1') { m, v, c-> m.someProperty = someValue c.invokeAnAction() }
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, MVCClosure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovymvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup("foo", new MVCClosure<FooModel, FooView, FooController>() { public void call(FooModel m, FooView v, FooController c) { m.setSomeProperty(someValue); c.invokeAnAction(); } });
mvcType
- the type of group to build.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, String mvcName, MVCClosure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
For example, with the following entry available in Application.groovymvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
withMVCGroup("foo", "foo1", new MVCClosure<FooModel, FooView, FooController>() { public void call(FooModel m, FooView v, FooController c) { m.setSomeProperty(someValue); c.invokeAnAction(); } });MVC groups must have an unique name.
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, String mvcName, Map args, MVCClosure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
MapMVC groups must have an unique name.map = ... // initialized elsewhere withMVCGroup("foo", "foo1", map, new MVCClosure<FooModel, FooView, FooController>() { public void call(FooModel m, FooView v, FooController c) { m.setSomeProperty(someValue); c.invokeAnAction(); } });
mvcType
- the type of group to build.mvcName
- the name to assign to the built group.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(Map args, String mvcType, String mvcName, MVCClosure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
MapMVC groups must have an unique name.map = ... // initialized elsewhere withMVCGroup("foo", "foo1", map, new MVCClosure<FooModel, FooView, FooController>() { public void call(FooModel m, FooView v, FooController c) { m.setSomeProperty(someValue); c.invokeAnAction(); } });
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.mvcName
- the name to assign to the built group.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(String mvcType, Map args, MVCClosure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
Mapmap = ... // initialized elsewhere withMVCGroup("foo", map, new MVCClosure<FooModel, FooView, FooController>() { public void call(FooModel m, FooView v, FooController c) { m.setSomeProperty(someValue); c.invokeAnAction(); } });
mvcType
- the type of group to build.args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.handler
- a code block used to configure and manage the instantiated group
public void withMVCGroup(Map args, String mvcType, MVCClosure handler)
This method is of particular interest when working with short lived MVC groups such as those used to build dialogs.
MVC Groups must be previously configured with the application's metadata before they can be used. This registration process usually takes place automatically at boot time. The type of the group can be normally found in the application's configuration file.
The args Map can contain any value that will be used in one of the following scenariosmvcGroups { 'foo' { model = 'com.acme.FooModel' view = 'com.acme.FooView' controller = 'com.acme.FooController' } }An instance of the "foo" group can be used as follows
Mapmap = ... // initialized elsewhere withMVCGroup("foo", map, new MVCClosure<FooModel, FooView, FooController>() { public void call(FooModel m, FooView v, FooController c) { m.setSomeProperty(someValue); c.invokeAnAction(); } });
args
- any useful values that can be set as properties on each MVC member or that
identify a member that can be shared with other groups.mvcType
- the type of group to build.handler
- a code block used to configure and manage the instantiated group
Groovy Documentation