Community
Participate
Working Groups
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
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 ?
Yes. Those need to be made public otherwise you are essentially breaking the contract of getListners()
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).
fixed http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=0e02258a926778d10fff4e9076fa38eb618cf3a4