DESCRIPTION

Bug 431714 - EModelService.findElements does not find handlers and
commands

Change-Id: I67fe64e75d05dce3e24544ebeefbef9a60bd9f13
Signed-off-by: Owen Strickland xxx@xxx.xxx


COMMENTS

author: Slade Moran
date: 2014-04-02 14:50:06.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2014-04-02 14:52:34.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1686/

-------------------------------------
author: Slade Moran
date: 2014-04-02 14:54:03.000000000

Patch Set 2: Code-Review-1

(2 comments)

I rebased your patch on master.  I think it's close.

Please update the org.eclipse.e4.ui.tests.application.EModelServiceFindTest with some possible find handler and find command tests.

PW

Line:186, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> Why is this added and  commented out?  Should probably be removed then.

Line:260, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> Can this not be included in the IN_PART check?  ANYWHERE will also match IN_PART.

-------------------------------------
author: Brenden Conley
date: 2014-04-02 15:08:07.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1686/ : SUCCESS

-------------------------------------
author: Owen Strickland
date: 2014-04-02 15:09:28.000000000

Patch Set 2:

(2 comments)

Line:186, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> If we do not change the Javadocs for IN_PART we should remove the comments....otherwise we just need to uncomment the code

Line:260, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> No...it will exclude the IN_ANY_PERSPECTIVE, IN_ACTIVE_PERSPECTIVE IN_SHARED_AREA

-------------------------------------
author: Slade Moran
date: 2014-04-02 15:48:16.000000000

Patch Set 2:

(2 comments)

Line:186, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> Change the javadoc to what?

Line:260, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> Ah, OK. that's good then.

-------------------------------------
author: Owen Strickland
date: 2014-04-02 16:33:43.000000000

Patch Set 2:

(1 comment)

Line:186, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java -> Original: Returned Location if the element is in a menu or a tool bar of an MPart

After: Returned Location if the element is in a MPart

-------------------------------------
author: Slade Moran
date: 2014-04-02 16:48:14.000000000

Patch Set 2:

So IN_PART used to be about including toolbars and menus in the search?  And now we want to say include toolbar, menus, and handlers?

-------------------------------------
author: Owen Strickland
date: 2014-04-02 17:00:22.000000000

Patch Set 2:

Personally I don't have a preference.  But if you write that piece of code:

findElements = service.findElements(application, null, MHandler.class, null, EModelService.IN_PART));

From my perspective(if I don't read the Javadoc), it will return all MHandler in any parts.

But, today it will return an empty array.

if you uncomment the code it will return all MHandler define at the MPart level

-------------------------------------
author: Owen Strickland
date: 2014-04-02 17:01:44.000000000

Patch Set 2:

So IN_PART used to be about including toolbars and menus in the search? 
YES

And now we want to say include toolbar, menus, and handlers?
YES

-------------------------------------
author: Zaid Mosley
date: 2014-04-02 17:21:27.000000000

Patch Set 2: Code-Review+1

Paul, maybe a misunderstanding, Louis is suggestion that IN_PART should return the handlers specified for a PART (not the global ones) Makes sense for me.

-------------------------------------
author: Slade Moran
date: 2014-04-02 17:22:21.000000000

Patch Set 2:

I would expect it to return handlers from parts as well, so I'm fine with updating the javadoc.

-------------------------------------
author: Owen Strickland
date: 2014-04-02 17:29:40.000000000

Patch Set 2:

@Paul: will you update the Javadoc and uncomment the code or you will merge this commit.

-------------------------------------
author: Slade Moran
date: 2014-04-02 17:33:11.000000000

Patch Set 2:

Could you please make the changes and push up the commit for review, and we'll review it again.

-------------------------------------
author: Owen Strickland
date: 2014-04-02 19:58:48.000000000

Patch Set 2:

Done,

In addition, you will found bindings and binding context (Bug 431798 - EModelService.findElements does not find bindings and bindingtables) in my last commit. 

Also, I saw a bug when changing  org.eclipse.e4.ui.tests.application.EModelServiceFindTest

From my perspective when looking for menu IN_ANY_PERSPECTIVE you need to get all the menus except the MAIN_MENU

-------------------------------------
