|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.model.AbstractReadOnlyModel<String>
org.apache.wicket.model.ResourceModel
public class ResourceModel
A model that represents a localized resource string. This is a lightweight version of the
StringResourceModel
. It lacks parameter substitutions, but is generally easier to use.
If you don't use this model as primary component model (you don't specify it in component
constructor and don't assign it to component using Component.setDefaultModel(IModel)
),
you will need to connect the model with a component using wrapOnAssignment(Component)
.
Constructor Summary | |
---|---|
ResourceModel(String resourceKey)
Constructor |
|
ResourceModel(String resourceKey,
String defaultValue)
Constructor |
Method Summary | |
---|---|
String |
getObject()
Gets the model object. |
IWrapModel<String> |
wrapOnAssignment(Component component)
This method is called when the component gets its model assigned. |
Methods inherited from class org.apache.wicket.model.AbstractReadOnlyModel |
---|
detach, getObject, setObject, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.wicket.model.IModel |
---|
setObject |
Methods inherited from interface org.apache.wicket.model.IDetachable |
---|
detach |
Constructor Detail |
---|
public ResourceModel(String resourceKey)
resourceKey
- key of the resource this model representspublic ResourceModel(String resourceKey, String defaultValue)
resourceKey
- key of the resource this model representsdefaultValue
- value that will be returned if resource does not existMethod Detail |
---|
public String getObject()
IModel
getObject
in interface IModel<String>
getObject
in class AbstractReadOnlyModel<String>
AbstractReadOnlyModel.getObject()
public IWrapModel<String> wrapOnAssignment(Component component)
IComponentAssignedModel
wrapOnAssignment
in interface IComponentAssignedModel<String>
IComponentAssignedModel.wrapOnAssignment(org.apache.wicket.Component)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |