Examples of DartComponentType


Examples of com.jetbrains.lang.dart.DartComponentType

    if (!(parent instanceof DartReference)) {
      return UsageType.READ;
    }
    final PsiElement target = ((DartReference)element).resolve();
    final DartComponentType targetType = DartComponentType.typeOf(target == null ? null : target.getParent());

    final DartReference[] references = PsiTreeUtil.getChildrenOfType(parent, DartReference.class);
    final boolean isFirstChild = references != null && references.length > 0 && references[0] == element;
    if (isFirstChild && references.length == 2 && targetType == DartComponentType.CLASS) {
      return UsageType.CLASS_STATIC_MEMBER_ACCESS;
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

  }

  @Nullable
  private static UsageType getUsageTypeByType(DartType type) {
    final PsiElement typeParent = type.getParent();
    final DartComponentType typeParentType = DartComponentType.typeOf(typeParent);
    if (typeParent instanceof DartSuperclass) {
      return UsageType.CLASS_EXTENDS_IMPLEMENTS_LIST;
    }
    if (typeParent instanceof DartNewExpression) {
      return UsageType.CLASS_NEW_OPERATOR;
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    return getComponentName();
  }

  @Override
  public Icon getIcon(int flags) {
    final DartComponentType type = DartComponentType.typeOf(this);
    return type == null ? super.getIcon(flags) : type.getIcon();
  }
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    return findChildByType(DartTokenTypes.GET) != null;
  }

  @Override
  public boolean isAbstract() {
    final DartComponentType componentType = DartComponentType.typeOf(this);
    return componentType == DartComponentType.CLASS &&
           findChildByType(DartTokenTypes.ABSTRACT) != null
           ||
           componentType == DartComponentType.METHOD &&
           findChildByType(DartTokenTypes.EXTERNAL) == null &&
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    return new ItemPresentation() {
      @Override
      public String getPresentableText() {
        final StringBuilder result = new StringBuilder();
        result.append(getComponentName());
        final DartComponentType type = DartComponentType.typeOf(AbstractDartComponentImpl.this);
        if ((type == DartComponentType.METHOD || type == DartComponentType.FUNCTION || type == DartComponentType.CONSTRUCTOR) &&
            !(isGetter() || isSetter())) {
          final String parameterList = DartPresentableUtil.getPresentableParameterList(AbstractDartComponentImpl.this);
          result.append("(").append(parameterList).append(")");
        }
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

  }

  @NotNull
  @Override
  public String getName() {
    DartComponentType componentType = DartComponentType.typeOf(myComponent);
    String componentTypeString = componentType == null ? "" : componentType.toString().toLowerCase();
    return DartBundle.message("dart.make.static.fix.name", myComponent.getName(), componentTypeString);
  }
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    }
  }

  private static void foldFunctionBodies(@NotNull final List<FoldingDescriptor> descriptors, @NotNull final PsiElement root) {
    for (PsiElement dartComponent : PsiTreeUtil.findChildrenOfAnyType(root, DartComponent.class, DartOperatorDeclaration.class)) {
      final DartComponentType componentType = DartComponentType.typeOf(dartComponent);
      if (componentType == null) continue;

      switch (componentType) {
        case CLASS:
          final DartClassMembers classMembers = DartResolveUtil.getBody((DartClass)dartComponent);
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    final List<BaseCreateFix> result = new ArrayList<BaseCreateFix>();

    // chain
    if (leftReference != null) {
      final PsiElement leftTarget = leftReference.resolve();
      final DartComponentType leftTargetType = DartComponentType.typeOf(leftTarget != null ? leftTarget.getParent() : null);
      result.add(new CreateDartGetterSetterAction(name, !isLValue, leftTargetType == DartComponentType.CLASS));
      result.add(new CreateFieldAction(name, leftTargetType == DartComponentType.CLASS));
      if (DartResolveUtil.aloneOrFirstInChain(reference)) {
        result.add(new CreateGlobalDartGetterSetterAction(name, false));
      }
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    final THashSet<String> processedUrlsToImport = new THashSet<String>();

    DartComponentIndex.processComponentsByName(context, new Processor<DartComponentInfo>() {
      @Override
      public boolean process(DartComponentInfo info) {
        final DartComponentType componentType = info.getType();
        if (componentType == DartComponentType.CLASS ||
            componentType == DartComponentType.FUNCTION ||
            componentType == DartComponentType.TYPEDEF ||
            componentType == DartComponentType.VARIABLE) {
          final String libraryName = info.getLibraryId();
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    if (components == null) {
      return Collections.emptySet();
    }
    final Set<DartClass> result = new THashSet<DartClass>();
    for (DartComponent component : components) {
      final DartComponentType type = DartComponentType.typeOf(component);
      if (type == DartComponentType.CLASS) {
        result.add((DartClass)component);
      }
    }
    return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.