Class ReadWriteOptionDialog

java.lang.Object
com.inductiveautomation.ignition.client.util.gui.ReadWriteOptionDialog

public class ReadWriteOptionDialog extends Object
Options dialog used to allow users to immediately (or temporarily) elevate their comm mode for a particular operation
  • Field Details

  • Method Details

    • runWriteProtectedAction

      public static <T, E extends Exception> T runWriteProtectedAction(FragileSupplier<T,E> action) throws RpcException, E
      From the EDT, runs an action that may require the designer's "comm mode" setting to be read/write. If it is not, the user is show an option to enable read/write mode, or enable read/write mode for one action - if so, when this function returns the comm mode will have returned to what it was before.
      Parameters:
      action - Some action to take, which can throw an exception. That exception will be thrown directly.
      Returns:
      The successful result of the provided lambda, if the user was already in read/write or accepted elevation to read/write.
      Throws:
      RpcException
      E extends Exception
    • runReadProtectedAction

      public static <T, E extends Exception> T runReadProtectedAction(FragileSupplier<T,E> action) throws RpcException, E
      From the EDT, runs an action that may require the designer's "comm mode" setting to be read-only. If it is not, the user is show an option to enable read-only mode, or enable read-only mode for one action - if so, when this function returns the comm mode will have returned to what it was before.
      Parameters:
      action - Some action to take, which can throw an exception. That exception will be thrown directly.
      Returns:
      The successful result of the provided lambda, if the user was already in read-only or accepted elevation to read-only.
      Throws:
      RpcException
      E extends Exception
    • showOptionDialog

      public static int showOptionDialog(int mode)
      Show the dialog to the user, asking them to elevate their comm mode.

      Blocking! and must be called from the EDT.

      Parameters:
      mode - The mode to elevate to
      Returns:
      The user's response, one of CANCEL, ELEVATE or ONE_TIME.