command.java

来自「Java开发图文混排的编辑器」· Java 代码 · 共 43 行

JAVA
43
字号
/*
 * Created on 2004-7-18
 * Author: Xuefeng, Copyright (C) 2004, Xuefeng.
 */
package jexi.core.command;

/**
 * Command interface.
 * 
 * @author Xuefeng
 */
public interface Command {

    /**
     * Execute this command. If succeeded (return TRUE), the 
     * CommandManager will put this command into command list 
     * if this command can support undo. 
     * 
     * @return True if the command executed succussfully.
     */
    boolean execute();

    /**
     * Undo this command. This is used to implement "Undo"
     */
    void unexecute();

    /**
     * If this command can support undo. Some commands not support 
     * undo such as CopyCommand, PastCommand. 
     * 
     * @return True if this command can undo.
     */
    boolean canUndo();

    /**
     * Get the command detail. 
     * 
     * @return The command description.
     */
    String toString();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?