M
- the type of EntityModel
used by this application modelpublic interface EntityApplicationModel<M extends EntityModel> extends Refreshable
Modifier and Type | Field and Description |
---|---|
static PropertyValue<java.lang.Boolean> |
AUTHENTICATION_REQUIRED
Specifies whether user authentication is required
Value type: Boolean Default value: true |
static PropertyValue<java.lang.Boolean> |
SAVE_DEFAULT_USERNAME
Specifies whether or not the client saves the last successful login username,
which is then displayed as the default username the next time the application is started Value type: Boolean Default value: true |
static PropertyValue<java.lang.Boolean> |
SCHEDULE_CONNECTION_VALIDATION
Specifies whether a periodic (30 sec) validity check of the underlying connection should be scheduled.
|
static PropertyValue<java.lang.String> |
USERNAME_PREFIX
Specifies a string to prepend to the username field in the login dialog
Value type: String Default value: [empty string] |
Modifier and Type | Method and Description |
---|---|
M |
addEntityModel(M entityModel)
Adds the given entity model to this model
|
void |
addEntityModels(M... entityModels)
Adds the given entity models to this model.
|
boolean |
containsEntityModel(java.lang.Class<? extends M> modelClass) |
boolean |
containsEntityModel(M entityModel) |
boolean |
containsEntityModel(java.lang.String entityId) |
boolean |
containsUnsavedData() |
EntityConnectionProvider |
getConnectionProvider() |
StateObserver |
getConnectionValidObserver()
Returns a StateObserver which is active while the underlying application connection provider is connected.
|
Domain |
getDomain() |
M |
getEntityModel(java.lang.Class<? extends M> modelClass) |
M |
getEntityModel(java.lang.String entityId) |
java.util.List<M> |
getEntityModels() |
User |
getUser() |
boolean |
isWarnAboutUnsavedData() |
void |
login(User user)
Logs in the given user
|
void |
logout()
Log out from this application model
|
void |
savePreferences()
Saves user preferences relating to this application model, remember to call super.savePreferences() when overriding
|
void |
setWarnAboutUnsavedData(boolean warnAboutUnsavedData) |
clear, refresh
static final PropertyValue<java.lang.String> USERNAME_PREFIX
static final PropertyValue<java.lang.Boolean> AUTHENTICATION_REQUIRED
static final PropertyValue<java.lang.Boolean> SAVE_DEFAULT_USERNAME
static final PropertyValue<java.lang.Boolean> SCHEDULE_CONNECTION_VALIDATION
void logout()
void login(User user)
user
- the user to loginjava.lang.NullPointerException
- in case user is nullUser getUser()
EntityConnectionProvider getConnectionProvider()
StateObserver getConnectionValidObserver()
SCHEDULE_CONNECTION_VALIDATION
is trueSCHEDULE_CONNECTION_VALIDATION
Domain getDomain()
void addEntityModels(M... entityModels)
entityModels
- the entity models to addM addEntityModel(M entityModel)
entityModel
- the detail modelboolean containsEntityModel(java.lang.Class<? extends M> modelClass)
modelClass
- the application model classboolean containsEntityModel(java.lang.String entityId)
entityId
- the entity IDboolean containsEntityModel(M entityModel)
entityModel
- the entity modelboolean isWarnAboutUnsavedData()
EntityEditModel.WARN_ABOUT_UNSAVED_DATA
void setWarnAboutUnsavedData(boolean warnAboutUnsavedData)
warnAboutUnsavedData
- if true then this model warns about unsaved dataEntityEditModel.WARN_ABOUT_UNSAVED_DATA
boolean containsUnsavedData()
void savePreferences()
java.util.List<M> getEntityModels()
M getEntityModel(java.lang.Class<? extends M> modelClass)
modelClass
- the model classM getEntityModel(java.lang.String entityId)
entityId
- the entity ID