Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367031

Summary: [api] handle cursor changed react with special keys
Product: [Eclipse Project] Platform Reporter: Wojciech Trocki <wtrocki>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 4.2Keywords: needinfo
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Wojciech Trocki CLA 2011-12-18 07:13:59 EST
Build Identifier: 

Editor's cursor changed method react to some non printable characters like CTRL, F4, etc.
For example when CTRL is pressed method handleCursorPositionChanged is executed while text viewer cursor stays unchanged.

See AbstractTextEditor class  getCursorListener method:

    protected final ICursorListener getCursorListener() {
        if (fCursorListener == null) {
            fCursorListener= new ICursorListener() {

                public void keyPressed(KeyEvent e) 
                    //launch for any key..
                    handleCursorPositionChanged();
                }

                public void keyReleased(KeyEvent e) {
                }

                public void mouseDoubleClick(MouseEvent e) {
                }

                public void mouseDown(MouseEvent e) {
                }

                public void mouseUp(MouseEvent e) {
                    handleCursorPositionChanged();
                }
            };
        }
        return fCursorListener;
    }

Reproducible: Always
Comment 1 Dani Megert CLA 2011-12-19 11:36:41 EST
And the problem for you is?
Comment 2 Wojciech Trocki CLA 2011-12-19 12:08:47 EST
(In reply to comment #1)
> And the problem for you is?

Unclear method in API. 

I make my own, simple handleCursorPositionChanged. If problem is known, please close this bug.
Comment 3 Dani Megert CLA 2011-12-20 03:32:03 EST
(In reply to comment #2)
> (In reply to comment #1)
> > And the problem for you is?
> 
> Unclear method in API. 

The Javadoc says that it is only a potential change of the position. No plans to change this.