Bug 525679 - Provide generic way to create element handles
Summary: Provide generic way to create element handles
Status: RESOLVED FIXED
Alias: None
Product: Handly
Classification: Technology
Component: Core (show other bugs)
Version: 0.8   Edit
Hardware: All All
: P3 enhancement
Target Milestone: 0.8   Edit
Assignee: Vladimir Piskarev CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2017-10-06 09:27 EDT by Vladimir Piskarev CLA
Modified: 2017-10-06 11:03 EDT (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 2017-10-06 09:27:49 EDT
Need to provide a generic way to create model element handles. The new API should support creating the element handle from its stable string representation ("memento"). It should also support creating the element handle from its corresponding IResource handle.
Comment 1 Vladimir Piskarev CLA 2017-10-06 10:19:22 EDT
It should be an option, not a requirement for a Handly-based model to implement the new API. Also, the implementation, if provided by the model, could support either or both create methods (from memento or IResource) as the model sees fit.
Comment 2 Vladimir Piskarev CLA 2017-10-06 11:03:24 EDT
Pushed to master:
http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=bb6866e48599ba4c7e10260e419d3e4f6bfd1e95

New API:

* IElementHandleFactory

* Elements#getHandleMemento(IElement)

Also included are exemplary implementations of the new API (see FooElementHandleFactory and JavaElementHandleFactory).