Class ModelAccessBase

  • All Implemented Interfaces:
    ModelAccess
    Direct Known Subclasses:
    GlobalModelAccess, ProjectModelAccess

    public abstract class ModelAccessBase
    extends Object
    implements ModelAccess
    ModelAccess basic implementation: all non-command methods are implemented here. Currently it delegates everything to the ModelAccess, it is planned to rewrite this class when multiple repositories are supported. Created by Alex Pyshkin on 9/3/14.
    • Constructor Detail

      • ModelAccessBase

        public ModelAccessBase()
    • Method Detail

      • canRead

        public boolean canRead()
        Description copied from interface: ModelAccess
        Indicates, whether the current thread holds the read lock
        Specified by:
        canRead in interface ModelAccess
      • checkReadAccess

        public void checkReadAccess()
        Description copied from interface: ModelAccess
        Fails with an exception, if the current thread does not hold the read lock
        Specified by:
        checkReadAccess in interface ModelAccess
      • canWrite

        public boolean canWrite()
        Description copied from interface: ModelAccess
        Indicates, whether the current thread holds the write lock
        Specified by:
        canWrite in interface ModelAccess
      • checkWriteAccess

        public void checkWriteAccess()
        Description copied from interface: ModelAccess
        Fails with an exception, if the current thread does not hold the write lock
        Specified by:
        checkWriteAccess in interface ModelAccess
      • runReadAction

        public void runReadAction​(Runnable r)
        Description copied from interface: ModelAccess
        Querying properties of models can only be performed from within managed actions, which hold the appropriate read lock. The method obtains such a lock and executes the provided action.
        Specified by:
        runReadAction in interface ModelAccess
      • runReadInEDT

        public void runReadInEDT​(Runnable r)
        Description copied from interface: ModelAccess
        Querying properties of models can only be performed from within managed actions, which hold the appropriate read lock. The method obtains such a lock and executes the provided action asynchronously on the EDT UI thread. Inside the action it is safe to touch any UI elements and perform other EDT-bound actions of the IntelliJ platform.
        Specified by:
        runReadInEDT in interface ModelAccess
      • runWriteAction

        public void runWriteAction​(Runnable r)
        Description copied from interface: ModelAccess
        Modifications to models can only be performed from within managed actions, which hold the appropriate write lock. The method obtains such a lock and executes the provided action. It should not be invoked from EDT, otherwise UI freeze may occur. Note: A lock cannot be upgraded. When owning the read lock it is not allowed to ask for the write lock through the runWriteAction() method.
        Specified by:
        runWriteAction in interface ModelAccess
      • runWriteInEDT

        public void runWriteInEDT​(Runnable r)
        Description copied from interface: ModelAccess
        Modifications to models can only be performed from within managed actions, which hold the appropriate write lock. The method obtains such a lock and executes the provided action asynchronously on the EDT UI thread. Inside the action it is safe to touch any UI elements and perform other EDT-bound actions of the IntelliJ platform.
        Specified by:
        runWriteInEDT in interface ModelAccess
      • getDelegate

        protected final ModelAccess getDelegate()