Examples of ITypeHierarchy


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

Examples of org.eclipse.dltk.core.ITypeHierarchy

    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

Examples of org.eclipse.dltk.core.ITypeHierarchy

  }

  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

Examples of org.eclipse.dltk.core.ITypeHierarchy

    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

Examples of org.eclipse.dltk.core.ITypeHierarchy

  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

Examples of org.eclipse.dltk.core.ITypeHierarchy

        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

Examples of org.eclipse.dltk.core.ITypeHierarchy

    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

Examples of org.eclipse.dltk.core.ITypeHierarchy

    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

Examples of org.eclipse.dltk.core.ITypeHierarchy

      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

Examples of org.eclipse.jdt.core.ITypeHierarchy

                final IRunnableWithProgress runnable = new IRunnableWithProgress() {
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        try {
                            IType activatorType = javaProject.findType(BundleActivator.class.getName());
                            if (activatorType != null) {
                                ITypeHierarchy hierarchy = activatorType.newTypeHierarchy(javaProject, monitor);
                                for (IType subType : hierarchy.getAllSubtypes(activatorType)) {
                                    if (!Flags.isAbstract(subType.getFlags()) && subType.getElementName().toLowerCase().contains(prefix.toLowerCase())) {
                                        result.add(new JavaTypeContentProposal(subType));
                                    }
                                }
                            }
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.