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


Java ArrayUtil.EMPTY_OBJECT_ARRAY属性代码示例

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


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

示例1: getVariants

@NotNull
public Object[] getVariants() {
    final PsiElement owner = LuaDocCommentUtil.findDocOwner(this);

    ArrayList<Object> candidates = new ArrayList<Object>();
    if (owner instanceof LuaTableConstructor) {
        LuaExpression[] inits = ((LuaTableConstructor) owner).getInitializers();

        for (LuaExpression expr : inits) {
            if (expr instanceof LuaKeyValueInitializer)
                candidates.add(((LuaKeyValueInitializer) expr).getFieldKey());
        }

        return candidates.toArray();
    }

    return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:18,代码来源:LuaDocFieldReferenceImpl.java

示例2: getChildElements

@Override
public final Object[] getChildElements(final Object element) {
  if (element instanceof HierarchyNodeDescriptor) {
    final HierarchyNodeDescriptor descriptor = (HierarchyNodeDescriptor)element;
    final Object[] cachedChildren = descriptor.getCachedChildren();
    if (cachedChildren == null) {
      if (descriptor.isValid()) {
        descriptor.setCachedChildren(buildChildren(descriptor));
      }
      else {
        descriptor.setCachedChildren(ArrayUtil.EMPTY_OBJECT_ARRAY);
      }
    }
    return descriptor.getCachedChildren();
  }
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:HierarchyTreeStructure.java

示例3: getVariants

@Override
@NotNull
public Object[] getVariants() {
  final Converter<T> converter = getConverter();
  if (converter instanceof EnumConverter || converter == ResolvingConverter.BOOLEAN_CONVERTER) {
    if (DomCompletionContributor.isSchemaEnumerated(getElement())) return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }

  if (converter instanceof ResolvingConverter) {
    final ResolvingConverter<T> resolvingConverter = (ResolvingConverter<T>)converter;
    ArrayList<Object> result = new ArrayList<Object>();
    final ConvertContext convertContext = getConvertContext();
    for (T variant: resolvingConverter.getVariants(convertContext)) {
      LookupElement lookupElement = resolvingConverter.createLookupElement(variant);
      if (lookupElement != null) {
        result.add(lookupElement);
        continue;
      }
      String name = converter.toString(variant, convertContext);
      if (name != null) {
        result.add(ElementPresentationManager.getInstance().createVariant(variant, name, ((ResolvingConverter)converter).getPsiElement(variant)));
      }
    }
    for (final String string : resolvingConverter.getAdditionalVariants(convertContext)) {
      result.add(LookupValueFactory.createLookupValue(string, null));
    }
    return result.toArray();
  }
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:GenericDomValueReference.java

示例4: getApplicableAttributeVariants

private Object[] getApplicableAttributeVariants(PsiElement _context) {
  if (_context instanceof XmlTokenImpl && ((XmlTokenImpl)_context).getTokenType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) {
    XmlAttribute attr = PsiTreeUtil.getParentOfType(_context, XmlAttribute.class);
    if (attr != null) {
      final XmlAttributeDescriptor descriptor = attr.getDescriptor();

      if (descriptor != null) {
        if (descriptor.isFixed()) {
          final String defaultValue = descriptor.getDefaultValue();
          return defaultValue == null ? ArrayUtil.EMPTY_OBJECT_ARRAY : new Object[]{defaultValue};
        }

        String[] values = getEnumeratedValues(attr);

        final String[] strings = addSpecificCompletions(attr);

        if (values == null || values.length == 0) {
          values = strings;
        }
        else if (strings != null) {
          values = ArrayUtil.mergeArrays(values, strings);
        }

        return values == null ? ArrayUtil.EMPTY_OBJECT_ARRAY : values;
      }
    }
  }

  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:XmlAttributeValueGetter.java

示例5: getVariants

@NotNull
public Object[] getVariants() {
  final PsiElement owner = LuaDocCommentUtil.findDocOwner(this);
  if (owner instanceof LuaFunctionDefinition) {
    return ((LuaFunctionDefinition)owner).getParameters().getLuaParameters();
  }
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:8,代码来源:LuaDocParameterReferenceImpl.java

示例6: getVariants

@Override
@NotNull
public Object[] getVariants() {
  final Map<String, XmlTag> idMap = getIdMap();
  if (idMap == null) return ArrayUtil.EMPTY_OBJECT_ARRAY;

  String[] variants = idMap.keySet().toArray(new String[idMap.size()]);
  LookupElement[] elements = new LookupElement[variants.length];
  for (int i = 0, variantsLength = variants.length; i < variantsLength; i++) {
    elements[i] = LookupElementBuilder.create(variants[i]).withCaseSensitivity(true);
  }
  return elements;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:AnchorReferenceImpl.java

示例7: get

@Override
public Object[] get(final PsiElement context, CompletionContext completionContext) {
  XmlTag tag = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);
  if (tag != null) {
    final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent(tag);
    if (simpleContent != null) {
      final HashSet<String> variants = new HashSet<String>();
      XmlUtil.collectEnumerationValues(simpleContent, variants);
      return ArrayUtil.toObjectArray(variants);
    }
  }

  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:XmlCompletionData.java

示例8: getVariants

@Override
@NotNull
public Object[] getVariants() {
  FileReferenceCompletion completion = FileReferenceCompletion.getInstance();
  if (completion != null) {
    return completion.getFileReferenceCompletionVariants(this);
  }
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FileReference.java

示例9: getVariants

@NotNull
@Override
public Object[] getVariants() {
  if (StringUtil.isEmptyOrSpaces(myGroupId)) return ArrayUtil.EMPTY_OBJECT_ARRAY;

  MavenProjectIndicesManager manager = MavenProjectIndicesManager.getInstance(getElement().getProject());
  return manager.getArtifactIds(myGroupId).toArray();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MavenDependencyReferenceProvider.java

示例10: getChildElements

@Override
public Object[] getChildElements(Object element) {
  if (element == myTreeRoot) {
    return myGroups;
  }
  if (element instanceof ResourceGroup) {
    ResourceGroup group = (ResourceGroup)element;
    return group.getItems().toArray();
  }
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ChooseResourceDialog.java

示例11: getChildElements

@Override
public Object[] getChildElements(Object element) {
  if (element == RootDescriptor.ROOT) {
    return ArrayUtil.toStringArray(myCertificates.keySet());
  }
  else if (element instanceof String) {
    return ArrayUtil.toObjectArray(myCertificates.get((String)element));
  }
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CertificateTreeBuilder.java

示例12: getDependences

@NotNull
@Override
public Object[] getDependences()
{
  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:6,代码来源:FakeTargetElement.java

示例13: getVariants

@NotNull
@Override
public Object[] getVariants() {
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:5,代码来源:LuaRequireExpressionImpl.java

示例14: getChildElements

public Object[] getChildElements(Object nodeElement) {
  if (!(nodeElement instanceof FileElement)) {
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }

  FileElement element = (FileElement)nodeElement;
  VirtualFile file = element.getFile();

  if (file == null || !file.isValid()) {
    if (element == myRootElement) {
      return myRootElement.getChildren();
    }
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }

  VirtualFile[] children = null;

  if (element.isArchive() && myChooserDescriptor.isChooseJarContents()) {
    String path = file.getPath();
    if (!(file.getFileSystem() instanceof JarFileSystem)) {
      file = JarFileSystem.getInstance().findFileByPath(path + JarFileSystem.JAR_SEPARATOR);
    }
    if (file != null) {
      children = file.getChildren();
    }
  }
  else {
    children = file.getChildren();
  }

  if (children == null) {
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }

  Set<FileElement> childrenSet = new HashSet<FileElement>();
  for (VirtualFile child : children) {
    if (myChooserDescriptor.isFileVisible(child, myShowHidden)) {
      final FileElement childElement = new FileElement(child, child.getName());
      childElement.setParent(element);
      childrenSet.add(childElement);
    }
  }
  return ArrayUtil.toObjectArray(childrenSet);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:FileTreeStructure.java

示例15: getChildElements

@Override
public Object[] getChildElements(Object element) {
  if (!(element instanceof AbstractTreeNode)) {
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }

  final AbstractTreeNode favTreeElement = (AbstractTreeNode)element;
  try {
    if (!(element instanceof FavoritesListNode)) {
      return super.getChildElements(favTreeElement);
    }

    final List<AbstractTreeNode> result = new ArrayList<AbstractTreeNode>();
    final FavoritesListNode listNode = (FavoritesListNode)element;
    if (listNode.getProvider() != null) {
      return ArrayUtil.toObjectArray(listNode.getChildren());
    }
    final Collection<AbstractTreeNode> roots = FavoritesListNode.getFavoritesRoots(myProject, listNode.getName(), listNode);
    for (AbstractTreeNode<?> abstractTreeNode : roots) {
      final Object value = abstractTreeNode.getValue();

      if (value == null) continue;
      if (value instanceof PsiElement && !((PsiElement)value).isValid()) continue;
      if (value instanceof SmartPsiElementPointer && ((SmartPsiElementPointer)value).getElement() == null) continue;

      boolean invalid = false;
      for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, myProject)) {
        if (nodeProvider.isInvalidElement(value)) {
          invalid = true;
          break;
        }
      }
      if (invalid) continue;

      result.add(abstractTreeNode);
    }
    //myFavoritesRoots = result;
    //if (result.isEmpty()) {
    //  result.add(getEmptyScreen());
    //}
    return ArrayUtil.toObjectArray(result);
  }
  catch (Exception e) {
  }

  return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:FavoritesTreeStructure.java


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