Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ITypeHierarchy


  public boolean isInstanceOf(String typeName) throws ModelException {
    if (equals(typeName)) {
      return true;
    } else {
      ITypeHierarchy hierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
      if (hierarchy == null) return false;
      IType[] superTypes = hierarchy.getAllSuperclasses(type);
      if (superTypes == null) return false;

      for (IType variableSuperType: superTypes) {
        if (new PHPType(variableSuperType).equals(typeName)) {
          return true;
View Full Code Here


    if (projectTypes.length != 1) {
      return;
    }

    IType currentType = projectTypes[0];
    ITypeHierarchy hierarchy = this.getCompanion().getSuperTypeHierarchy(type, new NullProgressMonitor());
    IType[] superTypes = hierarchy.getAllSupertypes(currentType);

    List<String> reported = new ArrayList<String>();

    for (IType superType : superTypes) {
View Full Code Here

  }

  protected ITypeHierarchy getSuperTypeHierarchy(
      org.eclipse.dltk.core.IType type) {

    ITypeHierarchy th = (ITypeHierarchy) fTypeHierarchies.get(type);
    if (th == null) {
      try {
        th = SuperTypeHierarchyCache.getTypeHierarchy(type,
            getProgressMonitor());
      } catch (ModelException e) {
View Full Code Here

    MethodOverrideTester test = null;
    synchronized (fgMethodOverrideTesterCache) {
      test = (MethodOverrideTester) fgMethodOverrideTesterCache.get(type);
    }
    if (test == null) {
      ITypeHierarchy hierarchy = getTypeHierarchy(type); // don't nest the
      // locks
      synchronized (fgMethodOverrideTesterCache) {
        test = (MethodOverrideTester) fgMethodOverrideTesterCache
            .get(type); // test again after waiting a long time for
        // 'getTypeHierarchy'
View Full Code Here

  public static ITypeHierarchy getTypeHierarchy(IType type,
      IProgressMonitor progressMonitor) throws ModelException {
    if (type == null) {
      return null;
    }
    ITypeHierarchy hierarchy = findTypeHierarchyInCache(type);
    if (hierarchy == null) {
      fgCacheMisses++;
      hierarchy = type.newSupertypeHierarchy(progressMonitor);
      addTypeHierarchyToCache(hierarchy);
    } else {
View Full Code Here

        HierarchyCacheEntry oldest = null;
        ArrayList obsoleteHierarchies = new ArrayList(CACHE_SIZE);
        for (int i = 0; i < nEntries; i++) {
          HierarchyCacheEntry entry = (HierarchyCacheEntry) fgHierarchyCache
              .get(i);
          ITypeHierarchy curr = entry.getTypeHierarchy();
          if (!curr.exists() || hierarchy.contains(curr.getType())) {
            obsoleteHierarchies.add(entry);
          } else {
            if (oldest == null
                || entry.getLastAccess() < oldest
                    .getLastAccess()) {
View Full Code Here

    if (type != null) {
      synchronized (fgHierarchyCache) {
        for (int i = fgHierarchyCache.size() - 1; i >= 0; i--) {
          HierarchyCacheEntry curr = (HierarchyCacheEntry) fgHierarchyCache
              .get(i);
          ITypeHierarchy hierarchy = curr.getTypeHierarchy();
          if (!hierarchy.exists()) {
            removeHierarchyEntryFromCache(curr);
          } else {
            if (hierarchy.contains(type)) {
              curr.markAsAccessed();
              return hierarchy;
            }
          }
        }
View Full Code Here

    List<IField> result = new LinkedList<IField>();

    for (IType type : concreteContext.getLhsTypes()) {
      try {
        ITypeHierarchy hierarchy = getCompanion()
            .getSuperTypeHierarchy(type, null);
        IField[] fields = null;

        if (concreteContext instanceof ClassStaticMemberContext
            && concreteContext.getTriggerType() == Trigger.CLASS
            && ((ClassStaticMemberContext) concreteContext)
                .isParent()) {
          List<IField> superTypes = new ArrayList<IField>();
          for (IType currType : hierarchy.getAllSupertypes(type)) {
            superTypes.addAll(Arrays.asList(PHPModelUtils
                .getTypeField(currType, prefix,
                    requestor.isContextInformationMode())));
          }
View Full Code Here

      if (context instanceof GlobalMethodStatementContext) {
        GlobalMethodStatementContext globalContext = (GlobalMethodStatementContext) context;
        IType type = globalContext.getEnclosingType();
        try {
          if (type != null && PHPFlags.isClass(type.getFlags())) {
            ITypeHierarchy hierarchy = getCompanion()
                .getSuperTypeHierarchy(type, null);
            IType[] superTypes = hierarchy.getAllSupertypes(type);
            for (IType superType : superTypes) {
              if (PHPFlags.isClass(superType.getFlags())) {
                return false;
              }
            }
View Full Code Here

    } else {
      replaceRange = getReplacementRangeWithBraces(concreteContext);
    }

    try {
      ITypeHierarchy hierarchy = getCompanion().getSuperTypeHierarchy(
          declaringClass, null);
      IMethod[] superClassMethods = PHPModelUtils
          .getSuperTypeHierarchyMethod(declaringClass, hierarchy,
              prefix, exactName, null);
      for (IMethod superMethod : superClassMethods) {
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.ITypeHierarchy

Copyright © 2018 www.massapicom. 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.