Interface EntityApplicationModel<M extends EntityModel<M,​E,​T>,​E extends EntityEditModel,​T extends EntityTableModel<E>>

    • Field Detail

      • USERNAME_PREFIX

        static final PropertyValue<String> USERNAME_PREFIX
        Specifies a string to prepend to the username field in the login dialog
        Value type: String
        Default value: [empty string]
      • AUTHENTICATION_REQUIRED

        static final PropertyValue<Boolean> AUTHENTICATION_REQUIRED
        Specifies whether user authentication is required
        Value type: Boolean
        Default value: true
      • SAVE_DEFAULT_USERNAME

        static final 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
      • SCHEDULE_CONNECTION_VALIDATION

        static final PropertyValue<Boolean> SCHEDULE_CONNECTION_VALIDATION
        Specifies whether a periodic (30 sec) validity check of the underlying connection should be scheduled. Value type: Boolean
        Default value: true
    • Method Detail

      • user

        User user()
        Returns:
        the current user
      • connectionProvider

        EntityConnectionProvider connectionProvider()
        Returns:
        the EntityConnectionProvider instance being used by this EntityApplicationModel
      • connectionValidObserver

        StateObserver connectionValidObserver()
        Returns a StateObserver which is active while the underlying application connection provider is connected. Note that this state is updated every 30 seconds if SCHEDULE_CONNECTION_VALIDATION is true
        Returns:
        a StateObserver indicating the validity of the underlying connection provider
        See Also:
        SCHEDULE_CONNECTION_VALIDATION
      • entities

        Entities entities()
        Returns:
        the underlying domain entities
      • addEntityModels

        void addEntityModels​(M... entityModels)
        Adds the given entity models to this model.
        Parameters:
        entityModels - the entity models to add
      • addEntityModel

        M addEntityModel​(M entityModel)
        Adds the given entity model to this model
        Parameters:
        entityModel - the detail model
        Returns:
        the EntityModel model just added
      • containsEntityModel

        boolean containsEntityModel​(Class<? extends M> modelClass)
        Parameters:
        modelClass - the application model class
        Returns:
        true if this model contains a EntityModel instance of the given class
      • containsEntityModel

        boolean containsEntityModel​(EntityType entityType)
        Parameters:
        entityType - the entityType
        Returns:
        true if this model contains a EntityModel for the given entityType
      • containsEntityModel

        boolean containsEntityModel​(M entityModel)
        Parameters:
        entityModel - the entity model
        Returns:
        true if this model contains the given EntityModel
      • setWarnAboutUnsavedData

        void setWarnAboutUnsavedData​(boolean warnAboutUnsavedData)
        Parameters:
        warnAboutUnsavedData - if true then this model warns about unsaved data
        See Also:
        EntityEditModel.WARN_ABOUT_UNSAVED_DATA
      • containsUnsavedData

        boolean containsUnsavedData()
        Returns:
        true if any edit model associated with this application model contains modified and unsaved data, that is, existing entities that have been modified but not saved
      • savePreferences

        void savePreferences()
        Saves user preferences relating to this application model, remember to call super.savePreferences() when overriding
      • entityModels

        List<M> entityModels()
        Returns:
        an unmodifiable List containing the EntityModel instances contained in this EntityApplicationModel
      • entityModel

        <T extends M> T entityModel​(Class<? extends M> modelClass)
        Type Parameters:
        T - the model type
        Parameters:
        modelClass - the model class
        Returns:
        the EntityModel of the given type
      • entityModel

        M entityModel​(EntityType entityType)
        Parameters:
        entityType - the entityType
        Returns:
        the EntityModel based on the given entityType
      • refresh

        void refresh()
        Refreshes all data models contained in this application model