Skip to main content



      Home
Home » Eclipse Projects » JFace » TreeViewer Selection problem with ColumnViewerEditorActivationStrategy
TreeViewer Selection problem with ColumnViewerEditorActivationStrategy [message #666493] Wed, 20 April 2011 11:15 Go to next message
Eclipse UserFriend
Hello,

I have a treeviewer in which i'm using cell edition in TreeViewerColumn and when I activate the below code treeviewer.setselection is not working and when i remove the code the selection is working fine.
TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(treeViewer, new FocusCellOwnerDrawHighlighter(treeViewer));
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(treeViewer) {
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
return event.keyCode == SWT.F2;
}
};

TreeViewerEditor.create(treeViewer, focusCellManager, actSupport, ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);


Plz help
Re: TreeViewer Selection problem with ColumnViewerEditorActivationStrategy [message #666503 is a reply to message #666493] Wed, 20 April 2011 11:38 Go to previous messageGo to next message
Eclipse UserFriend
After investigation I have found the solution:
				Object selection = ((IStructuredSelection) sel).getFirstElement();
				if (selection instanceof MyObject) {
					treeViewer.setSelection(new StructuredSelection(selection), true);
					ViewerCell cell = treeViewer.getColumnViewerEditor().getFocusCell();
				}


And the selection is shown.

[Updated on: Wed, 20 April 2011 11:46] by Moderator

Re: TreeViewer Selection problem with ColumnViewerEditorActivationStrategy [message #666507 is a reply to message #666493] Wed, 20 April 2011 11:27 Go to previous messageGo to next message
Eclipse UserFriend
The owner draw highlighter remove the selection information using owner
draw.

Tom

Am 20.04.11 17:15, schrieb Jamel:
> Hello,
>
> I have a treeviewer in which i'm using cell edition in TreeViewerColumn
> and when I activate the below code treeviewer.setselection is not
> working and when i remove the code the selection is working fine.
> TreeViewerFocusCellManager focusCellManager = new
> TreeViewerFocusCellManager(treeViewer, new
> FocusCellOwnerDrawHighlighter(treeViewer));
> ColumnViewerEditorActivationStrategy actSupport = new
> ColumnViewerEditorActivationStrategy(treeViewer) {
> protected boolean
> isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
> return event.keyCode == SWT.F2;
> }
> };
>
> TreeViewerEditor.create(treeViewer, focusCellManager, actSupport,
> ColumnViewerEditor.TABBING_HORIZONTAL |
> ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR |
> ColumnViewerEditor.TABBING_VERTICAL |
> ColumnViewerEditor.KEYBOARD_ACTIVATION);
>
> Plz help
Re: TreeViewer Selection problem with ColumnViewerEditorActivationStrategy [message #666512 is a reply to message #666507] Wed, 20 April 2011 11:58 Go to previous message
Eclipse UserFriend
Yes thank you Tom.

The selection is there, it's just not highlighted.

I will extend FocusCellHighlighter and enable the highlight of the selection.

[Updated on: Wed, 20 April 2011 17:45] by Moderator

Previous Topic:Zest status
Next Topic:Global Validator Before Loading UI
Goto Forum:
  


Current Time: Wed Jul 23 17:08:50 EDT 2025

Powered by FUDForum. Page generated in 0.07815 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top