[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Skipping Columns, Highlite selected Cell, Scroll vertically
|
Hi,
So I understand right that the only remaining problem is 5?
if you modify the code in the activation strategy like this you get
horizontal scrolling (vertical should work out of the box).
----------8<----------
> if( event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
> || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
> || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
> || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC ) {
> v.getTree().showColumn(v.getTree().getColumn(((ViewerCell)event.getSource()).getColumnIndex()));
> return true;
> } else {
> return false;
> }
----------8<----------
Tom
Thomas Eichstädt-Engelen schrieb:
>
> hmm, that is exactly the Snippet i have used. It makes use of the
> FocusCellOwnerDrawHighlighter which highlites the focused cell only.
> What i'd like to achieve is highlite the row _and_ highlite the focused
> cell.
>
> however tab-editing does not work. Here is the peace of code which
> create the Editors:
> TreeViewerFocusCellManager focusCellManager = new
> TreeViewerFocusCellManager(treeViewer,new MyCellHighliter(treeViewer));
> ColumnViewerEditorActivationStrategy actSupport = new
> ColumnViewerEditorActivationStrategy(treeViewer) {
> protected boolean
> isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
> return event.eventType ==
> ColumnViewerEditorActivationEvent.TRAVERSAL
> || event.eventType ==
> ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
> || (event.eventType ==
> ColumnViewerEditorActivationEvent.KEY_PRESSED &&
> (event.keyCode >= 48 /*Zahl 0*/ &&
> event.keyCode <= 57 /* Zahl 9*/ || event.keyCode == 44 /*Komma*/))
> || event.eventType ==
> ColumnViewerEditorActivationEvent.PROGRAMMATIC;
> }
> };
>
> TreeViewerEditor.create(treeViewer, focusCellManager, actSupport,
> ColumnViewerEditor.TABBING_HORIZONTAL
> | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
> | ColumnViewerEditor.TABBING_VERTICAL
> | ColumnViewerEditor.KEYBOARD_ACTIVATION);
>
>
> MyCellHighliter is merely a copy of FocusCellOwnerDrawHighlighter.
>
> Regarding "5" and there is now way to make it work in 3.4 (the dirtier
> the better ;-) )
>
> Thanks,
>
> Thomas E.-E.
>
>
>
>
> Tom Schindl wrote:
>
>> All you need is available and working (beside 5 which could not get
>> introduced in 3.4 but it will make into 3.5).
>
>> Look at
>> http://wiki.eclipse.org/JFaceSnippets#Snippet026TreeViewerTabEditing it
>> is for tree but works equal on Table.
>
>> Tom
>
>> Thomas Eichstädt-Engelen schrieb:
>>> Hi SWT-Experts,
>>>
>>> i am developing an excel-like editor. I am using a tree (TreeViewer) to
>>> visualize data. There are many columns in each row. What i'd like to
>>> accomplish is the following:
>>>
>>> 1. Tabbing with the Tab (which does not work on my MacOS machine)
>>> 2. having the selected row highlited
>>> 3. having the selected cell framed
>>> 4. skip to only 6 (out of 20) columns in each row, because only those
>>> six columns are editable.
>>> 5. scroll vertically when tabbing to a column which is not visible so
>>> far.
>
>
--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl JFace-Committer
--------------------------------------------------------------------