Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 428154

Summary: Remove makeAlternate() functionality from globalCommands
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 5.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=428118
Whiteboard:

Description Mark Macdonald CLA 2014-02-13 18:23:35 EST
globalCommands#setPageTarget( ) allows a page to specify an "alternate" model object that commands can validate against if they do not apply to the real page target.

For example:

When a file is selected in the navigator, Git Status is shown for the parent folder. The Git Status command only targets Directories, so normally it would not be shown when selecting a folder. But it gets another chance because the page provides a makeAlternate() function that returns the parent folder.

I believe Git Status is the only client of makeAlternate().

We should re-think the makeAlternate() API, as it can cause commands to appear when it makes no sense to show them. See bug 428118 comment 1 for a concrete example of "orion.editFromMetadata", which should only ever appear when selecting a folder, but the page's alternate causes it to appear for files as well, where it is mislabelled and duplicates functionality that exists elsewhere.
Comment 1 John Arthorne CLA 2015-05-05 14:49:36 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html