com.intellij.ide.plugins.PluginManager Java Examples

The following examples show how to use com.intellij.ide.plugins.PluginManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WakaTime.java    From jetbrains-wakatime with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void initComponent() {
    VERSION = PluginManager.getPlugin(PluginId.getId("com.wakatime.intellij.plugin")).getVersion();
    log.info("Initializing WakaTime plugin v" + VERSION + " (https://wakatime.com/)");
    //System.out.println("Initializing WakaTime plugin v" + VERSION + " (https://wakatime.com/)");

    // Set runtime constants
    IDE_NAME = PlatformUtils.getPlatformPrefix();
    IDE_VERSION = ApplicationInfo.getInstance().getFullVersion();

    setupDebugging();
    setLoggingLevel();
    Dependencies.configureProxy();
    checkApiKey();
    checkCli();
    setupEventListeners();
    setupQueueProcessor();
    checkDebug();
    log.info("Finished initializing WakaTime plugin");
}
 
Example #2
Source File: ImageManagerImpl.java    From ycy-intellij-plugin with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 从插件 jar 中获取默认图片列表
 *
 * <p>默认图片地址是 "jar:file://{@code ${pluginPath}}/ycy-intellij-plugin.jar!/images/1.jpg"</p>
 */
private List<URL> init() {
    PluginId pluginId = PluginId.getId(GlobalConfig.PLUGIN_ID);
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(pluginId);
    if (plugin == null) {
        LOG.error("fail to get plugin \"" + GlobalConfig.PLUGIN_ID + "\"");
        throw new NullPointerException("fail to get plugin \"" + GlobalConfig.PLUGIN_ID + "\"");
    }

    File pluginPath = plugin.getPath();
    try {
        List<URL> defaultImageUrlList = new ArrayList<>(10);
        for (int i = 1; i <= 10; i++) {
            final String imageUrlPath = "jar:" + pluginPath.toURI().toURL().toString() + "!/images/" + i + ".jpg";
            URL imageUrl = new URL(imageUrlPath);
            defaultImageUrlList.add(imageUrl);
        }
        return defaultImageUrlList;
    } catch (MalformedURLException e) {
        LOG.error("fail to get the default image url list", e);
        throw new RuntimeException("fail to get the default imageUrl", e);
    }
}
 
Example #3
Source File: PluginsAdvertiserHolder.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static void update(@Nullable List<PluginDescriptor> list) {
  ourLoadedPluginDescriptors = ContainerUtil.isEmpty(list) ? null : list;

  if (list != null) {
    InstalledPluginsState pluginsState = InstalledPluginsState.getInstance();

    for (PluginDescriptor newPluginDescriptor : list) {
      final PluginDescriptor installed = PluginManager.getPlugin(newPluginDescriptor.getPluginId());
      if (installed != null) {
        int state = StringUtil.compareVersionNumbers(newPluginDescriptor.getVersion(), installed.getVersion());

        if (state > 0 &&
            !PluginManager.isIncompatible(newPluginDescriptor) &&
            !pluginsState.getUpdatedPlugins().contains(newPluginDescriptor.getPluginId())) {
          pluginsState.getOutdatedPlugins().add(newPluginDescriptor.getPluginId());
        }
      }
    }
  }
}
 
Example #4
Source File: InstalledPluginsState.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void updateExistingPluginInfo(PluginDescriptor descr, PluginDescriptor existing) {
  int state = StringUtil.compareVersionNumbers(descr.getVersion(), existing.getVersion());
  final PluginId pluginId = existing.getPluginId();
  final Set<PluginId> installedPlugins = InstalledPluginsState.getInstance().getInstalledPlugins();
  if (!installedPlugins.contains(pluginId) && !existing.isDeleted()) {
    installedPlugins.add(pluginId);
  }
  if (state > 0 && !PluginManager.isIncompatible(descr) && !myUpdatedPlugins.contains(descr.getPluginId())) {
    myNewVersions.add(pluginId);

    myOutdatedPlugins.add(pluginId);
  }
  else {
    myOutdatedPlugins.remove(pluginId);

    if (myNewVersions.remove(pluginId)) {
      myUpdatedPlugins.add(pluginId);
    }
  }
}
 
