Examples of IMethod


Examples of org.eclipse.dltk.core.IMethod

    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

Examples of org.eclipse.dltk.core.IMethod

      /*
       * 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

Examples of org.eclipse.dltk.core.IMethod

  }

  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

Examples of org.eclipse.jdt.core.IMethod

            } catch (JavaModelException e) {
                // this is compilation problem - don't show the message
                BytecodeOutlinePlugin.log(e, IStatus.WARNING);
            }
        } else if (childEl.getElementType() == IJavaElement.METHOD) {
            IMethod iMethod = (IMethod) childEl;
            try {
                methodName = createMethodSignature(iMethod);
            } catch (JavaModelException e) {
                // this is compilation problem - don't show the message
                BytecodeOutlinePlugin.log(e, IStatus.WARNING);
View Full Code Here

Examples of org.eclipse.jdt.core.IMethod

    return proposal;
  }

  private String getParameters(final IMethodBinding methBinding) throws JavaModelException
  {
    IMethod meth = (IMethod) methBinding.getJavaElement();
   
    if( meth == null )
      return "";
   
    String[] paramNames = meth.getParameterNames();

    String params= "";
    ITypeBinding[] paramTypes = methBinding.getParameterTypes();

    for(int i = 0; i < paramTypes.length; i++)
View Full Code Here

Examples of org.eclipse.jdt.core.IMethod

    @Override
    public void open()
    {
      try
      {
        IMethod method= (IMethod) realMethod.getJavaElement();

        if (method != null)
        {
          action.run(new StructuredSelection(method));
        }
View Full Code Here

Examples of org.eclipse.jdt.core.IMethod

        /*
         * Normally we do not traverse to methods but we can call the customise with a method
         */
        case IJavaElement.METHOD : {
            IMethod method = (IMethod) element;
            String typeName = ((IType) method.getParent()).getFullyQualifiedName();
            String methodName = method.getElementName();
            testNames.add(typeName + ":" + methodName);
        }
            break;

        /*
 
View Full Code Here

Examples of org.eclipse.jdt.core.IMethod

      selected = unit.getElementAt(selection.getOffset());
      List<IJavaElement> path = getJavaElementsPath(selected);
      if (path.size() >= 7) {
        IJavaElement el = path.get(6);
        if (el.getElementType() == IJavaElement.METHOD) {
          IMethod sm = (IMethod)el;
          int flags = sm.getFlags();
          String actionMethodName = el.getElementName();
          if (/*Flags.isPublic(flags) &&*/ Flags.isStatic(flags)) {
            return actionMethodName;
          }
          else {
View Full Code Here

Examples of org.eclipse.jdt.core.IMethod

    if (activeMenuSelection instanceof IStructuredSelection) {
      IStructuredSelection selection = (IStructuredSelection) activeMenuSelection;
      p = Navigation.getProject(selection);
      Object firstElement = selection.getFirstElement();
      if (firstElement instanceof IMethod) {
        IMethod m = (IMethod) firstElement;
        ICompilationUnit unit = m.getCompilationUnit();
        try {
          IPackageDeclaration[] packs = unit.getPackageDeclarations();
          if (packs.length < 1) {
            info("This action can only apply to controllers.");
            return null;
          } else {
            packageName = packs[0].getElementName();
            if (!packageName.startsWith("controllers")) {
              info("This action can only apply to controllers.");
              return null;
            }
          }

          IType type = unit.getTypes()[0];
          controllerName = type.getElementName();
          String superclassName = type.getSuperclassName();
          if (superclassName.toLowerCase().contains("japid")) {
            useJapid = true;
          }

          List<IJavaElement> path = getJavaElementsPath(m);
          if (path.size() == 7) {
            int flags = m.getFlags();
           
            if (Flags.isPublic(flags) && Flags.isStatic(flags)) {
              viewName = m.getElementName();
            } else {
              info("The selected method " + m.getElementName()
                  + " is not public static of the top controller, thus not a valid action method.");
              return null;
            }
          }
        } catch (JavaModelException e) {
View Full Code Here

Examples of org.eclipse.jdt.core.IMethod

      selected = unit.getElementAt(selection.getOffset());
      List<IJavaElement> path = getJavaElementsPath(selected);
      if (path.size() >= 7) {
        IJavaElement el = path.get(6);
        if (el.getElementType() == IJavaElement.METHOD) {
          IMethod sm = (IMethod)el;
          int flags = sm.getFlags();
          String actionMethodName = el.getElementName();
          if (Flags.isPublic(flags) && Flags.isStatic(flags)) {
            return actionMethodName;
          }
          else {
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.