Package org.jetbrains.mps.openapi.module
Interface ModelAccess
- 
 public interface ModelAccessGrants access to objects in the repository (for example to models)
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddCommandListener(CommandListener listener)add/remove listeners to listen to the start/finish of command eventsvoidaddReadActionListener(ReadActionListener listener)Get notified about start/finish of a model read actionvoidaddWriteActionListener(WriteActionListener listener)add/remove listeners to listen to the start/finish of write action eventsbooleancanRead()Indicates, whether the current thread holds the read lockbooleancanWrite()Indicates, whether the current thread holds the write lockvoidcheckReadAccess()Fails with an exception, if the current thread does not hold the read lockvoidcheckWriteAccess()Fails with an exception, if the current thread does not hold the write lockvoidexecuteCommand(Runnable r)Represents a write action executed with respect to platform undo mechanism.voidexecuteCommandInEDT(Runnable r)Represents a write action executed with respect to platform undo mechanism, runs asynchronously from EDT thread.default <T> Future<T>executeCommandInEDT(Supplier<T> supplier)voidexecuteUndoTransparentCommand(Runnable r)FIXME need thorough documentation Executed code has model write, is treated as a command, the only difference is that changes from the transparent action merged with the that of the previous undoable commandbooleanisCommandAction()voidremoveCommandListener(CommandListener listener)voidremoveReadActionListener(ReadActionListener listener)Cease notifications about start/finish of a model read actionvoidremoveWriteActionListener(WriteActionListener listener)voidrunReadAction(Runnable r)Querying properties of models can only be performed from within managed actions, which hold the appropriate read lock.voidrunReadInEDT(Runnable r)Querying properties of models can only be performed from within managed actions, which hold the appropriate read lock.voidrunWriteAction(Runnable r)Modifications to models can only be performed from within managed actions, which hold the appropriate write lock.voidrunWriteInEDT(Runnable r)Modifications to models can only be performed from within managed actions, which hold the appropriate write lock.
 
- 
- 
- 
Method Detail- 
canReadboolean canRead() Indicates, whether the current thread holds the read lock
 - 
checkReadAccessvoid checkReadAccess() Fails with an exception, if the current thread does not hold the read lock
 - 
canWriteboolean canWrite() Indicates, whether the current thread holds the write lock
 - 
checkWriteAccessvoid checkWriteAccess() Fails with an exception, if the current thread does not hold the write lock
 - 
runReadActionvoid runReadAction(Runnable r) 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.
 - 
runReadInEDTvoid runReadInEDT(Runnable r) 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.
 - 
runWriteActionvoid runWriteAction(Runnable r) 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.
 - 
runWriteInEDTvoid runWriteInEDT(Runnable r) 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.
 - 
executeCommandvoid executeCommand(Runnable r) Represents a write action executed with respect to platform undo mechanism. This method shall be invoked from EDT thread only. UnlikeexecuteCommandInEDT(Runnable), this method executes synchronously
 - 
executeCommandInEDTvoid executeCommandInEDT(@NotNull Runnable r) Represents a write action executed with respect to platform undo mechanism, runs asynchronously from EDT thread. This method may be invoked from any thread.
 - 
executeCommandInEDT@NotNull @Experimental default <T> Future<T> executeCommandInEDT(@NotNull Supplier<T> supplier) 
 - 
executeUndoTransparentCommandvoid executeUndoTransparentCommand(Runnable r) FIXME need thorough documentation Executed code has model write, is treated as a command, the only difference is that changes from the transparent action merged with the that of the previous undoable command
 - 
isCommandActionboolean isCommandAction() - Returns:
- trueif there's a command (either with- executeCommand(Runnable)or- executeCommandInEDT(Runnable)) being executed
 
 - 
addCommandListenervoid addCommandListener(CommandListener listener) add/remove listeners to listen to the start/finish of command events- Parameters:
- listener- listens to command
- See Also:
- executeCommand(Runnable)
 
 - 
removeCommandListenervoid removeCommandListener(CommandListener listener) 
 - 
addWriteActionListenervoid addWriteActionListener(@NotNull WriteActionListener listener) add/remove listeners to listen to the start/finish of write action events- Parameters:
- listener- listens to write action
- See Also:
- runWriteAction(Runnable)
 
 - 
removeWriteActionListenervoid removeWriteActionListener(@NotNull WriteActionListener listener) 
 - 
addReadActionListenervoid addReadActionListener(@NotNull ReadActionListener listener) Get notified about start/finish of a model read action- Since:
- 2018.3
 
 - 
removeReadActionListenervoid removeReadActionListener(@NotNull ReadActionListener listener) Cease notifications about start/finish of a model read action- Since:
- 2018.3
 
 
- 
 
-