| Summary: | ConfigurableCompletionProposal: Provide access to the EObject in additionalProposalInfo | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Karsten Thoms <karsten.thoms> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | mike, sebastian.zarnekow, sven.efftinge |
| Version: | 2.0.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | v2.4.3 | ||
|
Description
Karsten Thoms
+1 yup... I just ran into the same problem and was about to open an issue and found this. I'm currently working around this via a https://github.com/vorburger/efactory/blob/15f22d91ae3d64c9a97f9af6120549ef50e7ebed/com.googlecode.efactory.ui/src/com/googlecode/efactory/ui/contentassist/ConfigurableCompletionProposal2.java and then using that via: @Override protected ConfigurableCompletionProposal doCreateProposal(String proposal, StyledString displayString, Image image, int replacementOffset, int replacementLength) { return new ConfigurableCompletionProposal2(proposal, replacementOffset, replacementLength, proposal.length(), image, displayString, null, null); } in my *ProposalProvider, but that's not very nice, of course. PS: I would simply provide access to the Object (not EObject) in additionalProposalInfo, note my Object getAdditionalTypedProposalObject() - this would be more consistent with the fact that setAdditionalProposalInfo() takes a java.lang.Object and not an EObject arg. Since 2.4.3, you may use
/**
* Used to store arbitrary data as a protocol between two or more clients unknown to this class.
*
* @since 2.4
*/
public void setAdditionalData(String key, Object additionalData) {
if (this.additionalData == null)
this.additionalData = newHashMap();
this.additionalData.put(key, additionalData);
}
/**
* Used to store arbitrary data as a protocol between two or more clients unknown to this class.
*
* @since 2.4
*/
public Object getAdditionalData(String key) {
return additionalData != null ? additionalData.get(key) : null;
}
see comment #3 Requested via bug 522520. -M. Requested via bug 522520. -M. |