This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 54398 - Need an API to find location of an element in xml
Summary: Need an API to find location of an element in xml
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: API (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-02 16:01 UTC by Martin Grebac
Modified: 2007-09-25 01:29 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Grebac 2005-02-02 16:01:06 UTC
In refactoring, when we show the proposed changes,
in java there's a possibility to jump directly to
the element. To add such functionality, we would
need some api (+ of course it's implementation) to
get the location information. I think refactoring
api needs some PositionRef, but anything
convertible would be OK.
This is general to all dds.
Comment 1 Martin Grebac 2005-02-02 16:06:23 UTC
The connected requirement would be the ability to open dd editor in
xml view with specific element shown. (Maybe this is already there,
I'm just writing it here just to be sure)
Comment 2 Milan Kuchtiak 2005-03-04 08:36:39 UTC
Implemented.
Use :

XMLMultiViewDataObject:showElement(Object element) method, e.g.

...
DDDataObject dObj = .........;
WebApp webApp = dObj.getWebApp;
Servlet servlet =
webApp.findBeanByName("Servlet","ServletName","ControllerServlet");
dObj.openElement(servlet);
...
Comment 3 Milan Kuchtiak 2005-03-04 08:53:24 UTC
I am sorry for small mistake.

The last command should be :
...
dObj.showElement(servlet);
Comment 4 Martin Grebac 2005-03-04 15:31:46 UTC
Actually, the showElement() method does not fulfil the original
requirement for PositionBounds. Is it possible to get PositionBounds
somehow?
Comment 5 Milan Kuchtiak 2005-03-04 17:05:16 UTC
OK, this is a problem of XML editor.

Nevertheless, you can use showElement() method for refactoring related
to web.xml/ejb-jar.xml. 
Navigation to the graphical editor should be preferred to xml editor
everywhere where it is possible.
Comment 6 Martin Grebac 2005-10-23 19:09:27 UTC
positionbounds are not needed now, so marking this again as already fixed
Comment 7 Martin Grebac 2007-04-03 15:57:05 UTC
v