Bug 506717 - Support non-local file system in element API
Summary: Support non-local file system in element API
Status: RESOLVED FIXED
Alias: None
Product: Handly
Classification: Technology
Component: Core (show other bugs)
Version: 0.5   Edit
Hardware: All All
: P3 enhancement
Target Milestone: 0.6   Edit
Assignee: Vladimir Piskarev CLA
QA Contact:
URL:
Whiteboard: breakingchange
Keywords: api
Depends on:
Blocks:
 
Reported: 2016-10-28 10:48 EDT by Vladimir Piskarev CLA
Modified: 2016-11-07 08:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2016-10-28 10:48:58 EDT
Currently, getPath method in element API ties the model implementation to the local file system, as it can never return null according to its spec and the IPath cannot represent an external file in an arbitrary file system. A method like getLocationURI, similar to IResource#getLocationURI, would be a more flexible alternative. Notably, the getPath method has often been used for obtaining a string representation of the element for displaying to the user, e.g. in message dialogs. A better alternative would be a specialized toDisplayString method.
Comment 1 Vladimir Piskarev CLA 2016-11-07 08:36:55 EST
Pushed to master:
http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=7f498cbb5a983f8eadc9f48a5112e0b4cda31f11


Breaking changes:

* Elements#getPath, IElementExtension#getPath, IElementImpl#hPath - removed


New API:

* Elements#getLocalationURI, IElementExtension#getLocationURI, IElementImpl#hLocationURI

* Elements#toDisplayString, IElementImpl#hToDisplayString

* Element#hDoesNotExistException (protected)