Class OpenConsoleLog

All Implemented Interfaces:
IHandler, IHandler2

public class OpenConsoleLog extends AbstractHandler
Help > IIZI > Open iiziGo Log: shows a box that names the IIZI Console's log file and warns that a log can hold values the user may not want to share, and on OK opens the file in the platform's text editor: notepad.exe on Windows, open -t (the default text editor) on macOS, xdg-open elsewhere. When the editor cannot be started, a box names the file's path so that the user can find it (order CC-IIZIGO-CONSOLE-LOG-FILE, ruling L-4).
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • OpenConsoleLog

      public OpenConsoleLog()
      Eclipse default constructor.
  • Method Details

    • execute

      public Object execute(ExecutionEvent event) throws ExecutionException
      Shows the box and opens the log file on OK.
      Parameters:
      event - The execution event.
      Throws:
      ExecutionException - Never.
    • message

      public static String message(File file)
      The text of the box shown before the file opens: the file's path and the warning.
      Parameters:
      file - The log file.
      Returns:
      The text.
    • command

      public static String[] command(File file, boolean isWindows, boolean isMac)
      The command that opens the file in the platform's text editor.
      Parameters:
      file - The file.
      isWindows - Windows: notepad.exe.
      isMac - macOS: open -t, the default text editor; neither: xdg-open.
      Returns:
      The command and its arguments.
    • launch

      public static Process launch(File file) throws IOException
      Starts the platform's text editor on the file.
      Parameters:
      file - The file.
      Returns:
      The editor process (on Windows and macOS a launcher that ends at once).
      Throws:
      IOException - If the editor cannot be started.