This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 126962 - Labels->empty submenu item is present if message has no operation
Summary: Labels->empty submenu item is present if message has no operation
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Diagram Sequence (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-08 01:52 UTC by Peter Lam
Modified: 2008-03-10 18:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
missing operation menu (12.06 KB, image/png)
2008-02-08 01:53 UTC, Peter Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Lam 2008-02-08 01:52:46 UTC
- create a couple of lifelines and name them with classifiers
- create a sync message between the lifelines
- right click on the message and select Labels
Result: The blank space is for "Operation". See attached screenshot.
Comment 1 Peter Lam 2008-02-08 01:53:13 UTC
Created attachment 56299 [details]
missing operation menu
Comment 2 Sergey Petrov 2008-02-08 06:45:42 UTC
I can try not to create blank action if corresponding functionality is fixed on general side, as for Operation item I
consider existence of an Operation item as a bug in 6.0, just try to use Labels|Operation in 6.0 and decide if behaviour
is appropratre
Comment 3 Sergey Petrov 2008-02-08 09:59:09 UTC
tried with only one action and got no sub-items for Labels,

Trey, can you look at this issue? in my opinion it requires LabelManager update, so it will work with single action
properly, other option is to decide which case is better, to have Operation item which produce no result or have emty
item which produce empty result.
Comment 4 Trey Spiva 2008-02-08 13:57:56 UTC
Yesterday I saw the same problem on associations, but when I first selected the association then right clicked on the edge the label actions was shown 
correctly.  That lead me to believe that this is a manifestation of the issue 126780. 

Can you try to first select the message then right click on the message to see if that is a work around.  If so it should be fixed when we have the issue 126780 fixed.
Comment 5 Sergey Petrov 2008-02-08 14:16:00 UTC
It's hard to verify with current paltte problems, I'll try again a bit later but most likely it's not the same issue
Do you have associations with only one subitem for Labels in context menu?
Comment 6 Trey Spiva 2008-02-11 21:40:15 UTC
After this patch, if there is only one label (which is the case when a lifeline does not have a representing classifier) the label will show up in the main part of 
the context menu.  In this case, I think that if the representing classifier is not set that the menu item should still appear, however it should be disabled.  
That would give the user a clue that something is not set up correctly.

I think some work needs to be done, because I do not think that that in this case, the label is correct.

Checking in drawingareacontrol/src/org/netbeans/modules/uml/drawingarea/actions/AddLabelsAction.java;
/cvs/uml/drawingareacontrol/src/org/netbeans/modules/uml/drawingarea/actions/Attic/AddLabelsAction.java,v  <--  AddLabelsAction.java
new revision: 1.1.2.9; previous revision: 1.1.2.8
done
Checking in diagrams/src/org/netbeans/modules/uml/diagrams/edges/sqd/MessageLabelManager.java;
/cvs/uml/diagrams/src/org/netbeans/modules/uml/diagrams/edges/sqd/Attic/MessageLabelManager.java,v  <--  MessageLabelManager.java
new revision: 1.1.2.22; previous revision: 1.1.2.21
done
Comment 7 Sergey Petrov 2008-02-11 23:21:57 UTC
let it be fixed, no empty not working item now.
this change may suite in other cases where only one item should be(not sure If we have any)
and disabled vs absent is just another approach, nothing is wrong with message if Operation is disabled, it just have no
associated operation, but I can change it to disabled if label manager support it.
Comment 8 Peter Lam 2008-02-16 01:31:52 UTC
Reopening this issue for discussion.
Here is the situation now after the fix. Very confusing what to expect.
1. If no label or operation displayed on the message, "Labels" w/o submenu is displayed on the popup menu but selecting
it does nothing at all. Sometimes "Link Names" is there instead of "Labels" on the popup menu from different part of the
same message line.
2. When an operation exist and is displayed, the "Operaitons" w/submenu and "Operation" w/o submenu are displayed on the
popup menu and selecting Operation turns off the operation from displaying. Sometimes "Link Names" and sometimes "Label"
is displayed on the popup menu from different part of the same message line. 

Comment 9 Trey Spiva 2008-03-06 17:02:48 UTC
If I understand your question correctly you are saying that when you select a message sometimes the an Operations label shows up, and some times it does 
not?  If that is the case, it sounds like we still need to implement the second part of my suggestion.  We need the invalid labels to be disabled.  Therefore if 
the Operations label is not a valid choice, it should show up, but it should simply be disabled.

I will check into how to disable a label.
Comment 10 Sergey Petrov 2008-03-06 17:17:15 UTC
some issues may be related with selection before right button click issues
Comment 11 Trey Spiva 2008-03-07 19:24:01 UTC
The pullright should always show up now.  I do see peters comments about his second point.  I also have the question about why the "Message Name" label is 
not shown when the "Operation" label is show.  I think that users may want to change the label from operation to Name.

Change Sets: http://hg.netbeans.org/uml-meteora/rev/f34346896c60
Comment 12 Sergey Petrov 2008-03-07 21:14:12 UTC
also fixed: Labels|Name and Labels|Operation are shown after operation addition,
there is another issue, so to show correct menu reselection may require
Comment 13 Peter Lam 2008-03-10 18:52:48 UTC
verified in latest build.