use of org.eclipse.swt.custom.MovementListener in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_custom_StyledText method test_removeWordMovementListener_invokeActionSelectWordCallsNoMethods.
@Test
public void test_removeWordMovementListener_invokeActionSelectWordCallsNoMethods() {
MovementListener listener = new RecordingMovementListener();
listenerCalled = false;
listener2Called = false;
text.setText("Word0 Word1 Word2");
text.addWordMovementListener(listener);
text.removeWordMovementListener(listener);
text.invokeAction(ST.SELECT_WORD_NEXT);
text.invokeAction(ST.SELECT_WORD_PREVIOUS);
assertFalse("Listener unexpectantly called", listenerCalled);
assertFalse("Listener unexpectantly called", listener2Called);
}
use of org.eclipse.swt.custom.MovementListener in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_custom_StyledText method test_addWordMovementListener_invokeActionSelectWordPreviousCallsGetPreviousOffset.
@Test
public void test_addWordMovementListener_invokeActionSelectWordPreviousCallsGetPreviousOffset() {
MovementListener listener = new RecordingMovementListener();
listenerCalled = false;
listener2Called = false;
text.setText("Word0 Word1 Word2");
text.addWordMovementListener(listener);
text.invokeAction(ST.SELECT_WORD_PREVIOUS);
assertTrue("Listener not called", listenerCalled);
assertFalse("Listener unexpectantly called", listener2Called);
}
use of org.eclipse.swt.custom.MovementListener in project eclipse.platform.swt by eclipse.
the class Test_org_eclipse_swt_custom_StyledText method test_addWordMovementListener_invokeActionSelectWordNextCallsGetNextOffset.
@Test
public void test_addWordMovementListener_invokeActionSelectWordNextCallsGetNextOffset() {
MovementListener listener = new RecordingMovementListener();
listenerCalled = false;
listener2Called = false;
text.setText("Word0 Word1 Word2");
text.addWordMovementListener(listener);
text.invokeAction(ST.SELECT_WORD_NEXT);
assertFalse("Listener unexpectantly called", listenerCalled);
assertTrue("Listener not called", listener2Called);
}
Aggregations