Examples of DartComponentType


Examples of com.jetbrains.lang.dart.DartComponentType

  @Override
  public void save(@NotNull DataOutput out, List<DartComponentInfo> infos) throws IOException {
    out.writeInt(infos.size());
    for (DartComponentInfo componentInfo : infos) {
      out.writeUTF(componentInfo.getValue());
      final DartComponentType dartComponentType = componentInfo.getType();
      final int key = dartComponentType == null ? -1 : dartComponentType.getKey();
      out.writeInt(key);
      final String libraryId = componentInfo.getLibraryId();
      out.writeBoolean(libraryId != null);
      if (libraryId != null) {
        out.writeUTF(libraryId);
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

*/
public class DartComponentInfoExternalizer implements DataExternalizer<DartComponentInfo> {
  @Override
  public void save(@NotNull DataOutput out, DartComponentInfo componentInfo) throws IOException {
    out.writeUTF(componentInfo.getValue());
    final DartComponentType dartComponentType = componentInfo.getType();
    final int key = dartComponentType == null ? -1 : dartComponentType.getKey();
    out.writeInt(key);
    final String libraryId = componentInfo.getLibraryId();
    out.writeBoolean(libraryId != null);
    if (libraryId != null) {
      out.writeUTF(libraryId);
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

  }


  protected List<PsiElement> getOccurrences(PsiElement element, @NotNull final DartExpression expression) {
    PsiElement context = element;
    DartComponentType type = null;
    do {
      context = PsiTreeUtil.getParentOfType(context, DartComponent.class, true);
      type = DartComponentType.typeOf(context);
    }
    while (type != null && notFunctionMethodClass(type));
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

        if (name == null) {
          continue;
        }

        PsiElement parent = componentName.getParent();
        final DartComponentType type = DartComponentType.typeOf(parent);
        if (type != null) {
          result.addComponentInfo(name, new DartComponentInfo(psiFile.getName(), type, result.getLibraryName()));
        }
        if (parent instanceof DartClass) {
          result.addClassName(name);
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

        supers.add(resolveResultDartClass);
      }
    }
    final List<DartComponent> superItems = DartResolveUtil.findNamedSubComponents(false, supers.toArray(new DartClass[supers.size()]));

    final DartComponentType type = DartComponentType.typeOf(component);
    if (type == DartComponentType.METHOD) {
      tryNavigateToSuperMethod(editor, component, superItems);
    }
    else if (!supers.isEmpty() && component instanceof DartClass) {
      PsiElementListNavigator.openTargets(
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    final StringBuilder resultUrl = constructDocUrlPrefix(libName);
    if (resultUrl == null) return null;

    final DartClass dartClass = PsiTreeUtil.getParentOfType(namedComponent, DartClass.class, true);
    final DartComponentType componentType = DartComponentType.typeOf(namedComponent);

    if (dartClass != null) {
      // method
      resultUrl.append('/').append(dartClass.getName()).append(".html").append('#').append(componentName);
    }
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

  @Override
  public Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context) {
    final Object o = item.getObject();
    if (o instanceof PsiElement) {
      final PsiElement element = (PsiElement)o;
      final DartComponentType type = DartComponentType.typeOf(element.getParent());
      if (type == DartComponentType.METHOD || type == DartComponentType.CONSTRUCTOR) {
        return new Object[]{element.getParent()};
      }
    }
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

  }

  @Override
  public void handleInsert(InsertionContext context) {
    final PsiElement parent = myComponentName.getParent();
    final DartComponentType componentType = DartComponentType.typeOf(parent);
    final boolean isGetterSetter = parent instanceof DartGetterDeclaration || parent instanceof DartSetterDeclaration;
    if (!isGetterSetter &&
        parent instanceof DartComponent
        &&
        (componentType == DartComponentType.FUNCTION ||
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

        else if (parent instanceof DartMethodDeclaration) {
          final String callType = getCallKind((DartMethodDeclaration)parent, element);
          createInfoAnnotation(holder, element, callType);
        }
        else if (parent instanceof DartVarAccessDeclaration) {
          final DartComponentType type = DartComponentType.typeOf(parent);
          if (type == DartComponentType.VARIABLE) {
            final PsiElement varParent = parent.getParent().getParent();
            if (varParent instanceof DartFile) {
              createInfoAnnotation(holder, element, DartSyntaxHighlighterColors.DART_TOP_LEVEL_VARIABLE_ACCESS);
            }
View Full Code Here

Examples of com.jetbrains.lang.dart.DartComponentType

    return null;
  }

  @NotNull
  public String getType(@NotNull final PsiElement element) {
    final DartComponentType type = DartComponentType.typeOf(element.getParent());
    return type == null ? "reference" : type.toString().toLowerCase();
  }
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.