Package org.eclipse.dltk.internal.core

Examples of org.eclipse.dltk.internal.core.SourceType


    try {

      IModelElement elem = sourceModule.getElementAt(offset);

      if (elem instanceof SourceType) {
        SourceType type = (SourceType) elem;

        if (type.getSuperClasses().length > 0) {
          return true;
        }

      }
View Full Code Here


    if (element == null || !(element instanceof SourceType)) {
      return;
    }

    IDLTKSearchScope scope = SearchEngine.createSearchScope(module.getScriptProject());
    SourceType type = (SourceType) element;
    SourceRange range = getReplacementRange(context);
    String prefix = context.getPrefix();

    IType[] projectTypes = PhpModelAccess.getDefault().findTypes(type.getElementName(), MatchRule.EXACT, 0, 0, scope, null);

    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) {

      for (IMethod method : superType.getMethods()) {

        IMethod moduleMethod = type.getMethod(method.getElementName());

        try {
          // throws a ModelException for methods not declared inside this sourcemodule,
          // hence when it passes we can safely continue
          moduleMethod.getUnderlyingResource();
View Full Code Here

    return identifiers;
  }

  private NamespaceDeclaration getCurrentNamespace(Program program,
      ISourceModule sourceModule, int offset) {
    SourceType ns = (SourceType) PHPModelUtils.getPossibleCurrentNamespace(
        sourceModule, offset);
    if (ns == null) {
      if (program.statements() != null
          && !program.statements().isEmpty()
          && (program.statements().get(0) instanceof NamespaceDeclaration)) {
        NamespaceDeclaration result = (NamespaceDeclaration) program
            .statements().get(0);
        for (Statement statement : program.statements()) {
          if (statement.getStart() >= offset) {
            return result;
          }
          if (statement instanceof NamespaceDeclaration) {
            result = (NamespaceDeclaration) statement;
          }
        }
        return result;
      } else {
        return null;
      }
    }
    ASTNode node = null;
    try {
      node = program.getElementAt(ns.getSourceRange().getOffset());
    } catch (ModelException e) {
    }
    if (node == null) {
      return null;
    }
View Full Code Here

              if (element != null) {                             
                sourceMethod = getMethod(element);               
               
                if (sourceMethod != null && sourceMethod.getParent() != null) {
                 
                  SourceType sourceType = (SourceType) sourceMethod.getParent();
                  String fqn = sourceType.getFullyQualifiedName("\\");
                  IDLTKSearchScope scope = SearchEngine.createSearchScope(source);
                  SymfonyModelAccess model = SymfonyModelAccess.getDefault();
                  IType[] types = model.findTypes(fqn, MatchRule.EXACT, 0, 0, scope, null);
                 
                  if (types.length == 1) {                   
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.core.SourceType

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.