Example #5
Source File: PluginUtils.java    From intellij with Apache License 2.0 6 votes vote down vote up
/** Install and/or enable the given plugins. Does nothing for plugins already enabled. */
public static void installOrEnablePlugins(Set<String> pluginIds) {
  Set<String> toInstall = new HashSet<>();
  for (String id : pluginIds) {
    if (isPluginEnabled(id)) {
      continue;
    }
    if (isPluginInstalled(id)) {
      if (!PluginManager.enablePlugin(id)) {
        notifyPluginEnableFailed(id);
      }
    } else {
      toInstall.add(id);
    }
  }
  if (!toInstall.isEmpty()) {
    PluginsAdvertiser.installAndEnablePlugins(toInstall, EmptyRunnable.INSTANCE);
  }
}
 
Example #6
Source File: ConsoleLog.java    From aem-ide-tooling-4-intellij with Apache License 2.0 6 votes vote down vote up
@Override
public void notify(@NotNull Notification notification) {
    try {
        final ProjectManager projectManager = ProjectManager.getInstance();
        if(projectManager != null) {
            final Project[] openProjects = projectManager.getOpenProjects();
            if(openProjects.length == 0) {
                if(myModel != null) {
                    myModel.addNotification(notification);
                }
            }
            for(Project p : openProjects) {
                ConsoleLogProjectTracker consoleLogProjectTracker = getProjectComponent(p);
                if(consoleLogProjectTracker != null) {
                    consoleLogProjectTracker.printNotification(notification);
                }
            }
        } else {
            PluginManager.getLogger().error("Project Manager could not be retrieved");
        }
    } catch(Exception e) {
        PluginManager.getLogger().error("Could not Notify to Console Log Project Tracker", e);
    }
}
 
Example #7
Source File: RestUtils.java    From SmartIM4IntelliJ with Apache License 2.0 6 votes vote down vote up
public static String getWelcome(String im) {
    try {
        final IdeaPluginDescriptor descriptor =
            PluginManager.getPlugin(PluginId.findId("cn.ieclipse.smartqq.intellij"));
        Request.Builder builder =
            new Request.Builder().url(String.format(welcome_format, "intellij", im, descriptor.getVersion())).get();
        Request request = builder.build();
        Call call = new OkHttpClient().newCall(request);
        Response response = call.execute();
        String json = response.body().string();
        if (response.code() == 200) {
            return json;
        }
    } catch (Exception e) {
    }
    return null;
}
 
Example #8
Source File: TYPO3DetectionListener.java    From idea-php-typo3-plugin with MIT License 6 votes vote down vote up
@Override
public void projectOpened(@NotNull Project project) {
    this.checkProject(project);

    TYPO3CMSSettings instance = TYPO3CMSSettings.getInstance(project);
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("com.cedricziel.idea.typo3"));
    if (plugin == null) {
        return;
    }

    String version = instance.getVersion();
    if (version == null || !plugin.getVersion().equals(version)) {
        instance.setVersion(plugin.getVersion());

        FileBasedIndex index = FileBasedIndex.getInstance();
        index.scheduleRebuild(CoreServiceMapStubIndex.KEY, new Throwable());
        index.scheduleRebuild(ExtensionNameStubIndex.KEY, new Throwable());
        index.scheduleRebuild(IconIndex.KEY, new Throwable());
        index.scheduleRebuild(ResourcePathIndex.KEY, new Throwable());
        index.scheduleRebuild(RouteIndex.KEY, new Throwable());
        index.scheduleRebuild(TablenameFileIndex.KEY, new Throwable());
        index.scheduleRebuild(LegacyClassesForIDEIndex.KEY, new Throwable());
        index.scheduleRebuild(MethodArgumentDroppedIndex.KEY, new Throwable());
        index.scheduleRebuild(ControllerActionIndex.KEY, new Throwable());
    }
}
 
Example #9
Source File: ServiceHelperCompat.java    From intellij with Apache License 2.0 6 votes vote down vote up
public static <T> void registerService(
    ComponentManager componentManager,
    Class<T> key,
    T implementation,
    Disposable parentDisposable) {
  @SuppressWarnings({"rawtypes", "unchecked"}) // #api193: wildcard generics added in 2020.1
  List<? extends IdeaPluginDescriptor> loadedPlugins = (List) PluginManager.getLoadedPlugins();
  Optional<? extends IdeaPluginDescriptor> platformPlugin =
      loadedPlugins.stream()
          .filter(descriptor -> descriptor.getName().startsWith("IDEA CORE"))
          .findAny();

  Verify.verify(platformPlugin.isPresent());

  ((ComponentManagerImpl) componentManager)
      .registerServiceInstance(key, implementation, platformPlugin.get());
}
 
