mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-08 17:45:24 +02:00
using refresh events instead of direct refreshes for last refresh (only last refresh because they are asynchronous)
This commit is contained in:
parent
8383bc4c1d
commit
2f0f275934
1 changed files with 11 additions and 4 deletions
|
@ -20,6 +20,9 @@ import org.eclipse.rse.core.SystemPerspectiveHelpers;
|
||||||
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
|
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||||
|
import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||||
|
import org.eclipse.rse.model.SystemRegistry;
|
||||||
|
import org.eclipse.rse.model.SystemResourceChangeEvent;
|
||||||
import org.eclipse.rse.tests.RSETestsPlugin;
|
import org.eclipse.rse.tests.RSETestsPlugin;
|
||||||
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
|
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
|
||||||
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
|
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
|
||||||
|
@ -59,7 +62,7 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
||||||
assertNotNull("No test subystem", testSubSystem); //$NON-NLS-1$
|
assertNotNull("No test subystem", testSubSystem); //$NON-NLS-1$
|
||||||
|
|
||||||
testSubSystem.removeAllChildNodes();
|
testSubSystem.removeAllChildNodes();
|
||||||
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
|
SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
|
||||||
registry.invalidateFiltersFor(testSubSystem);
|
registry.invalidateFiltersFor(testSubSystem);
|
||||||
|
|
||||||
TestSubSystemContainerNode firstNode = null;
|
TestSubSystemContainerNode firstNode = null;
|
||||||
|
@ -95,9 +98,10 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
||||||
assertEquals("wrong item selected", node, structSel.getFirstElement()); //$NON-NLS-1$
|
assertEquals("wrong item selected", node, structSel.getFirstElement()); //$NON-NLS-1$
|
||||||
|
|
||||||
testSubSystem.removeAllChildNodes();
|
testSubSystem.removeAllChildNodes();
|
||||||
registry.invalidateFiltersFor(testSubSystem);
|
//registry.invalidateFiltersFor(testSubSystem);
|
||||||
|
|
||||||
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
|
//SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
|
||||||
|
registry.fireEvent(new SystemResourceChangeEvent(testSubSystem, ISystemResourceChangeEvents.EVENT_REFRESH, testSubSystem));
|
||||||
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
|
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
|
||||||
|
|
||||||
SystemPerspectiveHelpers.findRSEView().setSelection(new StructuredSelection(firstNode));
|
SystemPerspectiveHelpers.findRSEView().setSelection(new StructuredSelection(firstNode));
|
||||||
|
@ -147,13 +151,16 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
||||||
|
|
||||||
RSEUIPlugin.getTheSystemRegistry().invalidateFiltersFor(testSubSystem);
|
RSEUIPlugin.getTheSystemRegistry().invalidateFiltersFor(testSubSystem);
|
||||||
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
|
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
|
||||||
|
|
||||||
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
|
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
|
||||||
SystemPerspectiveHelpers.findRSEView().expandToLevel(testSubSystem, AbstractTreeViewer.ALL_LEVELS);
|
SystemPerspectiveHelpers.findRSEView().expandToLevel(testSubSystem, AbstractTreeViewer.ALL_LEVELS);
|
||||||
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
|
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
|
||||||
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
|
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
|
||||||
|
|
||||||
node.setName("Node 1 (changed)"); //$NON-NLS-1$
|
node.setName("Node 1 (changed)"); //$NON-NLS-1$
|
||||||
SystemPerspectiveHelpers.findRSEView().refresh(node);
|
|
||||||
|
SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
|
||||||
|
registry.fireEvent(new SystemResourceChangeEvent(node, ISystemResourceChangeEvents.EVENT_REFRESH, node));
|
||||||
|
|
||||||
RSEWaitAndDispatchUtil.waitAndDispatch(10000);
|
RSEWaitAndDispatchUtil.waitAndDispatch(10000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue