/*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.erlide.ui.internal.search;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IWorkbenchSite;
import org.erlide.engine.services.search.ErlSearchScope;
import org.erlide.ui.editors.erl.AbstractErlangEditor;
/**
* Finds references to the selected element in the enclosing project of the
* selected element. The action is applicable to selections representing a
* Erlang element.
*
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*
* @since 3.0
*/
public class FindImplementorsInProjectAction extends FindImplementorsAction {
/**
* Creates a new <code>FindReferencesInProjectAction</code>. The action
* requires that the selection provided by the site's selection provider is
* of type <code>IStructuredSelection</code>.
*
* @param site
* the site providing context information for this action
*/
public FindImplementorsInProjectAction(final IWorkbenchSite site) {
super(site);
}
/**
* Note: This constructor is for internal use only. Clients should not call
* this constructor.
*
* @param editor
* the Erlang editor
*/
public FindImplementorsInProjectAction(final AbstractErlangEditor editor) {
super(editor);
}
@Override
void init() {
setText("Project");
setToolTipText("Find declarations in selected projects");
}
@Override
protected ErlSearchScope getScope() throws CoreException {
return getProjectScope();
}
@Override
protected String getScopeDescription() {
return SearchUtil.getProjectScopeDescription(getProjects());
}
// QuerySpecification createQuery(IErlElement element)
// throws JavaModelException {
// JavaSearchScopeFactory factory = JavaSearchScopeFactory.getInstance();
// JavaEditor editor = getEditor();
//
// IJavaSearchScope scope;
// String description;
// final boolean isInsideJRE = factory.isInsideJRE(element);
// if (editor != null) {
// scope = factory.createJavaProjectSearchScope(editor
// .getEditorInput(), isInsideJRE);
// description = factory.getProjectScopeDescription(editor
// .getEditorInput(), isInsideJRE);
// } else {
// scope = factory.createJavaProjectSearchScope(element
// .getJavaProject(), isInsideJRE);
// description = factory.getProjectScopeDescription(element
// .getJavaProject(), isInsideJRE);
// }
// return new ElementQuerySpecification(element, getLimitTo(), scope,
// description);
// }
}