Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324058 - Provide user selection context in IDirectEditing APIs
Summary: Provide user selection context in IDirectEditing APIs
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.8.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Indigo M7 theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 03:19 EDT by Nurali CLA
Modified: 2011-06-24 09:12 EDT (History)
4 users (show)

See Also:
michael.wenz: indigo+


Attachments
Details for workaround (350.00 KB, application/x-zip-compressed)
2010-09-08 09:58 EDT, Michael Wenz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nurali CLA 2010-08-31 03:19:37 EDT
Build Identifier: Eclipse 3.6

Hi,

I request you to provide some context information about user selection in IDirectEditing APIs.

** Current feature:

As I know there is an API,

String[] getValueProposals(String value, int caretPosition, IDirectEditingContext context);

Which supposed to return array of String which will be given to user for selection while doing direct editing on Shape.

and there is another API

void setValue(String value, IDirectEditingContext context);

which will give user selection in variable 'value', which is also string.  

** Issue with Current feature:

As there in only String object passed between both APIs. In case, where there is multiple strings having same value is returned from getValueProposals() API, it is difficult for API user to figure out exact selection from setValue() API.

** Expected feature:

It would be great if you can provide some context between both APIs.  So that user selection can be known from the context provided.

** My use case:

We are using IDirectEditing feture where we returned array of String which contains below strings

Step1
step1
Step1

These values we derieve from some domain objects.  And after user selection, we want to derieve selected domain object. If we are getting only String object then for us it is difficult to know which domain object corresponds to the string.

-----

Let me know if you want any input from my side. Hope, I have clear the requirement well.  We are looking to get this feature as early as possible.

Thanks & Regards,
Nurali

Reproducible: Always
Comment 1 Michael Wenz CLA 2010-09-08 09:57:01 EDT
The same issue appears in the stantard EClass diagram editor when you have several ECLass objects with the same name belonging to different EPackages.

A workaround is already possible today: the names provided by getValueProposal must contain additional information that is suitable to identify the selected object (in the above example this would be something like <class name> - <package name>).
Comment 2 Michael Wenz CLA 2010-09-08 09:58:48 EDT
Created attachment 178407 [details]
Details for workaround

The attached file contains details on the described workaround for a similiar problem in a MOF Class Editor
Comment 3 Matthias Gorning CLA 2011-04-08 04:48:19 EDT
Done. There is a new method in IDirectEditing: 

IProposalSupport getProposalSupport();
Comment 4 Matthias Gorning CLA 2011-04-08 04:50:41 EDT
Done. There is a new method in IDirectEditing which can be implemented to achieve the proposed behavior: 

IProposalSupport getProposalSupport();

An example can be found in the class SketchTextProposalDirectEditingFeature.
Comment 5 Michael Wenz CLA 2011-05-27 09:22:44 EDT
Part of 0.8.0
Comment 6 Michael Wenz CLA 2011-06-24 09:12:38 EDT
Part of Graphiti Indigo 0.8.0