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


Java JsonLanguage类代码示例

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

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

示例1: createSpacingBuilder

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
static SpacingBuilder createSpacingBuilder(CodeStyleSettings settings) {
  final JsonCodeStyleSettings jsonSettings = settings.getCustomSettings(JsonCodeStyleSettings.class);
  final CommonCodeStyleSettings commonSettings = settings.getCommonSettings(JsonLanguage.INSTANCE);

  final int spacesBeforeComma = commonSettings.SPACE_BEFORE_COMMA ? 1 : 0;
  final int spacesBeforeColon = jsonSettings.SPACE_BEFORE_COLON ? 1 : 0;
  final int spacesAfterColon = jsonSettings.SPACE_AFTER_COLON ? 1 : 0;

  return new SpacingBuilder(settings, JsonLanguage.INSTANCE)
    .before(COLON).spacing(spacesBeforeColon, spacesBeforeColon, 0, false, 0)
    .after(COLON).spacing(spacesAfterColon, spacesAfterColon, 0, false, 0)
    .withinPair(L_BRACKET, R_BRACKET).spaceIf(commonSettings.SPACE_WITHIN_BRACKETS, true)
    .withinPair(L_CURLY, R_CURLY).spaceIf(commonSettings.SPACE_WITHIN_BRACES, true)
    .before(COMMA).spacing(spacesBeforeComma, spacesBeforeComma, 0, false, 0)
    .after(COMMA).spaceIf(commonSettings.SPACE_AFTER_COMMA);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JsonFormattingBuilderModel.java


示例2: JsonCodeStylePanel

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public JsonCodeStylePanel(@NotNull CodeStyleSettings settings) {
  super(JsonLanguage.INSTANCE, null, settings);
  addPanelToWatch(myPanel);
  installPreviewPanel(myPreviewPanel);

  // Initialize combo box with property value alignment types
  for (PropertyAlignment alignment : PropertyAlignment.values()) {
    myPropertiesAlignmentCombo.addItem(alignment);
  }
  myPropertiesAlignmentCombo.setRenderer(new ListCellRendererWrapper<PropertyAlignment>() {
    @Override
    public void customize(JList list, PropertyAlignment value, int index, boolean selected, boolean hasFocus) {
      setText(value.getDescription());
    }
  });
  myPropertiesAlignmentCombo.addItemListener(new ItemListener() {
    @Override
    public void itemStateChanged(ItemEvent e) {
      if (e.getStateChange() == ItemEvent.SELECTED) {
        somethingChanged();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JsonCodeStylePanel.java


示例3: registerReferenceProviders

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(
      psiElement(PsiLiteralExpression.class).
          withSuperParent(3, psiElement(PsiAnnotation.class)),
      new InjectionReferenceProvider()
  );

  registrar.registerReferenceProvider(
      psiElement(PsiLiteralExpression.class).
          withSuperParent(3, psiElement(PsiAnnotation.class)),
      new InjectorReferenceProvider()
  );

  registrar.registerReferenceProvider(
      psiElement(PsiLiteralExpression.class).
          withLanguage(JavaLanguage.INSTANCE).
          withSuperParent(3, psiElement(PsiAnnotation.class)),
      new MacroReferenceProvider()
  );

  registrar.registerReferenceProvider(
      psiElement(JsonProperty.class).withLanguage(JsonLanguage.INSTANCE),
      new MainClassReferenceProvider()
  );
}
 
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:27,代码来源:ReferenceContributor.java


示例4: localReferencePattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> localReferencePattern(final String refTypePrefix) {
    return psiElement(JsonLiteral.class)
            .withParent(psiElement(JsonProperty.class).withName(OpenApiConstants.REF_KEY))
            .withText(StandardPatterns.string().contains(refTypePrefix))
            .andNot(StandardPatterns.string().contains(FileConstants.JSON_FILE_NAME_SUFFIX))
            .withLanguage(JsonLanguage.INSTANCE);
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:8,代码来源:OpenApiJsonReferenceContributor.java


示例5: localDefinitionsPattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> localDefinitionsPattern() {
    return swagger(psiElement(JsonLiteral.class)
            .withParent(psiElement(JsonProperty.class).withName(SwaggerConstants.REF_KEY))
            .withText(StandardPatterns.string().contains(SwaggerConstants.LOCAL_DEFINITIONS_PREFIX))
            .andNot(StandardPatterns.string().contains(FileConstants.JSON_FILE_NAME_SUFFIX))
            .withLanguage(JsonLanguage.INSTANCE));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:8,代码来源:SwaggerJsonReferenceContributor.java


示例6: preprocessEnter

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@Override
public Result preprocessEnter(@NotNull PsiFile file,
                              @NotNull Editor editor,
                              @NotNull Ref<Integer> caretOffsetRef,
                              @NotNull Ref<Integer> caretAdvance,
                              @NotNull DataContext dataContext,
                              EditorActionHandler originalHandler) {
  if (!file.getLanguage().is(JsonLanguage.INSTANCE)) {
    return Result.Continue;
  }
  return super.preprocessEnter(file, editor, caretOffsetRef, caretAdvance, dataContext, originalHandler);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:JsonEnterBetweenBracesHandler.java


示例7: getDefaultCommonSettings

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@Nullable
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
  CommonCodeStyleSettings commonSettings = new CommonCodeStyleSettings(JsonLanguage.INSTANCE);
  CommonCodeStyleSettings.IndentOptions indentOptions = commonSettings.initIndentOptions();
  indentOptions.INDENT_SIZE = 2;
  // strip all blank lines by default
  commonSettings.KEEP_BLANK_LINES_IN_CODE = 0;
  return commonSettings;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JsonLanguageCodeStyleSettingsProvider.java


示例8: isInsideCodeBlock

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private boolean isInsideCodeBlock(@Nullable PsiElement element) {
  if (element instanceof PsiFileSystemItem) {
    return false;
  }
  if (element == null || element.getParent() == null) {
    return true;
  }
  // Consider all elements of JSON PSI as externally visible, i.e. they are out of code block
  return !(element.getLanguage() instanceof JsonLanguage);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JsonTreeChangePreprocessor.java


示例9: L10nFileType

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private L10nFileType() {
    super(JsonLanguage.INSTANCE);
}
 
开发者ID:smelukov,项目名称:intellij-basisjs-plugin,代码行数:4,代码来源:L10nFileType.java


示例10: hasJsonRootKey

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private boolean hasJsonRootKey(final PsiFile psiFile, final String lookupKey) {
    final Language language = psiFile.getLanguage();

    return JsonLanguage.INSTANCE.is(language) && new PathFinder().findByPathFrom(lookupKey, psiFile).isPresent();
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:6,代码来源:FileDetector.java


示例11: filePattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> filePattern() {
    return psiElement(JsonLiteral.class)
            .withText(endsWithJson())
            .withLanguage(JsonLanguage.INSTANCE);
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:6,代码来源:OpenApiJsonReferenceContributor.java


示例12: componentFileReferencePattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> componentFileReferencePattern() {
    return psiElement(JsonLiteral.class)
            .withParent(psiElement(JsonProperty.class).withName(OpenApiConstants.REF_KEY))
            .withText(StandardPatterns.string().matches("(.*).json#/([^/])*$"))
            .withLanguage(JsonLanguage.INSTANCE);
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:7,代码来源:OpenApiJsonReferenceContributor.java


示例13: externalDefinitionsInRootPattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> externalDefinitionsInRootPattern() {
    return swagger(psiElement(JsonLiteral.class)
            .withParent(psiElement(JsonProperty.class).withName(SwaggerConstants.REF_KEY))
            .withText(StandardPatterns.string().matches("(.*).json#/([^/])*$"))
            .withLanguage(JsonLanguage.INSTANCE));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:7,代码来源:SwaggerJsonReferenceContributor.java


示例14: externalDefinitionsNotInRootPattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> externalDefinitionsNotInRootPattern() {
    return swagger(psiElement(JsonLiteral.class)
            .withParent(psiElement(JsonProperty.class).withName(SwaggerConstants.REF_KEY))
            .withText(StandardPatterns.string().matches("(.*).json#/(.*)/(.*)"))
            .withLanguage(JsonLanguage.INSTANCE));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:7,代码来源:SwaggerJsonReferenceContributor.java


示例15: localParametersPattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> localParametersPattern() {
    return swagger(psiElement(JsonLiteral.class).withText(StandardPatterns.string().contains(SwaggerConstants.LOCAL_PARAMETERS_PREFIX))
            .withLanguage(JsonLanguage.INSTANCE));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:5,代码来源:SwaggerJsonReferenceContributor.java


示例16: localResponsesPattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> localResponsesPattern() {
    return swagger(psiElement(JsonLiteral.class).withText(StandardPatterns.string().contains(SwaggerConstants.LOCAL_RESPONSES_PREFIX))
            .withLanguage(JsonLanguage.INSTANCE));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:5,代码来源:SwaggerJsonReferenceContributor.java


示例17: filePattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonLiteral> filePattern() {
    return swagger(psiElement(JsonLiteral.class)
            .withText(endsWithJson())
            .withLanguage(JsonLanguage.INSTANCE));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:6,代码来源:SwaggerJsonReferenceContributor.java


示例18: tagsPattern

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<JsonValue> tagsPattern() {
    return psiElement(JsonValue.class).inside(psiElement(JsonProperty.class).withName(SwaggerConstants.TAGS_KEY))
            .withLanguage(JsonLanguage.INSTANCE);
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:5,代码来源:SwaggerJsonReferenceContributor.java


示例19: StylintConfigFileType

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private StylintConfigFileType() {
    super(JsonLanguage.INSTANCE);
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:4,代码来源:StylintConfigFileType.java


示例20: getCommonSettings

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private CommonCodeStyleSettings getCommonSettings() {
  return mySettings.getCommonSettings(JsonLanguage.INSTANCE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JsonBlock.java


示例21: JsonCodeStyleSettings

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
public JsonCodeStyleSettings(CodeStyleSettings container) {
  super(JsonLanguage.INSTANCE.getID(), container);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JsonCodeStyleSettings.java


示例22: getLanguage

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@NotNull
@Override
public Language getLanguage() {
  return JsonLanguage.INSTANCE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:JsonLanguageCodeStyleSettingsProvider.java


示例23: getConfigurableDisplayName

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@Nullable
@Override
public String getConfigurableDisplayName() {
  return JsonLanguage.INSTANCE.getDisplayName();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:JsonCodeStyleSettingsProvider.java


示例24: getHighlighter

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
  return SyntaxHighlighterFactory.getSyntaxHighlighter(JsonLanguage.INSTANCE, null, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:JsonColorsPage.java


示例25: JsonFileImpl

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
public JsonFileImpl(FileViewProvider fileViewProvider) {
  super(fileViewProvider, JsonLanguage.INSTANCE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JsonFileImpl.java


示例26: CoffeeLintConfigFileType

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private CoffeeLintConfigFileType() {
    super(JsonLanguage.INSTANCE); //JSONLanguageDialect.JSON
}
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:4,代码来源:CoffeeLintConfigFileType.java


示例27: ESLintConfigFileType

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private ESLintConfigFileType() {
    super(JsonLanguage.INSTANCE); //JSONLanguageDialect.JSON
}
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:4,代码来源:ESLintConfigFileType.java


示例28: DefracSettingsFileType

import com.intellij.json.JsonLanguage; //导入依赖的package包/类
private DefracSettingsFileType() {
  super(JsonLanguage.INSTANCE);
}
 
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:4,代码来源:DefracSettingsFileType.java



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