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


Java HaxeBundle类代码示例

本文整理汇总了Java中com.intellij.plugins.haxe.HaxeBundle的典型用法代码示例。如果您正苦于以下问题:Java HaxeBundle类的具体用法?Java HaxeBundle怎么用?Java HaxeBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: run

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
private static ProcessingItem[] run(CompileContext context,
                                    ProcessingItem[] items,
                                    ModuleBasedConfiguration configuration) {
  final Module module = configuration.getConfigurationModule().getModule();
  if (module == null) {
    context.addMessage(CompilerMessageCategory.ERROR,
                       HaxeBundle.message("no.module.for.run.configuration", configuration.getName()), null, -1, -1);
    return ProcessingItem.EMPTY_ARRAY;
  }
  HaxeCommonCompilerUtil.CompilationContext compilationContext = createCompilationContext(context, module, configuration);

  if (compileModule(context, module, compilationContext)) {
    final int index = findProcessingItemIndexByModule(items, configuration.getConfigurationModule());
    if (index != -1) {
      return new ProcessingItem[]{items[index]};
    }
  }
  return ProcessingItem.EMPTY_ARRAY;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:20,代码来源:HaxeCompiler.java

示例2: semicolonUnlessPrecededByStatement

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
/**
 * Make a semi-colon optional in the case that it's preceded by a block statement.
 *
 */
public static boolean semicolonUnlessPrecededByStatement(PsiBuilder builder_, int level) {
  if (consumeTokenFast(builder_, OSEMI)) {
    return true;
  }
  int i = -1;
  IElementType previousType = builder_.rawLookup(i);
  while (null != previousType && isWhitespaceOrComment(builder_, previousType)) {
    previousType = builder_.rawLookup(--i);
  }
  if (previousType == HaxeTokenTypes.PRCURLY || previousType == HaxeTokenTypes.OSEMI) {
    return true;
  }
  builder_.error(HaxeBundle.message("parsing.error.missing.semi.colon"));
  return false;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:20,代码来源:HaxeGeneratedParserUtilBase.java

示例3: reparseProjectFiles

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
public static void reparseProjectFiles(@NotNull final Project project) {
  Task.Backgroundable task = new Task.Backgroundable(project, HaxeBundle.message("haxe.project.reparsing"), false) {
    public void run(@NotNull ProgressIndicator indicator) {
      final Collection<VirtualFile> haxeFiles = new ArrayList<VirtualFile>();
      final VirtualFile baseDir = project.getBaseDir();
      if (baseDir != null) {
        FileBasedIndex.getInstance().iterateIndexableFiles(new ContentIterator() {
          public boolean processFile(VirtualFile file) {
            if (HaxeFileType.HAXE_FILE_TYPE == file.getFileType()) {
              haxeFiles.add(file);
            }
            return true;
          }
        }, project, indicator);
      }
      ApplicationManager.getApplication().invokeAndWait(new Runnable() {
        public void run() {
          FileContentUtil.reparseFiles(project, haxeFiles, !project.isDefault());
        }
      }, ModalityState.NON_MODAL);
    }
  };
  ProgressManager.getInstance().run(task);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:25,代码来源:HaxeUtil.java

示例4: compilePresentableDescription

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
private String compilePresentableDescription() {
  final StringBuilder result = new StringBuilder();

  int currentOffset = 0;

  if (parameters.length == 0) {
    return HaxeBundle.message("haxe.parameter.info.helper.no.parameters");
  }

  for (int i = 0; i < parameters.length; i++) {
    HaxeParameterDescription parameter = parameters[i];
    String description = parameter.getPresentableText();
    int descriptionLength = description.length();

    parametersTextRange[i] = new TextRange(currentOffset, currentOffset + descriptionLength);

    if (currentOffset > 0) {
      result.append(PARAMETERS_DELIMITER);
    }
    result.append(description);

    currentOffset += descriptionLength + PARAMETERS_DELIMITER.length();
  }

  return result.toString();
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:27,代码来源:HaxeFunctionDescription.java

示例5: checkConfiguration

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  super.checkConfiguration();
  final HaxeApplicationModuleBasedConfiguration configurationModule = getConfigurationModule();
  final Module module = configurationModule.getModule();
  if (module == null) {
    throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.no.module", getName()));
  }
  final HaxeModuleSettings settings = HaxeModuleSettings.getInstance(module);
  if (settings.isUseHxmlToBuild() && !customFileToLaunch) {
    throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.select.custom.file"));
  }
  if (settings.isUseNmmlToBuild() && customFileToLaunch) {
    throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.do.not.select.custom.file"));
  }
  if (settings.isUseNmmlToBuild() && customExecutable) {
    throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.do.not.select.custom.executable"));
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:20,代码来源:HaxeApplicationConfiguration.java

示例6: run

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
private static ProcessingItem[] run(CompileContext context, ProcessingItem[] items, HaxeApplicationConfiguration haxeApplicationConfiguration)
{
	final Module module = haxeApplicationConfiguration.getConfigurationModule().getModule();
	if(module == null)
	{
		context.addMessage(CompilerMessageCategory.ERROR, HaxeBundle.message("no.module.for.run.configuration", haxeApplicationConfiguration.getName()), null, -1, -1);
		return ProcessingItem.EMPTY_ARRAY;
	}
	if(compileModule(context, module))
	{
		final int index = findProcessingItemIndexByModule(items, haxeApplicationConfiguration.getConfigurationModule());
		if(index != -1)
		{
			return new ProcessingItem[]{items[index]};
		}
	}
	return ProcessingItem.EMPTY_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:19,代码来源:HaxeCompiler.java

示例7: getCommandForNeko

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
private GeneralCommandLine getCommandForNeko(@Nullable HaxeSdkData sdkData, HaxeModuleSettings settings) throws ExecutionException {
  if (sdkData == null || sdkData.getNekoBinPath() == null || sdkData.getNekoBinPath().isEmpty()) {
    throw new ExecutionException(HaxeBundle.message("haxe.run.bad.neko.bin.path"));
  }

  GeneralCommandLine commandLine = new GeneralCommandLine();

  commandLine.setExePath(sdkData.getNekoBinPath());
  commandLine.setWorkDirectory(module.getModuleDirPath());

  if (customFileToLaunch != null) {
    commandLine.addParameter(customFileToLaunch);
  }
  else {
    final VirtualFile outputDirectory = CompilerPathsImpl.getModuleOutputDirectory(module, false);
    final VirtualFile fileToLaunch = outputDirectory != null ? outputDirectory.findChild(settings.getOutputFileName()) : null;
    if (fileToLaunch != null) {
      commandLine.addParameter(fileToLaunch.getPath());
    }
  }

  final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
  setConsoleBuilder(consoleBuilder);
  return commandLine;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:26,代码来源:NekoRunningState.java

示例8: checkFile

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
  final boolean isNmml = FileUtilRt.extensionEquals(file.getName(), NMMLFileType.DEFAULT_EXTENSION);
  if (!isNmml || !(file instanceof XmlFile)) {
    return ProblemDescriptor.EMPTY_ARRAY;
  }
  MyVisitor visitor = new MyVisitor();
  file.accept(visitor);

  if (ContainerUtil.exists(visitor.getResult(), new Condition<XmlTag>() {
    @Override
    public boolean value(XmlTag tag) {
      final XmlAttribute ifAttribute = tag.getAttribute("if");
      return "debug".equals(ifAttribute != null ? ifAttribute.getValue() : null);
    }
  })) {
    // all good
    return ProblemDescriptor.EMPTY_ARRAY;
  }

  final XmlTag lastTag = ContainerUtil.iterateAndGetLastItem(visitor.getResult());

  if (lastTag == null) {
    return ProblemDescriptor.EMPTY_ARRAY;
  }

  final ProblemDescriptor descriptor = manager.createProblemDescriptor(
    lastTag,
    HaxeBundle.message("haxe.inspections.nme.build.directory.descriptor"),
    new AddTagFix(),
    ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
    isOnTheFly
  );

  return new ProblemDescriptor[]{descriptor};
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:37,代码来源:NMEBuildDirectoryInspection.java

示例9: getGenerateHandler

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
protected BaseHaxeGenerateHandler getGenerateHandler() {
  return new HaxeGenerateAccessorHandler(CreateGetterSetterFix.Strategy.GETTER) {
    @Override
    protected String getTitle() {
      return HaxeBundle.message("fields.to.generate.getters");
    }
  };
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:10,代码来源:HaxeGenerateGetterAction.java

示例10: getGenerateHandler

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
protected BaseHaxeGenerateHandler getGenerateHandler() {
  return new HaxeGenerateAccessorHandler(CreateGetterSetterFix.Strategy.SETTER) {
    @Override
    protected String getTitle() {
      return HaxeBundle.message("fields.to.generate.setters");
    }
  };
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:10,代码来源:HaxeGenerateSetterAction.java

示例11: getGenerateHandler

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
protected BaseHaxeGenerateHandler getGenerateHandler() {
  return new HaxeGenerateAccessorHandler(CreateGetterSetterFix.Strategy.GETTERSETTER) {
    @Override
    protected String getTitle() {
      return HaxeBundle.message("fields.to.generate.getters.setters");
    }
  };
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:10,代码来源:HaxeGenerateGetterSetterAction.java

示例12: invoke

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file) throws IncorrectOperationException {
  if (candidates.size() > 1) {
    NavigationUtil.getPsiElementPopup(
      candidates.toArray(new PsiElement[candidates.size()]),
      new DefaultPsiElementCellRenderer(),
      HaxeBundle.message("choose.class.to.import.title"),
      new PsiElementProcessor<PsiElement>() {
        public boolean execute(@NotNull final PsiElement element) {
          CommandProcessor.getInstance().executeCommand(
            project,
            new Runnable() {
              public void run() {
                doImport(editor, element);
              }
            },
            getClass().getName(),
            this
          );
          return false;
        }
      }
    ).showInBestPositionFor(editor);
  }
  else {
    doImport(editor, candidates.iterator().next());
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:29,代码来源:HaxeTypeAddImportIntentionAction.java

示例13: buildDialog

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
@Override
protected void buildDialog(Project project, PsiDirectory directory, CreateFileFromTemplateDialog.Builder builder) {
  builder.setTitle(HaxeBundle.message("create.nmml.file.action"));
  for (FileTemplate fileTemplate : HaxeFileTemplateUtil.getNMMLTemplates()) {
    final String templateName = fileTemplate.getName();
    final String shortName = HaxeFileTemplateUtil.getTemplateShortName(templateName);
    builder.addKind(shortName, icons.HaxeIcons.Nmml_16, templateName);
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:10,代码来源:CreateNMMLFileAction.java

示例14: tryCreateAnnotation

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
private void tryCreateAnnotation(HaxeReferenceExpression expression) {
  final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(expression);
  final List<HaxeComponent> components =
    HaxeComponentIndex.getItemsByName(expression.getText(), expression.getProject(), scope);
  if (!components.isEmpty()) {
    myHolder.createErrorAnnotation(expression, HaxeBundle.message("haxe.unresolved.type"))
      .registerFix(new HaxeTypeAddImportIntentionAction(expression, components));
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:10,代码来源:HaxeTypeAnnotator.java

示例15: check

import com.intellij.plugins.haxe.HaxeBundle; //导入依赖的package包/类
public static void check(final HaxeVarDeclaration var, final AnnotationHolder holder) {
  HaxeFieldModel field = new HaxeFieldModel(var);
  if (field.isProperty()) {
    checkProperty(field, holder);
  }
  if (field.hasInitializer() && field.hasTypeTag()) {
    TypeTagChecker.check(field.getBasePsi(), field.getTypeTagPsi(), field.getInitializerPsi(), false, holder);
  }

  // Checking for variable redefinition.
  HashSet<HaxeClassModel> classSet = new HashSet<>();
  HaxeClassModel fieldDeclaringClass = field.getDeclaringClass();
  classSet.add(fieldDeclaringClass);
  while (fieldDeclaringClass != null) {
    fieldDeclaringClass = fieldDeclaringClass.getParentClass();
    if (classSet.contains(fieldDeclaringClass)) {
      break;
    } else {
      classSet.add(fieldDeclaringClass);
    }
    if (fieldDeclaringClass != null) {
      for (HaxeFieldModel parentField : fieldDeclaringClass.getFields()) {
        if (parentField.getName().equals(field.getName())) {
          String message;
          if (parentField.isStatic()) {
            message = HaxeBundle.message("haxe.semantic.static.field.override", field.getName());
            holder.createWeakWarningAnnotation(field.getNameOrBasePsi(), message);
          } else {
            message = HaxeBundle.message("haxe.semantic.variable.redefinition", field.getName(), fieldDeclaringClass.getName());
            holder.createErrorAnnotation(field.getBasePsi(), message);
          }
          break;
        }
      }
    }
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:38,代码来源:HaxeSemanticAnnotator.java


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