예제 #1
0
파일: Main.java 프로젝트: Hdzi/emacs
  private void commandLoad(Options options) {
    LoadResult result;
    Project project = codeAssist.getProject(options);
    try {
      progressMonitor.attach(project);
      if (options.isFileStdin()) {
        result = codeAssist.load(project, new File("(stdin)"), options.getHereDocReader(inReader));
      } else {
        result = codeAssist.load(project, options.getFile(), options.getEncoding());
      }

      if (options.isPrintAST()) {
        Logger.debug("AST:\n%s", result.getAST());
      }

      if (options.isEmacsFormat()) {
        out.print("(");
        codeAssistError(result, options);
        out.println(")");
      } else {
        codeAssistError(result, options);
      }
    } catch (Exception e) {
      commandException(e, options);
    } finally {
      progressMonitor.detach(project);
    }
  }
예제 #2
0
 @Override
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case MSG_LOAD:
       String fso = (String) msg.obj;
       Bitmap d = loadDrawable(fso);
       if (d != null) {
         LoadResult result = new LoadResult();
         result.fso = fso;
         result.result = d;
         mHandler.obtainMessage(MSG_LOADED, result).sendToTarget();
       }
       break;
   }
 }