Package com.intellij.util

Examples of com.intellij.util.BooleanValueHolder


    }
    else {
      setupUserProperties(commandLine, context);
    }

    final BooleanValueHolder hasErrors = new BooleanValueHolder(false);

    try {
      final File workingDirectory = new File(FileUtil.toSystemDependentName(workingPath));
      if (!workingDirectory.exists()) {
        if (!workingDirectory.mkdirs()) throw new IOException("Cannot create directory " + workingPath);
      }
      final BaseOSProcessHandler handler = new BaseOSProcessHandler(
        new ProcessBuilder(commandLine).directory(workingDirectory).start(),
        null,
        Charset.defaultCharset()
      );

      handler.addProcessListener(new ProcessAdapter() {
        @Override
        public void onTextAvailable(ProcessEvent event, Key outputType) {
          String[] lines = event.getText().split("\\n");
          if (lines.length > 0) {
            if (lines[0].matches("Error: : unknown option `-python'.")) {
              handler.detachProcess();
              handler.removeProcessListener(this);
              context.errorHandler("Currently active Haxe toolkit doesn't supports Python target. Please install latest version of Haxe toolkit");
              Notifications.Bus.notify(
                new Notification("", "Current version of Haxe toolkit doesn't supports Python target", "You can download latest version of Haxe toolkit at <a href='http://haxe.org/download'>haxe.org/download</a> ", NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER));
              return;
            }
          }
          context.handleOutput(lines);
        }

        @Override
        public void processTerminated(ProcessEvent event) {
          hasErrors.setValue(event.getExitCode() != 0);
          super.processTerminated(event);
        }
      });

      handler.startNotify();
      handler.waitFor();
    }
    catch (IOException e) {
      context.errorHandler("process throw exception: " + e.getMessage());
      return false;
    }

    return !hasErrors.getValue();
  }
View Full Code Here


  private static boolean canAssign(@Nullable final DartClass baseClass, @Nullable DartClass aClass) {
    if (baseClass == null || aClass == null) {
      return true;
    }
    final BooleanValueHolder result = new BooleanValueHolder(false);
    processSuperClasses(new PsiElementProcessor<DartClass>() {
      @Override
      public boolean execute(@NotNull DartClass dartClass) {
        if (dartClass == baseClass) {
          result.setValue(true);
          return false;
        }
        return true;
      }
    }, aClass);
    return result.getValue();
  }
View Full Code Here

TOP

Related Classes of com.intellij.util.BooleanValueHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.