Community
Participate
Working Groups
It is not possible to access the EObject that might be stored in field additionalProposalInfo. The getters getAdditionalProposalInfo() either return the string representation or hover information. Access to the object might be necessary to decide the priority of proposals for a cross reference (IContentProposalPriorities) depending on the type of object.
+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.