Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IMethod


    this.method = method;
  }

  public IMethod getFarthestOverriddenMethod() throws CoreException {
    IMethod overriddenMethod = getOverriddenMethod();
    if (overriddenMethod == null) {
      return method;
    } else {
      return new PHPMethod(overriddenMethod).getFarthestOverriddenMethod();
    }
View Full Code Here


    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();
          continue;

        } catch (ModelException e) {

          if (CodeAssistUtils.startsWithIgnoreCase(moduleMethod.getElementName(), prefix) && !reported.contains(method.getElementName())) {
            reporter.reportMethod(method, "", range, new PDTCompletionInfo(module));
            reported.add(method.getElementName());
          }
        }
      }
View Full Code Here

      /*
       * Resolve the method based on simple names of parameter types
       * (to accommodate for different qualifications when refactoring is e.g.
       * recorded in source but applied on binary method):
       */
      final IMethod method = (IMethod) element;
      final IMethod[] methods = method.getDeclaringType().findMethods(method);
      if (methods != null && methods.length > 0) {
        element = methods[0];
      }
    }

View Full Code Here

  }

  private static IModelElement getSourceElement(ISourceModule sourceModule, int offset, int length) throws CoreException {
    IModelElement sourceElement = PDTModelUtils.getSourceElement(sourceModule, offset, length);
    if (sourceElement instanceof IMethod) {
      IMethod farthestOverriddenMethod = new PHPMethod((IMethod) sourceElement).getFarthestOverriddenMethod();
      if (sourceElement.equals(farthestOverriddenMethod)) {
        return sourceElement;
      } else {
        return farthestOverriddenMethod;
      }
View Full Code Here

    IField varExtended = topLevelElement.getField("VarExtended");
    IField varExtended2 = topLevelElement.getField("VarExtended2");
    IField autoVar = topLevelElement.getField("AutoVar");
    IField autoVar2 = topLevelElement.getField("AutoVar2");
   
    IMethod function_ = topLevelElement.getMethod("Function");
    IMethod autoFunction = topLevelElement.getMethod("AutoFunction");
   
    IType struct_ = topLevelElement.getType("Struct");
    IType union_ = topLevelElement.getType("Union");
    IType class_ = topLevelElement.getType("Class");
    IType interface_ = topLevelElement.getType("Interface");
    IType template = topLevelElement.getType("Template");
    IType enum_ = topLevelElement.getType("Enum");
    IField enum_memberA = topLevelElement.getType("Enum").getField("EnumMemberA");
    IField enum_memberB = topLevelElement.getType("Enum").getField("EnumMemberB");
    IType mixin = topLevelElement.getType("Mixin");
    IType aliasVarDecl = topLevelElement.getType("AliasVarDecl");
    IType aliasFunctionDecl = topLevelElement.getType("AliasFunctionDecl");
    IType aliasFrag = topLevelElement.getType("AliasFrag");
    IType aliasFrag2 = topLevelElement.getType("AliasFrag2");
   
    // Nested elements:
    IField otherClass_fieldA = topLevelElement.getType("OtherClass").getField("fieldA");
    IMethod otherClass_methodB = topLevelElement.getType("OtherClass").getMethod("methodB");
    IMethod otherClass_this = topLevelElement.getType("OtherClass").getMethod("this");
    final IType otherTemplate = topLevelElement.getType("OtherTemplate");
    IType _OtherTemplate_TplNestedClass = otherTemplate.getType("TplNestedClass");
    IMethod tplFunc = otherTemplate.getType("TplNestedClass").getMethod("tplFunc");
   
   
    visitAllModelElements(
      moduleType,
      variable,
View Full Code Here

    assertTrue(element.getNameRange().getOffset() == nameOffset);
    assertTrue(element.getNameRange().getLength() == element.getElementName().length());
   
    assertTrue(DefElementFlagsUtil.elementFlagsToArcheType(element.getFlags()) == archeType);
    if(element instanceof IMethod) {
      IMethod method = (IMethod) element;
      assertTrue(method.isConstructor() == new DefElementDescriptor(element.getFlags()).isConstructor());
    }
   
    if(element.getNamespace() == null) {
      assertTrue(element.getParent() != sourceModule.getParent());
    } else {
View Full Code Here

    super();
  }

  @Override
  protected IModelElement createMethodHandle(ISourceModule module, String methodName) {
    IMethod methodHandle = null;
    // resolveDuplicates(methodHandle);
    return methodHandle;
  }
View Full Code Here

    super();
  }

  @Override
  protected IModelElement createMethodHandle(ISourceModule module, String methodName) {
    IMethod methodHandle = null;
    // resolveDuplicates(methodHandle);
    return methodHandle;
  }
View Full Code Here

*/
public class NonPublicFilter extends ViewerFilter {

  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IMethod) {
      IMethod method = (IMethod) element;
      try {
        if ((method.getFlags() & Modifiers.AccPrivate) != 0
            || (method.getFlags() & Modifiers.AccProtected) != 0) {
          return false;
        }
      } catch (ModelException e) {
        Logger.logException("Failed activating NonPublicFilter ", e); //$NON-NLS-1$
      }
View Full Code Here

            stream.print("NAMESPACE: ");
          } else {
            stream.print("CLASS: ");
          }
        } else if (element.getElementType() == IModelElement.METHOD) {
          IMethod method = (IMethod) element;
          IType declaringType = method.getDeclaringType();
          if (declaringType == null
              || (declaringType.getFlags() & Modifiers.AccNameSpace) != 0) {
            stream.print("FUNCTION: ");
          } else {
            stream.print("METHOD: ");
View Full Code Here

TOP

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

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.