TableViewer scrollbar do not move when traversing with tab key [message #509123] |
Thu, 21 January 2010 08:04  |
Eclipse User |
|
|
|
Hello,
first sorry for my bad english, but i hope you can understand my problem:
i created a tableviewer inside a IEditorPart which is editable and should jump to next cell right to the current one to edit it when you press the tab key. so far its working well, but when the tableviewer has horizontal and vertical scrollbars, they do not move coresponding to the tab event. i have manually to move them to the actual editing cell, to see and edit it. that is of course subotpimal, cause i want to get focus on the actual editing cell to see the content of the cell to edit it without moving the scrollbar manually. here is the code i have written:
TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(tableViewer, new FocusCellOwnerDrawHighlighter(tableViewer));
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(tableVierwer {
protected boolean isEditorActivationEvent(
ColumnViewerEditorActivationEvent event) {
return event.eventType==
ColumnViewerEditorActivationEvent.TRAVERSAL ||
event.eventType ==
ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION ||
(event.eventType ==
ColumnViewerEditorActivationEvent.KEY_PRESSED &&
event.keyCode == SWT.CR) ||
event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
}};
TableViewerEditor.create(tableViewer, focusCellManager, actSupport, ColumnViewerEditor.TABBING_HORIZONTAL
| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
|
|
|
Re: TableViewer scrollbar do not move when traversing with tab key [message #509137 is a reply to message #509123] |
Thu, 21 January 2010 03:44   |
Eclipse User |
|
|
|
Hi,
for me this sounds similar to the case described in this bug:
289437: [Table] the arrow key couldn't move the table scrollbar
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289437
RAP is currently using JFace 3.4 code base and
ViewerCell#scrollIntoView() and TableViewerRow#scrollCellIntoView( int )
are introduced in JFace 3.5. As Table#showColumn() has been added to RAP
in 1.3M2 ( see bug 279798 ), maybe it's possible to do this scrolling
yourself with RAP 1.3.
HTH,
Ivan
On 1/21/2010 3:05 PM, ededagic wrote:
> Hello,
>
> first sorry for my bad english, but i hope you can understand my problem:
>
> i created a tableviewer inside a IEditorPart which is editable and
> should jump to next cell right to the current one to edit it when you
> press the tab key. so far its working well, but when the tableviewer
> has horizontal and vertical scrollbars, they do not move coresponding
> to the tab event. i have manually to move them to the actual editing
> cell, to see and edit it. that is of course subotpimal, cause i want
> to get focus on the actual editing cell to see the content of the cell
> to edit it without moving the scrollbar manually. here is the code i
> have written:
>
>
> TableViewerFocusCellManager focusCellManager = new
> TableViewerFocusCellManager(tableViewer, new
> FocusCellOwnerDrawHighlighter(tableViewer));
>
> ColumnViewerEditorActivationStrategy actSupport = new
> ColumnViewerEditorActivationStrategy(tableVierwer {
> protected boolean isEditorActivationEvent(
> ColumnViewerEditorActivationEvent event) {
>
> return event.eventType==
> ColumnViewerEditorActivationEvent.TRAVERSAL || event.eventType ==
> ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION ||
> (event.eventType ==
> ColumnViewerEditorActivationEvent.KEY_PRESSED &&
> event.keyCode == SWT.CR) || event.eventType ==
> ColumnViewerEditorActivationEvent.PROGRAMMATIC;
> }};
>
> TableViewerEditor.create(tableViewer, focusCellManager, actSupport,
> ColumnViewerEditor.TABBING_HORIZONTAL
> | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR |
> ColumnViewerEditor.TABBING_VERTICAL |
> ColumnViewerEditor.KEYBOARD_ACTIVATION);
>
|
|
|
|
Re: TableViewer scrollbar do not move when traversing with tab key [message #509376 is a reply to message #509185] |
Thu, 21 January 2010 23:56  |
Eclipse User |
|
|
|
Hi,
If you think that you found a bug, please file a bugzilla [1] with a
snippet to reproduce it.
[1] http://wiki.eclipse.org/RAP_Bug_Reporting_Howto
Best,
Ivan
On 1/21/2010 5:42 PM, ededagic wrote:
> Thx. Any idea how to use that? i tried the following:
>
> if (event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
> || event.eventType ==
> ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
> || (event.eventType ==
> ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
> || event.eventType ==
> ColumnViewerEditorActivationEvent.PROGRAMMATIC) {
>
> viewer.getTable().showColumn(viewer.getTable().getColumn(vie
> wer.getColumnViewerEditor().getFocusCell().getColumnIndex())
> ); return true;
> } else
> return false;
>
> now the scrollbar is moving but with sideeffects: depending on what
> columnindex i give there is other effect: not jump to next row, or
> stop 2 columns before the end. how should i write the red line to get
> it work?
|
|
|
Powered by
FUDForum. Page generated in 0.04155 seconds