Interface Command

    • Method Detail

      • executeAndFlush

        static void executeAndFlush​(Command cmd)
        Execute if possible (canDo) the given command (if not null) and flush it.
        Parameters:
        cmd - The command to execute. Nothing done if null.
      • flush

        void flush()
        Flushes the command. Can be useful to close streams, free objects, etc. A command should flushed manually only when it is not managed by the cmd registry of the application. When a command is gathered and managed by a command registry, it is automatically flushed when the command registry removes the cmd.
      • getRegistrationPolicy

        Command.RegistrationPolicy getRegistrationPolicy()
        Specifies whether the command must be saved in the cmd register. For instance, some commands, such as a scroll, should not be saved or put in the undo/redo manager. Such commands should not be registrable.
        Returns:
        The registration policy.
      • doIt

        boolean doIt()
        This method manages the execution of the command.
        Returns:
        True: the execution of the command is OK.
      • canDo

        boolean canDo()
        Checks whether the command can be executed.
        Returns:
        True if the command can be executed.
        Since:
        0.1
      • hadEffect

        boolean hadEffect()
        State whether the execution of this command has effects on the system.
        Returns:
        True: the command has effects on the system.
      • unregisteredBy

        boolean unregisteredBy​(Command cmd)
        Checks whether the current command can be cancelled by the given one.
        Parameters:
        cmd - The command to check whether it can cancel the current cmd.
        Returns:
        True: The given command can cancel the current cmd.
      • done

        void done()
        Marks the command as "done" and sends it to the cmd registry.
        Since:
        0.1
      • isDone

        boolean isDone()
        To know whether the command has been marked as 'done'.
        Returns:
        True: the command has been marked as 'done'.
      • cancel

        void cancel()
        Marks the command has aborted.
      • getStatus

        Command.CmdStatus getStatus()
        Provides the status of the command.
        Returns:
        The status of the command.
        Since:
        0.2