Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355815 - Cant 'get' listener for CaretMoved
Summary: Cant 'get' listener for CaretMoved
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-25 06:48 EDT by Prashant Deva CLA
Modified: 2011-10-21 16:10 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prashant Deva CLA 2011-08-25 06:48:13 EDT
Build Identifier: M20110210-1200

I have a StyledText object.
I want to check if I have already added a 'caretMoved' listener.
However, the event type StyledText.CaretMoved is not public so I cannot access it and thus cannot check for it using styledText.getListners().

The event types in the StyledText need to be made public

Reproducible: Always
Comment 1 Felipe Heidrich CLA 2011-08-25 10:13:23 EDT
You saying that all these constants need to me made public so you can use them with getListeners()
	static final int ExtendedModify = 3000;
	static final int LineGetBackground = 3001;
	static final int LineGetStyle = 3002;
	static final int TextChanging = 3003;
	static final int TextSet = 3004;
	static final int VerifyKey = 3005;
	static final int TextChanged = 3006;
	static final int LineGetSegments = 3007;
	static final int PaintObject = 3008;
	static final int WordNext = 3009;
	static final int WordPrevious = 3010;
	static final int CaretMoved = 3011;

?

Silenio, what do you think ?
Comment 2 Prashant Deva CLA 2011-08-31 01:55:49 EDT
Yes. Those need to be made public otherwise you are essentially breaking the contract of getListners()
Comment 3 Silenio Quarti CLA 2011-10-07 12:39:45 EDT
It seems ok to me. An alternate solution would be adding getters for the typed listeners (getCaretListener(), etc), but this is not done anywhere in the toolkit.

Widget.getListeners() does not work for custom widgets that did not implement typed listeners with untyped listeners (for example, CTabFolder).