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

Bug 315654

Summary: [console] Position at end of line after Page-Up/Down
Product: [Modeling] OCL Reporter: Ed Willink <ed>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: eclipse
Version: 3.0.0Flags: ed: indigo+
Target Milestone: 3.1.0   
Hardware: PC   
OS: Windows Vista   
Whiteboard: Usability
Bug Depends on:    
Bug Blocks: 318358    
Attachments:
Description Flags
cursor to EOL and initial selection fix none

Description Ed Willink CLA 2010-06-03 15:16:01 EDT
The cursor is currently positioned at the beginning of a line after Page-Up.

Since it is usually the intent just to re-execute, an Enter corrupts the display.

Put cursor at End-Of-Line.
Comment 1 Ed Willink CLA 2011-03-05 01:46:59 EST
Created attachment 190463 [details]
cursor to EOL and initial selection fix

A retrofit fix from the Xtext console

a) PageUp/Down now positions at end of line

b) On start up the selectionService fails to provide the prevailing selection, so it now searches for a selection in the active editor.

b) is better but perhaps not entirely right; watching the status bar feedback, the problem is perhaps that console creation trashes the selection, so while the fix ensures that selection is available for the first expreession, the status bar remains blank till a new selection is made.
Comment 2 Axel Uhl CLA 2011-03-14 05:12:25 EDT
Hi Ed,

I've looked at the patch. Debugging through the code I see that the change should work. I recommend factoring the common pieces

    String newText = history.get(currentHistoryPointer);
    document.set(newText);
    input.setSelectedRange(newText.length(), 0);

into a method that you call from the three locations where this code stretch occurs.

I've never actively been using the OCL console, and if, I was confused by its usability. The patch is certainly helpful. At the same time, depending on what we decide the future of the console should be, we really should revise it from a usability point of view. Why doesn't it show the entered text in the input field and lets the user navigate around with regular cursor keys, including cursor up/down/left/right? It doesn't seem intuitive to me that I have to press PageUp to get the the last expression where every other console would just use Up for this.

+1 for this with the recommendation to factor as described above, and I'll open another bug regarding my general usability concerns regarding the console.
Comment 3 Ed Willink CLA 2011-03-14 06:35:47 EDT
setTextFromHistory() introduced.

Committed to HEAD for M6.
Comment 4 Ed Willink CLA 2011-05-27 03:13:32 EDT
Closing