Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Give selected Node to Property View
Give selected Node to Property View [message #716480] Wed, 17 August 2011 14:19 Go to next message
Mathew Missing name is currently offline Mathew Missing nameFriend
Messages: 6
Registered: August 2011
Junior Member
I'm working with plugin, which goal is to help developers to write specific xml files with given semantics. To simplify the problem - I have extended standard XML editor (XMLMultiPageEditorPart) and introduced new view where xml is parsed into simplier tree. Every item on tree has reference to some node in xml file.

What I would like to achieve:
After clicking item (let's call it SomeWidget) I would like to show on properties view corresponding node. I found that setting getSite().setSelectionProvider(treeViewer) and making SomeWidget implementing IPropertySource could help me. I overwrote getPropertyDescriptors() method and now every attribute of node is present on properties view. But... there isn't possibility to edit it.
Mysterious function getEditableValue sounds fine to solution, but I have no idea how to use it.

Another way (I think prefered) is to "reopen" current file with marker on line where current node is. No idea how to get it.
Re: Give selected Node to Property View [message #716600 is a reply to message #716480] Wed, 17 August 2011 19:41 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 8/17/2011 10:19 AM, Mathew wrote:
> implementing IPropertySource could help me. I overwrote
> getPropertyDescriptors() method and now every attribute of node is
> present on properties view. But... there isn't possibility to edit it.
> Mysterious function getEditableValue sounds fine to solution, but I have
> no idea how to use it.

You might find
org.eclipse.wst.xml.ui.internal.properties.XMLPropertySource to be a
good example, along with the property descriptors it creates.

--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Give selected Node to Property View [message #717052 is a reply to message #716600] Fri, 19 August 2011 07:19 Go to previous messageGo to next message
Mathew Missing name is currently offline Mathew Missing nameFriend
Messages: 6
Registered: August 2011
Junior Member
Thanks, this helped.

I have another question, a bit connected to previous one. How can I made XMLMultiPageEditorPart selecting given Node? I would like to achieve exact behaviour as in outline. After double clicking on some item in outline it moves cursor to corresponding node. Can I make this using existing methods/classes or have I to write it on my own (finding index of node in body, opening editor with given marker)?
Re: Give selected Node to Property View [message #717153 is a reply to message #717052] Fri, 19 August 2011 12:48 Go to previous message
Mathew Missing name is currently offline Mathew Missing nameFriend
Messages: 6
Registered: August 2011
Junior Member
It's a bit sad, that I'm answering myself again:)

	ElementImpl element = (ElementImpl) (node)
	IStructuredDocumentRegion firstStructuredDocumentRegion = element.getFirstStructuredDocumentRegion();
	int position = firstStructuredDocumentRegion.getStart();
Previous Topic:Adding Content Assist for external Javascript library
Next Topic:JavaScript Outline types
Goto Forum:
  


Current Time: Thu Apr 25 13:02:06 GMT 2024

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

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

Back to the top