Esempio n. 1
0
 /**
  * Creates a selection dialog that lists all types in the given project. The caller is responsible
  * for opening the dialog with <code>Window.open</code>, and subsequently extracting the selected
  * type(s) (of type <code>Type</code> ) via <code>SelectionDialog.getResult</code>.
  *
  * @param parent the parent shell of the dialog to be created
  * @param context the runnable context used to show progress when the dialog is being populated
  * @param project the project
  * @param style flags defining the style of the dialog; the only valid values are <code>
  *     IDartElementSearchConstants.CONSIDER_CLASSES</code>, <code>
  *     IDartElementSearchConstants.CONSIDER_INTERFACES</code>, <code>
  *     IDartElementSearchConstants.CONSIDER_ANNOTATION_TYPES</code> , <code>
  *     IDartElementSearchConstants.CONSIDER_ENUMS</code>, <code>
  *     IDartElementSearchConstants.CONSIDER_ALL_TYPES</code>, <code>
  *     IDartElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES</code> <code>
  *     IDartElementSearchConstants.CONSIDER_CLASSES_AND_ENUMS</code> . Please note that the
  *     bitwise OR combination of the elementary constants is not supported.
  * @param multipleSelection <code>true</code> if multiple selection is allowed
  * @return a new selection dialog
  * @exception DartModelException if the selection dialog could not be opened
  */
 public static SelectionDialog createTypeDialog(
     Shell parent,
     IRunnableContext context,
     IProject project,
     int style,
     boolean multipleSelection)
     throws DartModelException {
   // TODO (pquitslund): update to use project scope once implemented in search core
   // DartSearchScope scope = SearchEngine.createJavaSearchScope(
   //                            new DartProject[] {JavaScriptCore.create(project)});
   SearchScope scope = SearchScopeFactory.createWorkspaceScope();
   return createTypeDialog(parent, context, scope, style, multipleSelection);
 }
 @Override
 QuerySpecification createQuery(DartElement element)
     throws DartModelException, InterruptedException {
   SearchScope scope = SearchScopeFactory.createWorkspaceScope();
   return new ElementQuerySpecification(element, getLimitTo(), scope, "workspace"); // $NON-NLS-1$
 }