当前位置: 首页>>代码示例>>Java>>正文


Java CompileContext.putUserData方法代码示例

本文整理汇总了Java中com.intellij.openapi.compiler.CompileContext.putUserData方法的典型用法代码示例。如果您正苦于以下问题:Java CompileContext.putUserData方法的具体用法?Java CompileContext.putUserData怎么用?Java CompileContext.putUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.compiler.CompileContext的用法示例。


在下文中一共展示了CompileContext.putUserData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addErrorToContext

import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
private static void addErrorToContext(String error, CompileContext context,
                                      String errorRoot)
{
    // TODO: Add a button to the Haxe module settings to control whether we always open the window or not.
    if (context.getUserData(messageWindowAutoOpened) == null) {
        openCompilerMessagesWindow(context);
        context.putUserData(messageWindowAutoOpened, "yes");
    }

    final HaxeCompilerError compilerError = HaxeCompilerError.create
        (errorRoot,
         error,
         !ApplicationManager.getApplication().isUnitTestMode());
    

    if (null != compilerError) {
        context.addMessage
            (compilerError.getCategory(),
             compilerError.getErrorMessage(),
             VfsUtilCore.pathToUrl(compilerError.getPath()),
             compilerError.getLine(),
             compilerError.getColumn());
    }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:25,代码来源:HaxeCompilerUtil.java

示例2: addChangedArtifact

import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
public static void addChangedArtifact(final CompileContext context, Artifact artifact) {
  Set<Artifact> artifacts = context.getUserData(CHANGED_ARTIFACTS);
  if (artifacts == null) {
    artifacts = new THashSet<Artifact>();
    context.putUserData(CHANGED_ARTIFACTS, artifacts);
  }
  artifacts.add(artifact);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ArtifactsCompiler.java

示例3: addWrittenPaths

import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
public static void addWrittenPaths(final CompileContext context, Set<String> writtenPaths) {
  Set<String> paths = context.getUserData(WRITTEN_PATHS_KEY);
  if (paths == null) {
    paths = new THashSet<String>();
    context.putUserData(WRITTEN_PATHS_KEY, paths);
  }
  paths.addAll(writtenPaths);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ArtifactsCompiler.java

示例4: process

import com.intellij.openapi.compiler.CompileContext; //导入方法依赖的package包/类
@NotNull
public ProcessingItem[] process(@NotNull final CompileContext context, @NotNull final ProcessingItem[] items) {
    final ProgressIndicator progressIndicator = context.getProgressIndicator();
    progressIndicator.setIndeterminate(false);
    progressIndicator.setText("Compiling...");

    final double allCount = items.length;
    int processedCount = -1;

    final ArrayList<ProcessingItem> processedItems = new ArrayList<ProcessingItem>();
    final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex();
    final OCamlCompileContext ocamlContext = OCamlCompileContext.createOn(context);

    for (final ProcessingItem item : items) {
        processedCount++;
        progressIndicator.setFraction(processedCount / allCount);

        final VirtualFile file = item.getFile();
        progressIndicator.setText2(OCamlFileUtil.getPathToDisplay(file));

        final VirtualFile destDir = getDestination(file, fileIndex);
        if (destDir == null) {
            context.addMessage(ERROR, "Cannot determine destination directory for \"" + OCamlFileUtil.getPathToDisplay(file) + "\" file.", file.getUrl(), -1, -1);
            continue;
        }

        if (OCamlFileUtil.isOCamlSourceFile(file)) {
            context.putUserData(THERE_WAS_RECOMPILATION, true);
            if (!compile(file, fileIndex, context, ocamlContext, destDir)) continue;
        }
        else {
            try {
                file.copy(this, destDir, file.getName());
            } catch (final IOException e) {
                context.addMessage(ERROR, "Cannot copy \"" + OCamlFileUtil.getPathToDisplay(file) + "\" file to \"" + OCamlFileUtil.getPathToDisplay(destDir) + "\" directory: " + e.getLocalizedMessage(), file.getUrl(), -1, -1);
                continue;
            }
        }
        processedItems.add(item);
    }

    progressIndicator.setFraction(1.0);
    progressIndicator.setText2("");

    return processedItems.toArray(new ProcessingItem[processedItems.size()]);
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:47,代码来源:OCamlCompiler.java


注:本文中的com.intellij.openapi.compiler.CompileContext.putUserData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。