This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 329183 - Multi-valued attrs of primitive types in instance diagrams - enhancement request
Summary: Multi-valued attrs of primitive types in instance diagrams - enhancement request
Status: VERIFIED FIXED
Alias: None
Product: Tigerstripe (Archived)
Classification: Technology
Component: Diagrams (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.5M0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-01 07:46 EDT by Yoram CLA
Modified: 2010-11-29 10:30 EST (History)
4 users (show)

See Also:


Attachments
little ellipses (39.59 KB, image/png)
2010-11-15 18:56 EST, Chris Hartley CLA
no flags Details
edit dialog (21.76 KB, image/png)
2010-11-16 06:23 EST, Anton Salnik CLA
no flags Details
Screenshot (122.58 KB, image/png)
2010-11-17 16:16 EST, Navid Mehregani CLA
no flags Details
Multi-valued attrs patch (27.39 KB, patch)
2010-11-18 06:57 EST, Anton Salnik CLA
no flags Details | Diff
First entry is empty! (27.17 KB, image/png)
2010-11-19 10:55 EST, Navid Mehregani CLA
no flags Details
329183_c13 (44.02 KB, patch)
2010-11-25 10:53 EST, Anton Salnik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoram CLA 2010-11-01 07:46:14 EDT
a) Data entry

At present, assigning values to multi-valued attributes (primitive type)  in instance diagram is done by a delimited list. You may use coma separated list or space separated list or any other such.
It would be nice to pop-up an array box that allows you to enter multiple values. This would make the encoding more uniform and easy to document.
The above is for primitive types. For complex type the behavior is different. You are presented with a selection list of available instances (of the type) and can multi-select. It would be nice to have this also in an array of values where you get the little ellipses on each line (reason under #b below)

b) Ordered multi-valued attributes

When a multi-valued attribute is also ordered we need presentation and gestures that allow us to specify order. The above enhancement would also serve this as the order of values in the array would be assumed to be the order of the values in the attribute. This works for both primitive as well as complex types.
Comment 1 Chris Hartley CLA 2010-11-01 16:24:38 EDT
Regarding a) we need to decide how to display the values show on the diagram

e.g I have an attribute values:float[*]

I enter into my list
2.5
11.2
0.001

so on the diagram I should see something like
values=2.5;11.2;0.001

