Package org.eclipse.dltk.internal.ui.search

Examples of org.eclipse.dltk.internal.ui.search.DLTKSearchScopeFactory


    }
  }

  @Override
  protected QuerySpecification createQuery(INamedElement defunit) throws ModelException {
    DLTKSearchScopeFactory factory= DLTKSearchScopeFactory.getInstance();
    ScriptEditor editor= deeEditor;
   
    IScriptProject scriptProject = deeEditor.getInputModelElement().getScriptProject();
   
    IDLTKSearchScope scope;
    String description;
    boolean isInsideInterpreterEnvironment = isInsideInterpreterEnv(defunit, factory);
    if (editor != null) {
      scope= factory.createProjectSearchScope(editor.getEditorInput(), isInsideInterpreterEnvironment);
      description= factory.getProjectScopeDescription(editor.getEditorInput(), isInsideInterpreterEnvironment);
    } else {
      scope= factory.createProjectSearchScope(scriptProject, isInsideInterpreterEnvironment);
      description=  factory.getProjectScopeDescription(scriptProject, isInsideInterpreterEnvironment);
    }
   
    DeeDefPatternLocator.GLOBAL_param_defunit = defunit;
    return new PatternQuerySpecification(defunit.getName(), 0, true, getLimitTo(), scope, description);
  }
View Full Code Here


    ISourceModule sourceModule = EditorUtility.getEditorInputModelElement(deeEditor, false);
    IType type = (IType) DeeModelEngine.findCorrespondingModelElement(defunit, sourceModule);
    if (type == null) {
      return super.createQuery(defunit);
    }
    DLTKSearchScopeFactory factory = DLTKSearchScopeFactory.getInstance();
    IDLTKSearchScope scope = SearchEngine.createHierarchyScope(type);
    String description = factory.getHierarchyScopeDescription(type);
   
    DeeDefPatternLocator.GLOBAL_param_defunit = defunit;
    return new PatternQuerySpecification(
        defunit.getName(), 0, true, getLimitTo(), scope, description);
    //return new ElementQuerySpecification(element, getLimitTo(), scope, description);
View Full Code Here

    return IDLTKSearchConstants.REFERENCES;
  }
 
  @Override
  protected QuerySpecification createQuery(INamedElement defunit) throws ModelException {
    DLTKSearchScopeFactory factory = DLTKSearchScopeFactory.getInstance();
   
    boolean isInsideInterpreterEnvironment = isInsideInterpreterEnv(defunit, factory);
   
    IDLTKSearchScope scope = factory.createWorkspaceScope(isInsideInterpreterEnvironment, getLanguageToolkit());
    String description = factory.getWorkspaceScopeDescription(isInsideInterpreterEnvironment);
   
    DeeDefPatternLocator.GLOBAL_param_defunit = defunit;
    return new PatternQuerySpecification(
        defunit.getName(), 0, true, getLimitTo(), scope, description);
    //return new ElementQuerySpecification(element, getLimitTo(), scope, description);
View Full Code Here

 
  @Override
  protected QuerySpecification createQuery(INamedElement defunit) throws ModelException {
  //QuerySpecification createQuery(IModelElement element) throws ModelException {
    DLTKSearchScopeFactory factory= DLTKSearchScopeFactory.getInstance();
   
    IWorkingSet[] workingSets= fWorkingSets;
    if (fWorkingSets == null) {
      workingSets= factory.queryWorkingSets();
      if (workingSets == null)
        return null;
    }
    SearchUtil.updateLRUWorkingSets(workingSets);
    IDLTKSearchScope scope= factory.createSearchScope(workingSets, true, getLanguageToolkit());
    String description= factory.getWorkingSetScopeDescription(workingSets, true);

    DeeDefPatternLocator.GLOBAL_param_defunit = defunit;
    return new PatternQuerySpecification(
        defunit.getName(), 0, true, getLimitTo(), scope, description);
  }
View Full Code Here

      }
    }
  }

  protected QuerySpecification createQuery(INamedElement defunit) throws ModelException {
    DLTKSearchScopeFactory factory= DLTKSearchScopeFactory.getInstance();
    IDLTKSearchScope scope= factory.createWorkspaceScope(true, getLanguageToolkit());
    String description= factory.getWorkspaceScopeDescription(true);
   
    DeeDefPatternLocator.GLOBAL_param_defunit = defunit;
    return new PatternQuerySpecification(
        defunit.getName(), 0, true, getLimitTo(), scope, description);
    //return new ElementQuerySpecification(element, getLimitTo(), scope, description);
View Full Code Here

   */
  protected IDLTKSearchScope getScope(String scope, int type, IProject project)
    throws Exception
  {
    boolean includeInterpreterEnvironment = false;
    DLTKSearchScopeFactory factory = DLTKSearchScopeFactory.getInstance();

    IDLTKLanguageToolkit toolkit = null;
    ProjectManager manager = ProjectManagement.getProjectManager(getNature());
    if(manager instanceof DltkProjectManager){
      DltkProjectManager dltkManager = (DltkProjectManager)manager;
      toolkit = dltkManager.getLanguageToolkit(dltkManager.getNatureId());
    }
    if (toolkit == null && project != null){
      for(String nature : ProjectManagement.getProjectManagerNatures()){
        if(project.hasNature(nature)){
          manager = ProjectManagement.getProjectManager(nature);
          if(manager instanceof DltkProjectManager){
            DltkProjectManager dltkManager = (DltkProjectManager)manager;
            toolkit = dltkManager.getLanguageToolkit(dltkManager.getNatureId());
            break;
          }
        }
      }
    }
    IDLTKSearchScope searchScope = null;

    if (SCOPE_PROJECT.equals(scope)){
      String[] names = new String[]{project.getName()};
      searchScope = factory.createProjectSearchScope(
          names, includeInterpreterEnvironment, toolkit);
    }else{ // workspace
      searchScope = factory.createWorkspaceScope(
          includeInterpreterEnvironment, toolkit);
    }
    return searchScope;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.ui.search.DLTKSearchScopeFactory

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.