Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Select added editpart
Select added editpart [message #194085] Tue, 30 August 2005 16:10 Go to next message
Hao Zhang is currently offline Hao ZhangFriend
Messages: 161
Registered: July 2009
Senior Member
Hi,
I have a CreateSiblingNodeAction(extends SelectionAction) for a tree, which
executes my CreateNodeCommand to create a sibling node. Now I want to make
the just created node selected automatically, so I need to add some code
after executing the command, but where can I get a viewer instance?

I can get the workbenchpart instance, but its getGraphicalViewer() is
protected(not visible for CreateSiblingNodeAction).

I also tried to pass it through constructor in my editor's createActions()
method, but getGraphicalViewer() returns null at that moment.

Any suggestion?

Regards,
Hao
Re: Select added editpart [message #194277 is a reply to message #194085] Wed, 31 August 2005 22:19 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

IWorkbenchParts are IAdaptable. Use the getAdapter() method.

"Hao Zhang" <bjzhanghao@21cn.com> wrote in message
news:df20mb$9fa$1@news.eclipse.org...
> Hi,
> I have a CreateSiblingNodeAction(extends SelectionAction) for a tree,
which
> executes my CreateNodeCommand to create a sibling node. Now I want to make
> the just created node selected automatically, so I need to add some code
> after executing the command, but where can I get a viewer instance?
>
> I can get the workbenchpart instance, but its getGraphicalViewer() is
> protected(not visible for CreateSiblingNodeAction).
>
> I also tried to pass it through constructor in my editor's createActions()
> method, but getGraphicalViewer() returns null at that moment.
>
> Any suggestion?
>
> Regards,
> Hao
>
>
Previous Topic:Sorting entries in Property Sheet
Next Topic:Coordinate system
Goto Forum:
  


Current Time: Fri Apr 26 21:10:27 GMT 2024

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

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

Back to the top