Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Dramas with TreeViewer and setSelection()
Dramas with TreeViewer and setSelection() [message #455907] Mon, 23 May 2005 05:45
Robby is currently offline RobbyFriend
Messages: 2
Registered: July 2009
Junior Member
I'm creating an eclipse form within one of my editors and I must not
directly understand how to approach this, or I'm ignorant on how to go
about it.

When in the edit mode I've created a POJO to send to the editor through
the editorinput. Then I'm pulling out a category value that is within
that POJO and I'm trying to programmatically select the TreeItem from
within the tree.

http://www.eclipse.org/articles/treeviewer-cg/TreeViewerArti cle.htm says
to setSelection(new StructuredSelection(<domain model>), true).

The tree's input is a jdom.Element (and its children), given that
information - Do I create an element with the exact same
childnodes/attributes and pass it to that method? I guess I'm not clear
on what determines a match when passing it via setSelection() and
curious if there is a way to override the way it compares.

I've also tried looping through each TreeItem and compare it's text and
can't get that to fly either.

So long story short, How can I programmatically select a TreeItem within
a Tree?

Cheers,
Robby
Previous Topic:how do I disable input to java editor?
Next Topic:draw2d gridbaglayout similar to swing gridbag layout
Goto Forum:
  


Current Time: Fri Apr 26 23:00:30 GMT 2024

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

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

Back to the top