Examples of JavaElementHyperlink


Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

    IType type = JdtUtils.getJavaType(file.getProject(), target);
   
    if ("class-a".equals(nodeName) || "class-b".equals(nodeName) || "a-hint".equals(attrName) || "b-hint".equals(attrName) || "a-deep-index-hint".equals(attrName) || "b-deep-index-hint".equals(attrName)) {
      //make a simple hyperlink to the class
      if (type != null) {
        return new JavaElementHyperlink(hyperlinkRegion, type);
      }
    } else if ("set-method".equals(attrName) || "get-method".equals(attrName) || "map-set-method".equals(attrName) || "map-get-method".equals(attrName) ) {
      if ("field".equals(nodeName)) {
        String targetClassName = DozerPluginUtils.getMappingClassName(node);
       
        //get the first method that matches and make a hyperlink to that
        if (targetClassName != null) {
          IType targetClass = JdtUtils.getJavaType(file.getProject(), targetClassName);
          IMethod method = getMethodFromType(targetClass, target);
          if (method != null) {
            return new JavaElementHyperlink(hyperlinkRegion, method);
          }
        }
      }
    } else if ("a-hint".equals(attrName) || "b-hint".equals(attrName)) {
      //make a simple hyperlink to the class
      if (parentNode.getParentNode() != null && "mapping".equals(parentNode.getParentNode().getNodeName())) {
        if (type != null) {
          return new JavaElementHyperlink(hyperlinkRegion, type);
        }
      }   
    } else if ("custom-converter".equals(attrName)) {
      //make a simple hyperlink to the class
      if (type != null) {
        return new JavaElementHyperlink(hyperlinkRegion, type);
      }
    } else if ("custom-converter-id".equals(attrName)) {
      //search spring-bean that uses our mapping file and return the mapping
      //for the customconverter-id map-property
      ISourceModelElement modelElement = getModelElementForCustomConverter(BeansEditorUtils.getFile(document), target);
         
      if (modelElement != null) {
        return new SourceModelHyperlink(modelElement, hyperlinkRegion);
      }
    } else if ("a".equals(nodeName) || "b".equals(nodeName) ) {
      String targetClassName = DozerPluginUtils.getMappingClassName(node.getParentNode());
      String property = node.getNodeValue();
     
      if (targetClassName != null) {
        IType targetClass = JdtUtils.getJavaType(file.getProject(), targetClassName);
       
        try {
          //if we are doing indexed property mapping, we remove the []
          property = property.replaceAll("\\[\\]", "");
         
          IMethod method = Introspector.getReadableProperty(targetClass, property);
         
          if (method != null)
            return new JavaElementHyperlink(hyperlinkRegion, method);         
        } catch (Throwable e) {
          Logger.logException(e);
        }       
      }
    } else if ("bean-factory".equals(attrName)) {
      //make a simple hyperlink to the class
      if (type != null) {
        return new JavaElementHyperlink(hyperlinkRegion, type);
      }
    }
   
    return null;
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

      try {
        IType type = JdtUtils.getJavaType(file.getProject(), className);
        IMethod method = Introspector.findMethod(type, target, -1, Public.DONT_CARE,
            Static.DONT_CARE);
        if (method != null) {
          return new JavaElementHyperlink(hyperlinkRegion, method);
        }
      }
      catch (JavaModelException e) {
      }
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

      // only return hyperlink if no xml Java hyperlink will be created to avoid duplicates
      if (detectedHyperlinks == null || detectedHyperlinks.length == 0) {
        if (file != null && file.exists()) {
          IType type = JdtUtils.getJavaType(file.getProject(), target);
          if (type != null) {
            return new JavaElementHyperlink(hyperlinkRegion, type);
          }
        }
      }
    }
    if (annotationData.getExpectedMethodType() != null) {
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

    if (file != null && file.exists()) {
      IType type = JdtUtils.getJavaType(file.getProject(), className);
      try {
        IMethod method = Introspector.findMethod(type, target, -1, Public.DONT_CARE, Static.DONT_CARE);
        if (method != null) {
          return new JavaElementHyperlink(hyperlinkRegion, method);
        }
      }
      catch (JavaModelException e) {
        // ignore this here
      }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

      }
     
      IMethod method = BeansEditorUtils.extractMethodFromPropertyPathElements(propertyPaths,
          classes, file, 0);
      if (method != null) {
        return new JavaElementHyperlink(hyperlinkRegion, method);
      }
    }
    return null;
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

      IFile file = BeansEditorUtils.getFile(document);
      if (file != null && file.exists()) {
        IType type = JdtUtils.getJavaType(file.getProject(), className);
        IMethod method = Introspector.findMethod(type, target, -1, Public.DONT_CARE, Static.DONT_CARE);
        if (method != null) {
          return new JavaElementHyperlink(hyperlinkRegion, method);
        }
      }
    }
    catch (JavaModelException e) {
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

      IType type = JdtUtils.getJavaType(file.getProject(), className);
      try {
        IMethod method = Introspector.findMethod(type, target, -1, Public.DONT_CARE,
            Static.DONT_CARE);
        if (method != null) {
          return new JavaElementHyperlink(hyperlinkRegion, method);
        }
      }
      catch (JavaModelException e) {
      }
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

                    while (iter.hasNext()) {
                      IMethod candidate = iter.next();
                      if (target.equalsIgnoreCase(candidate.getParameterNames()[argIndex])) {
                        // return new JavaElementHyperlink(hyperlinkRegion, candidate.getParameters()[argIndex]);
                        // TODO: just a temporary workaround for making this Eclipse 3.6 compatible
                        return new JavaElementHyperlink(hyperlinkRegion, candidate);
                      }
                    }
                  } catch (JavaModelException e) {
                    // do nothing
                  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.hyperlink.JavaElementHyperlink

            try {
              Set<IMethod> methods = Introspector.getAllMethods(type);
              if (methods != null) {
                for (IMethod method : methods) {
                  if (method.getElementName().equals(target)) {
                    return new JavaElementHyperlink(hyperlinkRegion, method);
                  }
                }
              }
            }
            catch (JavaModelException e) {
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.