where I have chosen ; as a delimiter
Comment 2 Anton Salnik CLA 2010-11-15 10:10:13 EST
(In reply to comment #0)
> a) Data entry
>... It would be nice to have this also in an array of values
>where you get the little ellipses on each line (reason under #b below)
>...
Could you explain in more details what "little ellipses" are? Do you want to have a list of values with multi select option?
Comment 3 Chris Hartley CLA 2010-11-15 18:56:11 EST
Created attachment 183178 [details]
little ellipses

I think this is what "little ellipses" refers to
Comment 4 Yoram CLA 2010-11-16 04:03:14 EST
(In reply to comment #3)
> Created an attachment (id=183178) [details]
> little ellipses
> I think this is what "little ellipses" refers to

(In reply to comment #3)
> Created an attachment (id=183178) [details]
> little ellipses
> I think this is what "little ellipses" refers to

Ah, ok, so I mean the following:

We populate an instance and click on an attribute that is multi-valued and is of a complex type data type. What should happen?
The data entry space to the right of the attribute name has "little ellipses". When you click you see a box that has multiple lines for entering values (it is a multi-valued attribute!). Each of those lines also have "little ellipses". Now, when you're in one particular line and you click on the "little ellipses" button you see exactly what you would in a single-valued attribute of a complex type -- a list of existing instances (with checkboxes next to them behaving like radio buttons, nut multi-selected). In other words - we are allowing you to enter a *single* value for each of the lines in the multi-value attribute.

Important: there should be a way to reorder -- up/down buttons work, for example.

Also -- for each of the single value cells you should also be an opportunity to create new instance (just like the current, single valued AND multi-valued behavior.

It is really difficult to describe this without pictures... If this does not work I will attempt to draw a pic, but I hope that the description is good enough.

*Yoram
Comment 5 Anton Salnik CLA 2010-11-16 06:23:10 EST
Created attachment 183213 [details]
edit dialog

>The data entry space to the right of the attribute name has "little ellipses".
>When you click you see a box that has multiple lines for entering values (it is
>a multi-valued attribute!). Each of those lines also have "little ellipses".

Hi, Noram.
It's ok to use "little ellipses" for edit values. But for adding new values the solution is not intuitive from my point of view. Eclipse way for such things is to have additional add/remove buttons (please check attachment for more details). In this case add button will open dialog to add new or select a value. 

Please share your thoughts.
Comment 6 Yoram CLA 2010-11-16 08:00:51 EST
(In reply to comment #5)
> Created an attachment (id=183213) [details]
> edit dialog
> >The data entry space to the right of the attribute name has "little ellipses".
> >When you click you see a box that has multiple lines for entering values (it is
> >a multi-valued attribute!). Each of those lines also have "little ellipses".
> Hi, Noram.
> It's ok to use "little ellipses" for edit values. But for adding new values the
> solution is not intuitive from my point of view. Eclipse way for such things is
> to have additional add/remove buttons (please check attachment for more
> details). In this case add button will open dialog to add new or select a
> value. 
> Please share your thoughts.

Anton hello,
I'm not sure what you mean by "ok to edit values but not ok to add values". I'm following exactly what is done everywhere in instance diagram in TS.
As long as you come up with something that is useful and usable I'm going to be happy. All of my suggestions are aimed to illustrate the functionality, not to specify the UI.
*Yoram (Or Noram, as you prefer to spell it)
Comment 7 Navid Mehregani CLA 2010-11-17 16:16:27 EST
Created attachment 183349 [details]
Screenshot

I've created a snapshot based on the comments by Yoram and Anton.  
Yoram, please let me know your thoughts on this.
Comment 8 Yoram CLA 2010-11-18 06:18:25 EST
(In reply to comment #7)
> Created an attachment (id=183349) [details]
> Screenshot
> I've created a snapshot based on the comments by Yoram and Anton.  
> Yoram, please let me know your thoughts on this.

Navid -- thanx much for that. Almost perfect!

One comment: In the leftmost picture you have a yellow note that says that 'User would get the "little ellipses" for all types of attributes that have a multiplicity bigger than one'. Now that's correct but the "little ellipses" would also show up for datatypes in any multiplicity (and enums have a slightly different behavior -- down arrow to select from list).

*Yoram
Comment 9 Anton Salnik CLA 2010-11-18 06:57:11 EST
Created attachment 183375 [details]
Multi-valued attrs patch

Implementation added. For now i reused ", " separator (default separator for complex types) separator for primitive values separation. Should i change the separator to ";" as was proposed by Chris? If yes should the separator be used for complex values separation?
Comment 10 Yoram CLA 2010-11-18 07:09:12 EST
(In reply to comment #9)
> Created an attachment (id=183375) [details]
> Multi-valued attrs patch
> Implementation added. For now i reused ", " separator (default separator for
> complex types) separator for primitive values separation. Should i change the
> separator to ";" as was proposed by Chris? If yes should the separator be used
> for complex values separation?

Ah, well... If I were to decide this I'd say that for the case where actual values are more than one, place the first one in the box and provide a means to see the rest in a multi-line box. Use either the down arrow or the "little ellipses". 
I'm concerend about multi-valued string attributes, where a delimiter may cause problems if it is actually part of the string. We quickly run into a need to escape charachters and replace delimiters. There's not a single delimiter that can be viewed as "safe" for strings, not even space.

BUT -- I could consult with folks who are more GUI oriented than myself.

*Yoram
Comment 11 Navid Mehregani CLA 2010-11-18 10:41:51 EST
> I'm concerend about multi-valued string attributes, where a delimiter may cause
> problems if it is actually part of the string. We quickly run into a need to
> escape charachters and replace delimiters. There's not a single delimiter that
> can be viewed as "safe" for strings, not even space.
> 
> BUT -- I could consult with folks who are more GUI oriented than myself.
> 
> *Yoram

The delimiter shouldn't cause any problems because we're using a list to specify all the values as indicated in the second dialog in my snapshot.  The only minor issue it may cause is when you're viewing the values in the first dialog, but I don't think that's a major issue, since the user can click on the little ellipses to view everything properly in the list.

As for displaying the values in the the first dialog indicated in the snapshot, I think we should just use a comma to separate them out, but the user will have the option of clicking on the little ellipses to get the full list.  I don't think we should invest time in implementing a multi-line display as there are higher priority items that need to be addressed.
Comment 12 Yuri Strot CLA 2010-11-19 06:29:56 EST
I've applied Anton's patch. Please reopen this bug if you still see any issues.
Comment 13 Navid Mehregani CLA 2010-11-19 10:52:48 EST
Thanks Anton.  This is looking better than before, but I found a number of issues.  Try the following:

- Create a model project with two entities: Ent0 and Ent1
- Under Ent0, create two attributes called:
    o primitiveListOrdered   (Select String as type, 0..* as multiplicity, make sure 'Ordered' and 'Unique' is checked)
    o complexListOrderedNotUnique (Select Ent1 as type, 0..* as multiplicity, make sure 'Ordered' is checked and 'Unique' is UNchecked.

- Create a instance diagram file
- Drag and drop Ent1 onto your diagram *twice*.  Call first instance ent1_a and second instance ent1_b

- Drag and drop Ent0 onto you diagram.  Here are the problems:

1) Click on "..." for primitiveListOrdered > Click on Add three times > click on first entry > type in 'Value1' > Press Enter > Click on second entry > 'Value2' > press Enter > Click on third entry > type in 'Value3' (DON'T press Enter) > Make sure the cell is still in edit mode and just click on OK > Notice the values are displayed as: value1, value2, <click here to edit>

2) Click on "..." for primitiveListOrdered > Select multiple items in your list and click on Remove > Notice that only one of the items is removed.  I would expect all selected items to be removed.  Also, Up/Down buttons should be disabled when more than one item is selected

3) In some cases when I click on "..." for primitiveListOrdered and click on Add > the first entry seems to be empty (I'll attach a screenshot for more details)

4) Click on "..." for primitiveListOrdered > Add a bunch of items to the list > click on OK > Notice the specified items are listed in the value column of primitiveListOrdered > click in the Value column for complextListOrderedNotUnique (without clicking on "...") > notice the items that were specified for primitiveListOrdered are no longer displayed > if you click on "..." for primitiveListOrdered, all the items that were specified before are now gone!

5) Click on "..." for complexListOrderedNotUnique > click on Add > Make sure 'select new instances from diagram' is selected > You should only be able to select ONE item from this list.  At the moment I can select both ent1_a and ent1_b!  Also when I select ent1_a and click on OK > if I click on Add again, ent1_a is no longer in the list.  This is not correct, since we specified our attribute NOT to be unique.  Hence it can have duplicate items.  For example, I should be able to set this attribute to ent1_a, ent1_b, ent1_a, ent1_a, ent1_b
Comment 14 Navid Mehregani CLA 2010-11-19 10:55:00 EST
Created attachment 183475 [details]
First entry is empty!

This screenshot is with regards to item#3 in the above post.
Comment 15 Anton Salnik CLA 2010-11-25 10:53:05 EST
Created attachment 183863 [details]
329183_c13
Comment 16 Yuri Strot CLA 2010-11-29 06:11:51 EST
Anton's patch applied.
Comment 17 Navid Mehregani CLA 2010-11-29 10:30:17 EST
Looks excellent.  Thanks Anton!
Marking as Verified.