Example #10
Source File: IdeErrorsDialog.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void addPluginIdByClassName(String className, Set<PluginId> pluginIds) {
  if (PluginManager.isPluginClass(className)) {
    PluginId pluginByClassName = PluginManager.getPluginByClassName(className);
    if (pluginByClassName == null) {
      return;
    }
    pluginIds.add(pluginByClassName);
  }
}
 
Example #11
Source File: WebContainerStartup.java    From consulo with Apache License 2.0 5 votes vote down vote up
private void startApplication(@Nonnull StatCollector stat, @Nonnull String[] args) {
  Runnable appInitializeMark = stat.mark(StatCollector.APP_INITIALIZE);

  StartupUtil.prepareAndStart(args, WebImportantFolderLocker::new, (newConfigFolder, commandLineArgs) -> {
    ApplicationStarter app = new ApplicationStarter(WebPostStarter.class, commandLineArgs);

    AppExecutorUtil.getAppExecutorService().execute(() -> {
      PluginManager.installExceptionHandler();
      app.run(stat, appInitializeMark, newConfigFolder);
    });
  });
}
 
Example #12
Source File: AlwaysPresentGoSyncPlugin.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public boolean validate(
    Project project, BlazeContext context, BlazeProjectData blazeProjectData) {
  if (!blazeProjectData.getWorkspaceLanguageSettings().isLanguageActive(LanguageClass.GO)
      || PluginUtils.isPluginEnabled(GO_PLUGIN_ID)) {
    return true;
  }
  if (PluginUtils.isPluginEnabled(OLD_GO_PLUGIN_ID)) {
    String error =
        String.format(
            "The currently installed Go plugin is no longer supported by the %s plugin.\n"
                + "Click here to install the new JetBrains Go plugin and restart.",
            Blaze.defaultBuildSystemName());
    IssueOutput.error(error)
        .navigatable(
            new NavigatableAdapter() {
              @Override
              public void navigate(boolean requestFocus) {
                PluginManager.disablePlugin(OLD_GO_PLUGIN_ID);
                PluginUtils.installOrEnablePlugin(GO_PLUGIN_ID);
              }
            })
        .submit(context);
    return true;
  }
  IssueOutput.error(
          "Go support requires the Go plugin. Click here to install/enable the JetBrains Go "
              + "plugin, then restart the IDE")
      .navigatable(PluginUtils.installOrEnablePluginNavigable(GO_PLUGIN_ID))
      .submit(context);
  return true;
}
 
Example #13
Source File: ServiceHelperCompat.java    From intellij with Apache License 2.0 5 votes vote down vote up
public static <T> void registerService(
    ComponentManager componentManager,
    Class<T> key,
    T implementation,
    Disposable parentDisposable) {
  Optional<IdeaPluginDescriptor> platformPlugin =
      PluginManager.getLoadedPlugins().stream()
          .filter(descriptor -> descriptor.getName().startsWith("IDEA CORE"))
          .findAny();

  Verify.verify(platformPlugin.isPresent());

  ((PlatformComponentManagerImpl) componentManager)
      .registerServiceInstance(key, implementation, platformPlugin.get());
}
 
Example #14
Source File: NonBlazeProducerSuppressor.java    From intellij with Apache License 2.0 5 votes vote down vote up
private static Collection<Class<? extends RunConfigurationProducer<?>>> getProducers(
    String pluginId, Collection<String> qualifiedClassNames) {
  // rather than compiling against additional plugins, and including a switch in the our
  // plugin.xml, just get the classes manually via the plugin class loader.
  IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(pluginId));
  if (plugin == null || !plugin.isEnabled()) {
    return ImmutableList.of();
  }
  ClassLoader loader = plugin.getPluginClassLoader();
  return qualifiedClassNames
      .stream()
      .map((qualifiedName) -> loadClass(loader, qualifiedName))
      .filter(Objects::nonNull)
      .collect(Collectors.toList());
}
 
