Package org.eclipse.jdt.ui.search

Examples of org.eclipse.jdt.ui.search.ElementQuerySpecification


      //indexIfNeeded();
     
      // do search based on the particular Java query
      if(querySpecification instanceof ElementQuerySpecification) {
        // element search (eg. from global find references in Java file)
        ElementQuerySpecification elementQuery = (ElementQuerySpecification)querySpecification;
        IJavaElement element = elementQuery.getElement();
       
        if(DEBUG)
          System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
       
        SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
View Full Code Here


    String search = null;
    List<String> requiredTypeNames = new ArrayList<String>();
    IJavaProject project = null;

    if (querySpecification instanceof ElementQuerySpecification) {
      ElementQuerySpecification elementQuerySpecification = (ElementQuerySpecification) querySpecification;
      if (elementQuerySpecification.getElement() instanceof IType) {
        search = ((IType) elementQuerySpecification.getElement()).getFullyQualifiedName();
        project = ((IType) elementQuerySpecification.getElement()).getJavaProject();
      }
      else if (elementQuerySpecification.getElement() instanceof IField) {
        IField field = ((IField) elementQuerySpecification.getElement());
        search = field.getElementName();
        getTypeHierachy(monitor, requiredTypeNames, field.getDeclaringType());
        project = field.getJavaProject();
      }
      else if (elementQuerySpecification.getElement() instanceof IMethod) {
        IMethod method = ((IMethod) elementQuerySpecification.getElement());
        search = method.getElementName();
        // do property name magic
        if (search.startsWith("set")) {
          search = StringUtils.uncapitalize(search.substring(3));
        }
        getTypeHierachy(monitor, requiredTypeNames, method.getDeclaringType());
        project = method.getJavaProject();
      }
      else {
        search = elementQuerySpecification.getElement().getElementName();
      }

      int type = ((ElementQuerySpecification) querySpecification).getElement().getElementType();
      if (type == IJavaElement.TYPE) {
        searchFor = SEARCH_FOR_TYPES;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.ui.search.ElementQuerySpecification

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.