Community
Participate
Working Groups
Build Identifier: 0.8.0RC1-201105171213 With this bug, it's impossible to show some additional details in proposals list. There is shown exactly the text that would be set after selecting given proposal. After implementing org.eclipse.graphiti.func.IProposalSupport.getValueProposals(String, int, IDirectEditingContext) , list proposing possible values in editor should show org.eclipse.graphiti.func.IProposal.getText() for every IProposal. Instead of IProposal.getText() for every proposal, values returned from org.eclipse.graphiti.func.IProposalSupport.completeValue(String, int, IProposal, IDirectEditingContext) for every proposal is shown. Simple fix is to change line 59 in org.eclipse.graphiti.ui.internal.parts.directedit.ContentProposalProvider http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.gmp/org.eclipse.gmp.graphiti/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/directedit/ContentProposalProvider.java?view=markup&root=Modeling_Project from proposals[i] = new ContentProposal(directEditHolder, position, contents, null, valueProposals[i], null); to proposals[i] = new ContentProposal(directEditHolder, position, contents, valueProposals[i].getText(), valueProposals[i], null); Reproducible: Always
To have the value to be set in your diagram (text GA) be independent of the proposal texts, you can implement your own ProposalSupport. Your class can extend AbstractProposalSupport. The method to decide about the text value to be set is setValue(). There you receive the current text value, the proposal object as well as the context. At this point nearly everything is possible.
(In reply to comment #1) > To have the value to be set in your diagram (text GA) be independent of the > proposal texts, you can implement your own ProposalSupport. Your class can > extend AbstractProposalSupport. The method to decide about the text value to be > set is setValue(). There you receive the current text value, the proposal > object as well as the context. At this point nearly everything is possible. I'm talking about little different problem. I will try to explain it more. I use scenario with ProposalSupport implented as extended AbstractProposalSupport. I have direct edit text box. With populated proposals list. I would like to show proposals labels in list, and after selecting proposal set text in text box different from proposal label (set text in text box, not in diagram elements, after accepting proposal, we are still editing text box!). Expected behaviour, as I understand, should be: When proposal from list is selected and accepted, result of completeValue(...) is set as text box value. After that, I can edit text in text box if I want. Then when value in text box is accepted, setValue(...) changes values in diagram elements. So I cannot use setValue to correct this bug, because setValue is called after accepting value in text box and it is not called after accepting proposal from proposals list. Problem is, that in current Graphiti, value from completeValue(...) is used as label for every proposal in proposals list. Here I expect IProposal.getText() should be used as label, but it is not used at all. (completeValue(...) is used as label, because ContentProposal label is set to null, where I suggested to use IProposal.getText(), in previous post).
Fixed as proposed in the bug description.
Bookkeeping
Relevant for IP log
Part of Graphiti 0.9.0 (Eclipse Juno)