Example #15
Source File: OpenTerminalAction.java    From MavenHelper with Apache License 2.0 5 votes vote down vote up
private boolean isPluginEnabled() {
	IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("org.jetbrains.plugins.terminal"));
	if (plugin != null) {
		return plugin.isEnabled();
	}
	return false;
}
 
Example #16
Source File: FastBuildCompilerFactoryImpl.java    From intellij with Apache License 2.0 5 votes vote down vote up
private static File findFastBuildJavacJar() {
  IdeaPluginDescriptor blazePlugin =
      PluginManager.getPlugin(
          PluginManager.getPluginByClassName(FastBuildCompilerFactoryImpl.class.getName()));
  return Paths.get(blazePlugin.getPath().getAbsolutePath())
      .resolve(FAST_BUILD_JAVAC_JAR)
      .toFile();
}
 
Example #17
Source File: MigrationsToolWindow.java    From yiistorm with MIT License 5 votes vote down vote up
public void openMigrationFile(final String name) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
            String migrationPath = yiiProtected.replace(_project.getBasePath(), "").replace("\\", "/");
            VirtualFile baseDir = _project.getBaseDir();
            if (baseDir != null) {
                VirtualFile migrationsFolder = baseDir.findFileByRelativePath(migrationPath + "migrations/");
                if (migrationsFolder != null) {
                    migrationsFolder.refresh(false, true);
                    VirtualFile migrationFile = migrationsFolder.findFileByRelativePath(name + ".php"); //migrationPath + "migrations/" +
                    if (migrationFile != null) {
                        OpenFileDescriptor of = new OpenFileDescriptor(_project, migrationFile);
                        if (of.canNavigate()) {
                            of.navigate(true);
                        }
                    } else {
                        PluginManager.getLogger().error("Migrations file not founded");
                    }
                } else {
                    PluginManager.getLogger().error("Migrations folder not founded");
                }
            }
        }
    });

}
 
Example #18
Source File: PlatformComponentManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void handleInitComponentError(@Nonnull Throwable ex, @Nullable Class componentClass, @Nullable ComponentConfig config) {
  if (!myHandlingInitComponentError) {
    myHandlingInitComponentError = true;
    try {
      PluginManager.handleComponentError(ex, componentClass, config);
    }
    finally {
      myHandlingInitComponentError = false;
    }
  }
}
 
Example #19
Source File: SarosToolWindowFactory.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
  SarosMainPanelView sarosMainPanelView = new SarosMainPanelView(project);

  Content content =
      toolWindow
          .getContentManager()
          .getFactory()
          .createContent(
              sarosMainPanelView,
              PluginManager.getPlugin(PluginId.getId(SarosComponent.PLUGIN_ID)).getName(),
              false);
  toolWindow.getContentManager().addContent(content);
}
 
Example #20
Source File: IntellijVersionProvider.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the version number of the used Saros plugin.
 *
 * @return the version number of the used Saros plugin
 */
public static String getPluginVersion() {
  IdeaPluginDescriptor sarosPluginDescriptor =
      PluginManager.getPlugin(PluginId.getId(SarosComponent.PLUGIN_ID));

  if (sarosPluginDescriptor == null) {
    throw new IllegalStateException(
        "No plugin with the id \"" + SarosComponent.PLUGIN_ID + "\" was found");
  }

  return sarosPluginDescriptor.getVersion();
}
 
Example #21
Source File: WebDeploymentUtil.java    From idea-php-symfony2-plugin with MIT License 5 votes vote down vote up
public static boolean isEnabled(@Nullable Project project) {
    if(!Symfony2ProjectComponent.isEnabled(project)) {
        return false;
    }

    if(PLUGIN_ENABLED == null) {
        IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("com.jetbrains.plugins.webDeployment"));
        PLUGIN_ENABLED = plugin != null && plugin.isEnabled();
    }

    return PLUGIN_ENABLED;
}
 
