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 54793 - showMenuItem(String, StringComparator) doesn't use comparator for last path item obtaining
Summary: showMenuItem(String, StringComparator) doesn't use comparator for last path i...
Status: CLOSED FIXED
Alias: None
Product: qa
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P1 blocker (vote)
Assignee: _ mriem
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-10 07:46 UTC by Alexander Kouznetsov
Modified: 2011-02-17 09:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2005-02-10 07:46:38 UTC
Both showMenuItem(String, StringComparator) and
showMenuItem(String[], StringComparator) doesn't
use specified StringComparator for last path
MenuItem obtaining. So user can't select item
Close if it is "shadowed" by preceding items like
"Close All" or something like that by specifying
exact StringComparator
Comment 1 Alexander Kouznetsov 2005-02-10 08:53:07 UTC
This is due to the fact that JMenuItemOperator has no constructor with
StringComparator argument. For the last path item JMenuItemOperator
constructor is called with menu item string specified. It uses
comparison algorithm, specified for its container operator.

Hence we have to ways to fix this bug:
1) Change StringComparator for container operator before
JMenuItemOperator constructor invocation.
2) Provide several new constructors with StringComparator argument

I think that 2nd way is more general so it should be implemented in
order to fix this bug
Comment 2 Alexandre Iline 2005-03-23 14:57:52 UTC
Component operator needs to assingned to whatever container is used for JMenuItemOperator creation.
I've done with the fix - next integration will contain it.

I am against inplementing the second approach. 

The basic idea around constructors is: constructor parameters specify component lookup information.
All the environment is taken from container operator.
Comment 3 Alexander Kouznetsov 2005-12-05 16:38:47 UTC
What is regarding the state of this issue? Is it fixed?
Comment 4 _ mriem 2006-07-20 03:27:13 UTC
Verified to work by adding unit test in JMenuBarOperatorTest.