TableViewer scrollbar do not move when traversing with tab key [message #509123] |
Thu, 21 January 2010 13:04 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
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 08:44 |
Ivan Furnadjiev Messages: 2429 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
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 #509185 is a reply to message #509137] |
Thu, 21 January 2010 15:42 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
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?
or finally asked how do i get the actual selected column in the editor. TableCursor is not supported bei RAP, is it ?
[Updated on: Thu, 21 January 2010 16:28] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03128 seconds