Package com.github.masahirosuzuka.PhoneGapIntelliJPlugin.externalToolsDetector

Source Code of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.externalToolsDetector.iOSSDKdetectorThread

package com.github.masahirosuzuka.PhoneGapIntelliJPlugin.externalToolsDetector;

import com.github.masahirosuzuka.PhoneGapIntelliJPlugin.settings.PhoneGapSettings;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.project.Project;

/**
* iOSSDKdetectorThread.java
*
* Created by Masahiro Suzuka on 2014/04/25.
*/
public class iOSSDKdetectorThread implements Runnable{

  private Project project;

  public iOSSDKdetectorThread(final Project project) {
    this.project = project;
  }

  @Override
  public void run() {
    final GeneralCommandLine generalCommandLine = new GeneralCommandLine(PhoneGapSettings.IOS_SIM, "--version");
    generalCommandLine.setWorkDirectory(project.getBasePath());
    try {
      generalCommandLine.createProcess();
    } catch (Exception e) {
      /* ios-sim not run */
      String groupeDisplayId = "PhoneGap notification";
      String notificationTitle = "PhoneGap Plugin";
      String notificationMessage = "ios-sim not detected";
      NotificationType notificationType = NotificationType.ERROR;
      Notification notification = new Notification(groupeDisplayId, notificationTitle, notificationMessage, notificationType);

      Notifications.Bus.notify(notification);
    }

  }
}
TOP

Related Classes of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.externalToolsDetector.iOSSDKdetectorThread

TOP
Copyright © 2018 www.massapi.com. 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.