我创建了一个FilterTree,当我输入正确的数据进行过滤和搜索时,它会显示正确的结果。但是当我输入不正确的数据时(例如:“asdjahsdkjhsaldkj”)。这将是错误的,我不知道为什么?
这是我的src:
@Override
public void createPartControl(final Composite parent) {
filterTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL, new PatternFilter(), true);
treeviewer = filterTree.getViewer();
treeviewer.setContentProvider(new TreeViewContentProvider());
treeviewer.setLabelProvider(new TreeViewLabelProvider());
treeviewer.setInput(treeData.getAllType());
treeviewer.addDoubleClickListener(this);
getSite().setSelectionProvider(treeviewer);
}
这是错误:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StackOverflowError)
at org.eclipse.swt.SWT.error(SWT.java:3645)
at org.eclipse.swt.SWT.error(SWT.java:3568)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:186)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1196)
at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1176)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1168)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:701)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:684)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
at peyton.training.rap.demoSecond.Application.start(Application.java:18)
at org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:38)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:172)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:284)
at java.lang.Thread.run(Thread.java:745)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:105)
Caused by: java.lang.StackOverflowError
at java.util.Vector.equals(Vector.java:981)
at org.eclipse.jface.viewers.StructuredViewer.equals(StructuredViewer.java:710)
at org.eclipse.jface.viewers.AbstractTreeViewer.doFindInputItem(AbstractTreeViewer.java:872)
at org.eclipse.jface.viewers.StructuredViewer.findItems(StructuredViewer.java:793)
at org.eclipse.jface.viewers.StructuredViewer.findItem(StructuredViewer.java:763)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalGetWidgetToSelect(AbstractTreeViewer.java:1694)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1582)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1590)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1590)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1590)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1590)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1590)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpand(AbstractTreeViewer.java:1590)