本文整理汇总了Java中org.eclipse.search.ui.SearchResultEvent类的典型用法代码示例。如果您正苦于以下问题:Java SearchResultEvent类的具体用法?Java SearchResultEvent怎么用?Java SearchResultEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchResultEvent类属于org.eclipse.search.ui包,在下文中一共展示了SearchResultEvent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchResultChanged
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
@Override
public void searchResultChanged(final SearchResultEvent e) {
if (e instanceof Added) {
addReference(((Added) e).getReferenceDescription());
if (!isUIUpdateScheduled) {
isUIUpdateScheduled = true;
new UIUpdater().schedule();
}
} else if (e instanceof Reset) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
synchronized (viewer) {
viewer.remove(viewer.getInput(), Iterables.toArray(rootNodes.values(), ReferenceSearchViewTreeNode.class));
rootNodes.clear();
}
viewer.refresh();
viewer.expandToLevel(1);
}
});
}
}
示例2: searchResultChanged
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
@Override
public void searchResultChanged(SearchResultEvent event) {
if (event instanceof ModelSearchResultEvent) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
IFile f = ((ModelSearchResultEvent) event).getFile();
files.add(f);
IFile[] array = files.stream().distinct().toArray(IFile[]::new);
viewer.setInput(array);
}
});
}
}
示例3: fireEvent
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
void fireEvent(SearchResultEvent searchResultEvent) {
synchronized (listeners) {
for (ISearchResultListener listener : listeners) {
listener.searchResultChanged(searchResultEvent);
}
}
}
示例4: searchResultChanged
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
public void searchResultChanged(final SearchResultEvent e) {
synchronized (batchedSearchResultEvents) {
batchedSearchResultEvents.add(e);
}
if (!isUIUpdateScheduled) {
isUIUpdateScheduled = true;
new UIUpdater().schedule();
}
}
示例5: runInUIThread
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
isUIUpdateScheduled = false;
List<SearchResultEvent> events;
synchronized (batchedSearchResultEvents) {
events = Lists.newArrayList(batchedSearchResultEvents);
batchedSearchResultEvents.clear();
}
SubMonitor progress = SubMonitor.convert(monitor, events.size());
for (SearchResultEvent event : events) {
if (event instanceof Added) {
addReference(((Added) event).getReferenceDescription(), true);
} else if (event instanceof Reset) {
if (rootNodes != null && !rootNodes.isEmpty()) {
synchronized (viewer) {
viewer.remove(viewer.getInput(),
Iterables.toArray(rootNodes, ReferenceSearchViewTreeNode.class));
rootNodes = null;
}
}
}
progress.worked(1);
}
viewer.refresh();
viewer.expandToLevel(1);
return Status.OK_STATUS;
}
示例6: fireChange
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
/**
* Send the given <code>SearchResultEvent</code> to all registered search result listeners.
*
* @param e the event to be sent
* @see ISearchResultListener
*/
protected void fireChange(SearchResultEvent e) {
HashSet copiedListeners = new HashSet();
synchronized (fListeners) {
copiedListeners.addAll(fListeners);
}
Iterator listeners = copiedListeners.iterator();
while (listeners.hasNext()) {
((ISearchResultListener) listeners.next()).searchResultChanged(e);
}
}
示例7: searchResultChanged
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
@Override
public void searchResultChanged(final SearchResultEvent e)
{
final ISearchResult result = e.getSearchResult();
if (result instanceof IJiveSearchResult)
{
if (e instanceof MatchEvent)
{
final MatchEvent matchEvent = (MatchEvent) e;
switch (matchEvent.getKind())
{
case MatchEvent.ADDED:
addSearchResults(matchEvent.getMatches());
break;
case MatchEvent.REMOVED:
if (searchResultMap.size() > 1)
{
removeSearchResults(matchEvent.getMatches());
focusResults();
}
else
{
unfocusResults();
}
break;
}
}
else if (e instanceof RemoveAllEvent)
{
unfocusResults();
}
forceUpdate();
}
}
示例8: notifyListeners
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
private void notifyListeners(IFile file) {
SearchResultEvent event = new ModelSearchResultEvent(this, file);
for (Object listener : fListeners.getListeners())
((ISearchResultListener) listener).searchResultChanged(event);
}
示例9: searchResultChanged
import org.eclipse.search.ui.SearchResultEvent; //导入依赖的package包/类
@Override
public void searchResultChanged(SearchResultEvent event) {
if (viewer != null) {
viewer.refresh();
}
}