Example #22
Source File: GraphQLPsiSearchHelper.java    From js-graphql-intellij-plugin with MIT License 5 votes vote down vote up
public GraphQLPsiSearchHelper(@NotNull final Project project) {
    myProject = project;
    mySettings = GraphQLSettings.getSettings(project);
    psiManager = PsiManager.getInstance(myProject);
    graphQLInjectionSearchHelper = ServiceManager.getService(GraphQLInjectionSearchHelper.class);
    injectedLanguageManager = InjectedLanguageManager.getInstance(myProject);
    graphQLConfigManager = GraphQLConfigManager.getService(myProject);
    pluginDescriptor = PluginManager.getPlugin(PluginId.getId("com.intellij.lang.jsgraphql"));

    final PsiFileFactory psiFileFactory = PsiFileFactory.getInstance(myProject);
    defaultProjectFile = (GraphQLFile) psiFileFactory.createFileFromText("Default schema file", GraphQLLanguage.INSTANCE, "");

    GlobalSearchScope defaultProjectFileScope = GlobalSearchScope.fileScope(defaultProjectFile);
    GlobalSearchScope builtInSchemaScope = GlobalSearchScope.fileScope(project, getBuiltInSchema().getVirtualFile());
    GlobalSearchScope builtInRelaySchemaScope = GlobalSearchScope.fileScope(project, getRelayModernDirectivesSchema().getVirtualFile());
    allBuiltInSchemaScopes = builtInSchemaScope
            .union(new ConditionalGlobalSearchScope(builtInRelaySchemaScope, mySettings::isEnableRelayModernFrameworkSupport))
            .union(defaultProjectFileScope)
    ;

    final FileType[] searchScopeFileTypes = GraphQLFindUsagesUtil.getService().getIncludedFileTypes().toArray(FileType.EMPTY_ARRAY);
    searchScope = GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.projectScope(myProject), searchScopeFileTypes).union(allBuiltInSchemaScopes);
    project.getMessageBus().connect().subscribe(PsiManagerImpl.ANY_PSI_CHANGE_TOPIC, new AnyPsiChangeListener.Adapter() {
        @Override
        public void beforePsiChanged(boolean isPhysical) {
            // clear the cache on each PSI change
            fileNameToSchemaScope.clear();
        }
    });
}
 
Example #23
Source File: SymfonyInstallerUtil.java    From idea-php-symfony2-plugin with MIT License 5 votes vote down vote up
@Nullable
public static String getDownloadVersions() {

    String userAgent = String.format("%s / %s / Symfony Plugin %s",
        ApplicationInfo.getInstance().getVersionName(),
        ApplicationInfo.getInstance().getBuild(),
        PluginManager.getPlugin(PluginId.getId("fr.adrienbrault.idea.symfony2plugin")).getVersion()
    );

    try {

        // @TODO: PhpStorm9:
        // simple replacement for: com.intellij.util.io.HttpRequests
        URL url = new URL("https://symfony.com/versions.json");
        URLConnection conn = url.openConnection();
        conn.setRequestProperty("User-Agent", userAgent);
        conn.connect();

        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));

        String content = "";
        String line;
        while ((line = in.readLine()) != null) {
            content += line;
        }

        in.close();

        return content;
    } catch (IOException e) {
        return null;
    }

}
 
Example #24
Source File: AboutForm.java    From netbeans-mmd-plugin with Apache License 2.0 5 votes vote down vote up
public AboutForm() {
  final IdeaPluginDescriptor descriptor = PluginManager.getPlugin(PluginId.getId("nb-mind-map-idea"));
  this.htmlLabelText.setText(BUNDLE.getString("AboutText").replace("${version}", descriptor == null ? "<unknown>" : descriptor.getVersion()));
  this.htmlLabelText.addLinkListener(new JHtmlLabel.LinkListener() {
    @Override
    public void onLinkActivated(final JHtmlLabel source, final String link) {
      try {
        IdeaUtils.browseURI(URI.create(link), false);
      } catch (Exception ex) {
        ex.printStackTrace();
      }
    }
  });
  this.mainPanel.setPreferredSize(new Dimension(600, 345));
}
 
Example #25
Source File: MainWindowBase.java    From KodeBeagle with Apache License 2.0 5 votes vote down vote up
private void initSystemInfo() {
    windowObjects.setOptionalDependencyPresent(checkOptionalDependency());
    windowObjects.setOsInfo(System.getProperty(OS_NAME) + "/"
            + System.getProperty(OS_VERSION));
    windowObjects.setApplicationVersion(ApplicationInfo.getInstance().getVersionName()
            + "/" + ApplicationInfo.getInstance().getBuild().toString());
    IdeaPluginDescriptor kodeBeagleVersion =
            PluginManager.getPlugin(PluginId.getId(PLUGIN_ID));

    if (kodeBeagleVersion != null) {
        windowObjects.setPluginVersion(IDEA_PLUGIN + "/" + kodeBeagleVersion.getVersion());
    }
}
 
