Java 类com.intellij.lang.properties.parsing.PropertiesElementTypes 实例源码

项目:intellij-ce-playground    文件:PropertiesFileImpl.java   
private void ensurePropertiesLoaded() {
  if (myPropertiesMap != null) return;

  final ASTNode[] props = getPropertiesList().getChildren(PropertiesElementTypes.PROPERTIES);
  MostlySingularMultiMap<String, IProperty> propertiesMap = new MostlySingularMultiMap<String, IProperty>();
  List<IProperty> properties = new ArrayList<IProperty>(props.length);
  for (final ASTNode prop : props) {
    final Property property = (Property)prop.getPsi();
    String key = property.getUnescapedKey();
    propertiesMap.add(key, property);
    properties.add(property);
  }
  final boolean isAlphaSorted = PropertiesImplUtil.isAlphaSorted(properties);
  synchronized (lock) {
    if (myPropertiesMap != null) return;
    myProperties = properties;
    myPropertiesMap = propertiesMap;
    myAlphaSorted = isAlphaSorted;
  }
}
项目:tools-idea    文件:PropertiesFileImpl.java   
private void ensurePropertiesLoaded() {
  if (myPropertiesMap != null) return;

  final ASTNode[] props = getPropertiesList().getChildren(PropertiesElementTypes.PROPERTIES);
  MostlySingularMultiMap<String, IProperty> propertiesMap = new MostlySingularMultiMap<String, IProperty>();
  List<IProperty> properties = new ArrayList<IProperty>(props.length);
  for (final ASTNode prop : props) {
    final Property property = (Property)prop.getPsi();
    String key = property.getUnescapedKey();
    propertiesMap.add(key, property);
    properties.add(property);
  }
  synchronized (lock) {
    if (myPropertiesMap != null) return;
    myProperties = properties;
    myPropertiesMap = propertiesMap;
  }
}
项目:intellij-ce-playground    文件:PropertiesCoreEnvironment.java   
public ApplicationEnvironment(CoreApplicationEnvironment appEnvironment) {
  appEnvironment.registerFileType(PropertiesFileType.INSTANCE, "properties");
  appEnvironment.addExplicitExtension(SyntaxHighlighterFactory.LANGUAGE_FACTORY, PropertiesLanguage.INSTANCE,
                                      new PropertiesSyntaxHighlighterFactory());
  appEnvironment.addExplicitExtension(LanguageParserDefinitions.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesParserDefinition());
  appEnvironment.addExtension(FileBasedIndexExtension.EXTENSION_POINT_NAME, new XmlPropertiesIndex());
  appEnvironment.addExtension(StubIndexExtension.EP_NAME, new PropertyKeyIndex());

  appEnvironment.registerApplicationService(PropertiesQuickFixFactory.class, new EmptyPropertiesQuickFixFactory());
  appEnvironment.registerApplicationService(PropertiesRefactoringSettings.class, new PropertiesRefactoringSettings());
  appEnvironment.addExplicitExtension(LanguageAnnotators.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesAnnotator());
  appEnvironment.addExplicitExtension(LanguageFindUsages.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesFindUsagesProvider());

  appEnvironment.addExplicitExtension(LanguageASTFactory.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesASTFactory());
  appEnvironment.addExplicitExtension(LanguageFolding.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesFoldingBuilder());
  appEnvironment.addExplicitExtension(ElementManipulators.INSTANCE, PropertyImpl.class, new PropertyManipulator());
  appEnvironment.addExplicitExtension(ElementManipulators.INSTANCE, PropertyKeyImpl.class, new PropertyKeyManipulator());
  appEnvironment.addExplicitExtension(ElementManipulators.INSTANCE, PropertyValueImpl.class, new PropertyValueManipulator());

  final StubElementTypeHolderEP stubElementTypeHolderBean = new StubElementTypeHolderEP();
  stubElementTypeHolderBean.holderClass = PropertiesElementTypes.class.getName();
  appEnvironment.addExtension(StubElementTypeHolderEP.EP_NAME, stubElementTypeHolderBean);

  appEnvironment.addExplicitExtension(LanguageCommenters.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesCommenter());
  appEnvironment.addExplicitExtension(IdIndexers.INSTANCE, PropertiesFileType.INSTANCE, new PropertiesIdIndexer());
  appEnvironment.addExplicitExtension(TodoIndexers.INSTANCE, PropertiesFileType.INSTANCE, new PropertiesTodoIndexer());

  appEnvironment.addExtension(IconProvider.EXTENSION_POINT_NAME, new XmlPropertiesIconProvider());
}
项目:intellij-ce-playground    文件:PropertiesWordCompletionFilter.java   
public boolean isWordCompletionEnabledIn(final IElementType element) {
  return super.isWordCompletionEnabledIn(element) || element == PropertiesElementTypes.PROPERTY;
}
项目:intellij-ce-playground    文件:PropertyStubElementType.java   
public PropertyStubElementType() {
  super("PROPERTY", PropertiesElementTypes.LANG);
}
项目:intellij-ce-playground    文件:PropertiesListStubImpl.java   
public PropertiesListStubImpl(final StubElement parent) {
  super(parent, PropertiesElementTypes.PROPERTIES_LIST);
}
项目:intellij-ce-playground    文件:PropertyStubImpl.java   
public PropertyStubImpl(final StubElement parent, final String key) {
  super(parent, PropertiesElementTypes.PROPERTY);
  myKey = key;
}
项目:intellij-ce-playground    文件:PropertiesListImpl.java   
public PropertiesListImpl(final PropertiesListStub stub) {
  super(stub, PropertiesElementTypes.PROPERTIES_LIST);
}
项目:intellij-ce-playground    文件:PropertiesFoldingBuilder.java   
@Override
protected boolean isCustomFoldingRoot(ASTNode node) {
  return node.getElementType() == PropertiesElementTypes.FILE;
}
项目:tools-idea    文件:PropertiesWordCompletionFilter.java   
public boolean isWordCompletionEnabledIn(final IElementType element) {
  return super.isWordCompletionEnabledIn(element) || element == PropertiesElementTypes.PROPERTY;
}
项目:tools-idea    文件:PropertiesListStubImpl.java   
public PropertiesListStubImpl(final StubElement parent) {
  super(parent, PropertiesElementTypes.PROPERTIES_LIST);
}
项目:tools-idea    文件:PropertyStubImpl.java   
public PropertyStubImpl(final StubElement parent, final String key) {
  super(parent, PropertiesElementTypes.PROPERTY);
  myKey = key;
}
项目:tools-idea    文件:PropertiesListImpl.java   
public PropertiesListImpl(final PropertiesListStub stub) {
  super(stub, PropertiesElementTypes.PROPERTIES_LIST);
}
项目:tools-idea    文件:PropertiesFoldingBuilder.java   
@Override
protected boolean isCustomFoldingRoot(ASTNode node) {
  return node.getElementType() == PropertiesElementTypes.FILE;
}