• 处理TC的Command问题


    需求:因为TC的Command执行操作是,是另起一个线程,那么该怎么知道它是否结束该线程了?

    解决方法,给Command添加一个监听事件

    isCommandFinish = true;
    if(deleteTcContextList.size()> 0){
      isCommandFinish = false;
      AIFComponentContext[] tcContexts = new AIFComponentContext[deleteTcContextList.size()];
      tcContexts = deleteTcContextList.toArray(tcContexts);
      DeleteCommand deleteCommand = new DeleteCommand(tcContexts,app.getDesktop());
      deleteCommand.addCommandListener(new ICommandListener() {
    							
      @Override
      public void commandStarting(ICommandListenerEvent paramICommandListenerEvent) {
        // TODO Auto-generated method stub
    	System.out.println("command开始!!");
      }
        @Override
       public void commandDone(ICommandListenerEvent paramICommandListenerEvent) {
    	// TODO Auto-generated method stub
    	isCommandFinish = true;
      }
    });
    deleteCommand.executeModeless();
    }

      

      

  • 相关阅读:
    函数如何命名
    jsp/servlet
    hibernate主键生成策略
    Java项目经验(ssh)
    jvm的内存区划分
    @Override
    Java成长简介(转载)
    接口 转载
    SpringBoot项目jar、war方式的部署
    服务注册与发现及其优雅停服
  • 原文地址:https://www.cnblogs.com/wwssgg/p/14690150.html
Copyright © 2020-2023  润新知