本文整理汇总了Java中com.intellij.ide.plugins.PluginManager.getPluginPath方法的典型用法代码示例。如果您正苦于以下问题:Java PluginManager.getPluginPath方法的具体用法?Java PluginManager.getPluginPath怎么用?Java PluginManager.getPluginPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.plugins.PluginManager
的用法示例。
在下文中一共展示了PluginManager.getPluginPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRunCommandLineImpl
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
@NotNull
public static GeneralCommandLine createRunCommandLineImpl(@NotNull String fileName, @Nullable DebugConnectionInfo debugConnectionInfo, @NotNull Sdk sdk)
{
GeneralCommandLine commandLine = new GeneralCommandLine();
if(debugConnectionInfo != null)
{
String mssdwPath = System.getProperty("mssdw.path");
if(mssdwPath != null)
{
commandLine.withExePath(mssdwPath);
}
else
{
File pluginPath = PluginManager.getPluginPath(MicrosoftDotNetModuleExtension.class);
commandLine.setExePath(new File(pluginPath, "mssdw\\mssdw.exe").getPath());
}
commandLine.addParameter("--port=" + debugConnectionInfo.getPort());
commandLine.addParameter(fileName);
}
else
{
commandLine.setExePath(fileName);
}
return commandLine;
}
示例2: attachJdkAnnotations
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
public static boolean attachJdkAnnotations(@NotNull SdkModificator modificator)
{
File pluginPath = PluginManager.getPluginPath(JavaSdkImpl.class);
File file = new File(pluginPath, "jdk-annotations.jar");
VirtualFile localFile = LocalFileSystem.getInstance().findFileByIoFile(file);
if(localFile == null)
{
LOG.error("jdk annotations not found in: " + file);
return false;
}
VirtualFile jarFile = ArchiveVfsUtil.getArchiveRootForLocalFile(localFile);
if(jarFile == null)
{
LOG.error("jdk annotations is not archive: " + file);
return false;
}
OrderRootType annoType = AnnotationOrderRootType.getInstance();
modificator.removeRoot(jarFile, annoType);
modificator.addRoot(jarFile, annoType);
return true;
}
示例3: appendCoverageArgument
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
@Override
public void appendCoverageArgument(final String sessionDataFilePath, final String[] patterns, final OwnJavaParameters javaParameters, final boolean collectLineInfo, final boolean isSampling)
{
final File agentFile = new File(PluginManager.getPluginPath(JaCoCoCoverageRunner.class), "coverage/jacoco/jacocoagent.jar");
StringBuilder argument = new StringBuilder("-javaagent:");
final String parentPath = handleSpacesInPath(agentFile);
argument.append(parentPath).append(File.separator).append(agentFile.getName());
argument.append("=");
argument.append("destfile=").append(sessionDataFilePath);
argument.append(",append=false");
javaParameters.getVMParametersList().add(argument.toString());
}
示例4: notifyAboutPluginFile
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
@RequiredReadAction
private static void notifyAboutPluginFile(@NotNull final Project project)
{
Unity3dRootModuleExtension moduleExtension = Unity3dModuleExtensionUtil.getRootModuleExtension(project);
if(moduleExtension == null)
{
return;
}
Unity3dDefineByVersion unity3dDefineByVersion = Unity3dProjectImportUtil.getUnity3dDefineByVersion(moduleExtension.getSdk());
final String pluginFileName = unity3dDefineByVersion.getPluginFileName();
if(pluginFileName == null)
{
return;
}
File pluginPath = PluginManager.getPluginPath(UnityPluginFileValidator.class);
final File unityPluginFile = new File(pluginPath, "UnityEditorConsuloPlugin/" + pluginFileName);
if(!unityPluginFile.exists())
{
return;
}
VirtualFile baseDir = project.getBaseDir();
if(baseDir == null)
{
return;
}
List<VirtualFile> targetFiles = new SmartList<>();
VirtualFile fileByRelativePath = baseDir.findFileByRelativePath(ourPath);
if(fileByRelativePath != null)
{
VirtualFile[] children = fileByRelativePath.getChildren();
for(VirtualFile child : children)
{
CharSequence nameSequence = child.getNameSequence();
if(StringUtil.startsWith(nameSequence, "UnityEditorConsuloPlugin") && child.getFileType() == DotNetModuleFileType.INSTANCE)
{
targetFiles.add(child);
}
}
}
if(targetFiles.isEmpty())
{
showNotify(project, pluginFileName, unityPluginFile, "Consulo plugin for UnityEditor is missing<br><a href=\"update\">Install</a>", Collections.emptyList());
}
else
{
VirtualFile firstItem = targetFiles.size() == 1 ? targetFiles.get(0) : null;
if(firstItem != null && VfsUtilCore.virtualToIoFile(firstItem).lastModified() == unityPluginFile.lastModified())
{
return;
}
String title = "Outdated Consulo plugin(s) for UnityEditor can create <a href=\"info\">issues</a>. <a href=\"update\">Update</a> are recommended";
showNotify(project, pluginFileName, unityPluginFile, title, targetFiles);
}
}
示例5: createRunState
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
@NotNull
@Override
protected NodeJSRunState createRunState(@NotNull Module module,
@NotNull Sdk targetSdk,
@NotNull final Executor executor,
@NotNull final ExecutionEnvironment executionEnvironment) throws ExecutionException
{
VirtualFile mocha = NpmRunUtil.findNpmModule(module, MochaPsiElementUtil.MOCHA);
if(mocha == null)
{
throw new ExecutionException("'mocha' module is not installed");
}
VirtualFile fileOrDirectory = getFileOrDirectory();
if(fileOrDirectory == null)
{
throw new ExecutionException((myTargetType == TargetType.DIRECTORY ? "Directory" : "File") + " is not set");
}
NodeJSRunState state = new NodeJSRunState(module, targetSdk, this)
{
@NotNull
@Override
public ConsoleView createConsole(OSProcessHandler processHandler)
{
SMTRunnerConsoleProperties testConsoleProperties = new SMTRunnerConsoleProperties(MochaConfiguration.this, "Mocha", executor);
testConsoleProperties.setIdBasedTestTree(true);
testConsoleProperties.setIfUndefined(TestConsoleProperties.HIDE_PASSED_TESTS, false);
return SMTestRunnerConnectionUtil.createConsole("Mocha", testConsoleProperties);
}
};
state.addArgument(mocha.getPath() + "/bin/_mocha");
File pluginPath = PluginManager.getPluginPath(MochaConfiguration.class);
File mochaReporter = new File(pluginPath, "mocha-consulo");
if(mochaReporter.exists())
{
state.addArgument("--reporter");
state.addArgument(new File(mochaReporter, "lib/mochaIntellijReporter.js").getPath());
state.addArgument("--ui");
state.addArgument("bdd");
}
switch(myTargetType)
{
case DIRECTORY:
state.addArgument("--recursive");
state.addArgument(getDirectoryPath());
break;
case FILE:
state.addArgument(getFilePath());
break;
}
return state;
}
示例6: appendCoverageArgument
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
@Override
public void appendCoverageArgument(final String sessionDataFilePath,
final String[] patterns,
final OwnJavaParameters javaParameters,
final boolean collectLineInfo,
final boolean isSampling)
{
StringBuilder argument = new StringBuilder("-javaagent:");
File agentFile = new File(PluginManager.getPluginPath(IDEACoverageRunner.class), "coverage/consulo/agent.jar");
final String parentPath = handleSpacesInPath(agentFile);
argument.append(parentPath).append(File.separator).append(agentFile.getName());
argument.append("=");
try
{
final File tempFile = createTempFile();
tempFile.deleteOnExit();
write2file(tempFile, sessionDataFilePath);
write2file(tempFile, String.valueOf(collectLineInfo));
write2file(tempFile, Boolean.FALSE.toString()); //append unloaded
write2file(tempFile, Boolean.FALSE.toString());//merge with existing
write2file(tempFile, String.valueOf(isSampling));
if(patterns != null)
{
for(String coveragePattern : patterns)
{
coveragePattern = coveragePattern.replace("$", "\\$").replace(".", "\\.").replaceAll("\\*", ".*");
if(!coveragePattern.endsWith(".*"))
{ //include inner classes
coveragePattern += "(\\$.*)*";
}
write2file(tempFile, coveragePattern);
}
}
argument.append(tempFile.getCanonicalPath());
}
catch(IOException e)
{
LOG.info("Coverage was not enabled", e);
return;
}
javaParameters.getVMParametersList().add(argument.toString());
}