Class Model

    • Constructor Detail

      • Model

        public Model()
    • Method Detail

      • isOnline

        public boolean isOnline()
        Specified by:
        isOnline in interface IModel
        Returns:
        true if this model is online, false otherwise.
      • commit

        public void commit()
        Description copied from interface: IModel
        Commits the changes to the data model.
        Specified by:
        commit in interface IModel
      • discard

        public void discard()
        Description copied from interface: IModel
        Discards the changes stored in the model buffer since last IModel.commit() operation.
        Specified by:
        discard in interface IModel
      • createWorkingCopy

        public IModel createWorkingCopy()
        Specified by:
        createWorkingCopy in interface IModel
        Returns:
        the model working copy or null if working copies is not supported by the model.
      • getComponent

        public IComponent<?> getComponent()
        Specified by:
        getComponent in interface IModel
        Returns:
        the component associated with the model or null if no association established.
      • setComponent

        public void setComponent​(IComponent<?> component)
        Description copied from interface: IModel
        Associate this model with the component.
        Specified by:
        setComponent in interface IModel
        Parameters:
        component - the component to associate with.
      • addModelListener

        public void addModelListener​(IModelListener listener)
        Description copied from interface: IModel
        Adds the model listener.
        Specified by:
        addModelListener in interface IModel
        Parameters:
        listener - the listener to add.
      • removeModelListener

        public void removeModelListener​(IModelListener listener)
        Description copied from interface: IModel
        Removes the model listener.
        Specified by:
        removeModelListener in interface IModel
        Parameters:
        listener - the listener to remove.
      • dispose

        public void dispose()
        Description copied from interface: IModel
        Disposes this model.
        Specified by:
        dispose in interface IModel
      • notifyModelChanged

        protected final void notifyModelChanged​(ChangeOrigin changeOrigin)
        Notifies the model listeners about the model changes.
      • notifyModelCommitted

        protected final void notifyModelCommitted()
        Notifies the model listeners about the model is committed.
      • setOnline

        protected final void setOnline​(boolean value)
        Marks model as online or offline notifying this model's listeners.
        Parameters:
        value - true to go online or false to go offline.
      • getRunnableQueue

        protected final IRunnableQueue getRunnableQueue()
        Returns:
        the runnable queue associated with this model.
      • beginExternalUpdate

        protected final void beginExternalUpdate()
        Begins the external update operation in the associated component.
        See Also:
        IComponent.beginExternalUpdate()
      • endExternalUpdate

        protected final void endExternalUpdate()
        Ends the external update operation in the associated component.
        See Also:
        IComponent.endExternalUpdate()
      • checkOnline

        protected final void checkOnline()
        Checks this model is online.
        Throws:
        IllegalStateException - if this value is offline.
      • checkOffline

        protected final void checkOffline()
        Checks this model is offline.
        Throws:
        IllegalStateException - if this value is online.