opencommand.java

来自「《Java与模式》一书的源代码」· Java 代码 · 共 35 行

JAVA
35
字号
package com.javapatterns.command.book;

public class OpenCommand implements Command
{
    //this would be used as a receiver, if we had one
    //     private Application _application;

    //this would have been the constructor

/*     public OpenCommand(Application a)
     {
          _application = a;
     }
*/

    public void execute()
    {
/*          String docName = AskUser();
          			
          if (docname != null)
          {
                 Document docOpen = new Document (docName);
                 _application.add(docOpen);
                 _application.open();
          }
*/

        System.out.print("System requested for document...");
        System.out.println("user enters name of document");

        System.out.println("System has opened document. \n");
    }
}

⌨️ 快捷键说明

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