M
- the type of EntityModel
this application model is based onE
- the type of EntityEditModel
used by this EntityModel
T
- the type of EntityTableModel
used by this EntityModel
public interface EntityApplicationModel<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
Modifier and Type | Field and Description |
---|---|
static PropertyValue<Boolean> |
AUTHENTICATION_REQUIRED
Specifies whether user authentication is required
Value type: Boolean Default value: true |
static PropertyValue<Boolean> |
SAVE_DEFAULT_USERNAME
Specifies whether 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<Boolean> |
SCHEDULE_CONNECTION_VALIDATION
Specifies whether a periodic (30 sec) validity check of the underlying connection should be scheduled.
|
static PropertyValue<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.
|
EntityConnectionProvider |
connectionProvider() |
StateObserver |
connectionValidObserver()
Returns a StateObserver which is active while the underlying application connection provider is connected.
|
boolean |
containsEntityModel(Class<? extends M> modelClass) |
boolean |
containsEntityModel(EntityType entityType) |
boolean |
containsEntityModel(M entityModel) |
boolean |
containsUnsavedData() |
Entities |
entities() |
<T extends M> |
entityModel(Class<? extends M> modelClass) |
M |
entityModel(EntityType entityType) |
List<M> |
entityModels() |
boolean |
isWarnAboutUnsavedData() |
void |
refresh()
Refreshes all data models contained in this application model
|
void |
savePreferences()
Saves any user preferences.
|
void |
setWarnAboutUnsavedData(boolean warnAboutUnsavedData) |
User |
user() |
static final PropertyValue<String> USERNAME_PREFIX
static final PropertyValue<Boolean> AUTHENTICATION_REQUIRED
static final PropertyValue<Boolean> SAVE_DEFAULT_USERNAME
static final PropertyValue<Boolean> SCHEDULE_CONNECTION_VALIDATION
User user()
EntityConnectionProvider connectionProvider()
StateObserver connectionValidObserver()
SCHEDULE_CONNECTION_VALIDATION
is trueSCHEDULE_CONNECTION_VALIDATION
Entities entities()
void addEntityModels(M... entityModels)
entityModels
- the entity models to addM addEntityModel(M entityModel)
entityModel
- the detail modelboolean containsEntityModel(Class<? extends M> modelClass)
modelClass
- the application model classboolean containsEntityModel(EntityType entityType)
entityType
- the entityTypeboolean 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()
EntityModel.USE_CLIENT_PREFERENCES
is set to 'false',
calling this method has no effect. Remember to call super.savePreferences() when overriding.List<M> entityModels()
<T extends M> T entityModel(Class<? extends M> modelClass)
T
- the model typemodelClass
- the model classM entityModel(EntityType entityType)
entityType
- the entityTypevoid refresh()