Example #26
Source File: MainWindow.java    From KodeBeagle with Apache License 2.0 5 votes vote down vote up
public static boolean scalaPluginInstalledAndEnabled() {
    if (PLUGIN_AVAILABLE) {
        IdeaPluginDescriptor descriptor =
                PluginManager.getPlugin(PluginId.getId(SCALA_PLUGIN_ID));
        return descriptor != null && descriptor.isEnabled();
    } else {
        return false;
    }
}
 
Example #27
Source File: SamplePluginController.java    From jetbrains-plugin-sample with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void projectOpened() {
	IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(PLUGIN_ID));
	String version = "unknown";
	if ( plugin!=null ) {
		version = plugin.getVersion();
	}
	LOG.info("Sample Plugin version "+version+", Java version "+ SystemInfo.JAVA_VERSION);
}
 
Example #28
Source File: ShopwareInstallerUtil.java    From idea-php-shopware-plugin with MIT License 5 votes vote down vote up
@Nullable
public static String getDownloadVersions() {

    String userAgent = String.format("%s / %s / Shopware Plugin %s",
        ApplicationInfo.getInstance().getVersionName(),
        ApplicationInfo.getInstance().getBuild(),
        PluginManager.getPlugin(PluginId.getId("de.espend.idea.shopware")).getVersion()
    );

    try {

        // @TODO: PhpStorm9:
        // simple replacement for: com.intellij.util.io.HttpRequests
        URL url = new URL("http://update-api.shopware.com/v1/releases/install?major=6");
        URLConnection conn = url.openConnection();
        conn.setRequestProperty("User-Agent", userAgent);
        conn.connect();

        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));

        StringBuilder content = new StringBuilder();
        String line;
        while ((line = in.readLine()) != null) {
            content.append(line);
        }

        in.close();

        return content.toString();
    } catch (IOException e) {
        return null;
    }

}
 
Example #29
Source File: GaugeExceptionHandler.java    From Intellij-Plugin with Apache License 2.0 5 votes vote down vote up
private Notification createNotification(String stacktrace, int exitValue) {
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.findId("com.thoughtworks.gauge"));
    String pluginVersion = plugin == null ? "" : plugin.getVersion();
    String apiVersion = ApplicationInfo.getInstance().getApiVersion();
    String ideaVersion = ApplicationInfo.getInstance().getFullVersion();
    String gaugeVersion = GaugeVersion.getVersion(false).version;
    String body = String.format(ISSUE_TEMPLATE, exitValue,stacktrace, ideaVersion, apiVersion, pluginVersion, gaugeVersion);
    String content = String.format(NOTIFICATION_TEMPLATE, LINE_BREAK, body);
    return new Notification("Gauge Exception", NOTIFICATION_TITLE, content, NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER);
}
 
Example #30
Source File: HaxeDebugRunner.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
private RunContentDescriptor runFlash(final Module module,
                                      final HaxeModuleSettings settings,
                                      final ExecutionEnvironment env,
                                      final Executor executor,
                                      final String launchPath)
  throws ExecutionException {
  final IdeaPluginDescriptor plugin =
    PluginManager.getPlugin(PluginId.getId("com.intellij.flex"));
  if (plugin == null) {
    throw new ExecutionException
      (HaxeBundle.message("install.flex.plugin"));
  }
  if (!plugin.isEnabled()) {
    throw new ExecutionException
      (HaxeBundle.message("enable.flex.plugin"));
  }

  String flexSdkName = settings.getFlexSdkName();
  if (StringUtil.isEmpty(flexSdkName)) {
    throw new ExecutionException
      (HaxeBundle.message("flex.sdk.not.specified"));
  }

  if (settings.isUseNmmlToBuild()) {
    return HaxeFlashDebuggingUtil.getNMEDescriptor
      (this, module, env, executor, flexSdkName);
  }
  else if (settings.isUseOpenFLToBuild()) {
    return HaxeFlashDebuggingUtil.getOpenFLDescriptor
      (this, module, env, executor, flexSdkName);
  }
  else {
    return HaxeFlashDebuggingUtil.getDescriptor
      (module, env, launchPath, flexSdkName);
  }
}