use of org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport in project webtools.sourceediting by eclipse.
the class JsSearchQuery method doQuery.
protected IStatus doQuery() {
IStatus status = Status.OK_STATUS;
try {
JsSearchSupport support = JsSearchSupport.getInstance();
// index the file
SearchDocument delegate = support.addJspFile(getFile());
String scopePath = delegate.getPath();
JsSearchScope singleFileScope = new JsSearchScope(new String[] { getFile().getFullPath().toString(), scopePath });
// perform a searchs
// by passing in this jsp search query, requstor can add matches
// support.searchRunnable(getJavaElement(), singleFileScope, new
// JSPSingleFileSearchRequestor(getInstance()));
support.searchRunnable(getJavaElement(), singleFileScope, new JsSingleFileSearchRequestor(getInstance()));
} catch (Exception e) {
// $NON-NLS-1$ //$NON-NLS-2$
status = new Status(IStatus.ERROR, "org.eclipse.wst.sse.ui", IStatus.OK, "", null);
}
return status;
}
use of org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport in project webtools.sourceediting by eclipse.
the class JSPTypeMoveChange method createChangesFor.
public static Change[] createChangesFor(IType type, String newName) {
JsSearchSupport support = JsSearchSupport.getInstance();
// should be handled by JSPIndexManager
// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
// support.indexWorkspaceAndWait();
JSPTypeMoveRequestor requestor = new JSPTypeMoveRequestor(type, newName);
support.searchRunnable(type, new JsSearchScope(), requestor);
return requestor.getChanges();
}
use of org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport in project webtools.sourceediting by eclipse.
the class BasicRefactorSearchRequestor method getChanges.
/**
* @return all JSP changes for the search matches for the given Type
*/
public Change[] getChanges() {
JsSearchSupport support = JsSearchSupport.getInstance();
List changes = new ArrayList();
Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
String searchDocPath = null;
SearchDocument delegate = null;
while (keys.hasNext()) {
// create on the fly
searchDocPath = (String) keys.next();
MultiTextEdit javaEdit = (MultiTextEdit) fSearchDocPath2JavaEditMap.get(searchDocPath);
delegate = support.getSearchDocument(searchDocPath);
if (delegate != null && delegate instanceof JSDTSearchDocumentDelegate) {
JSDTSearchDocumentDelegate javaDelegate = (JSDTSearchDocumentDelegate) delegate;
changes.add(createChange(javaDelegate, javaEdit));
}
}
return (Change[]) changes.toArray(new Change[changes.size()]);
}
use of org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport in project webtools.sourceediting by eclipse.
the class JSPMethodRenameChange method createChangesFor.
public static Change[] createChangesFor(IFunction method, String newName) {
JsSearchSupport support = JsSearchSupport.getInstance();
// should be handled by JSPIndexManager
// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
// support.indexWorkspaceAndWait();
BasicRefactorSearchRequestor requestor = new JSPMethodRenameRequestor(method, newName);
support.searchRunnable(method, new JsSearchScope(), requestor);
return requestor.getChanges();
}
use of org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport in project webtools.sourceediting by eclipse.
the class JSPPackageRenameChange method createChangesFor.
public static Change[] createChangesFor(IPackageFragment pkg, String newName) {
JsSearchSupport support = JsSearchSupport.getInstance();
// should be handled by JSPIndexManager
// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
// support.indexWorkspaceAndWait();
BasicRefactorSearchRequestor requestor = new JSPPackageRenameRequestor(pkg, newName);
support.searchRunnable(pkg, new JsSearchScope(), requestor);
return requestor.getChanges();
}
Aggregations