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

Bug 173213

Summary: [Commands] Show View cannot be executed from the Command Composer
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, mike.pawlowski, wassim.melhem
Version: 3.3   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 172321, 173206, 178228    
Attachments:
Description Flags
Work in progress - v01
none
Dialog supports Workbench v02
none
Command composer supports workbench v02
none
Handler Service v01
none
Hander Service v02 none

Description Paul Webster CLA 2007-02-06 19:35:03 EST
The command composer has an execute function to allow users to check out their commands.  While some command won't work from that situation, Show View used to until I changed from workbench.getActiveWorkbenchWindow() to HandlerUtil.getActiveWorkbenchWindow(event).

I suspect that being in a dialog is not providing the ACTIVE_WORKBENCH_WINDOW_NAME variable.

PW
Comment 1 Paul Webster CLA 2007-03-25 15:14:43 EDT
Created attachment 61932 [details]
Work in progress - v01

Register the second type of dialog
PW
Comment 2 Paul Webster CLA 2007-03-25 15:25:34 EDT
As it turns out, there are 2 types of dialogs eclipse.  A dialog that expects to be a dialog :-) and a dialog that is part of the current workbench window work flow (like the command composer or the expanded hover icon bar).

The dialog always removes window keybindings (which we want) and deactivates all workbench window based handlers (which we don't want).

The first approach I'm trying is allowing dialog shells to register in IContextService#registerShell(*) with the TYPE_DIALOG_WITH_WORKBENCH constant.  The getShellType(*) method will return TYPE_DIALOG, but the workbench services will be able to differentiate between dialogs that should deactivate workbench window handlers and dialogs that shouldn't.  The default if you don't do anything will be the current behaviour.

PW
Comment 3 Paul Webster CLA 2007-03-25 15:57:20 EDT
test should be:
d.create();
//register shell
d.open()
Comment 4 Paul Webster CLA 2007-03-26 14:09:47 EDT
Created attachment 62000 [details]
Dialog supports Workbench v02

A dialog registered with the correct constant will have the active workbench window available to its evaluation context.
PW
Comment 5 Paul Webster CLA 2007-03-26 15:06:46 EDT
Created attachment 62012 [details]
Command composer supports workbench v02

This is the matching *draft* patch to the command composer that marks the dialog as "running with wolves" uh I mean workbench window.

PW
Comment 6 Paul Webster CLA 2007-03-29 18:37:20 EDT
Since this requires new API, it will (unfortunately) have to be put off until 3.4

PW
Comment 7 Paul Webster CLA 2007-04-09 07:27:08 EDT
Perhaps a way to execute a command in a given context would work.

PW
Comment 8 Paul Webster CLA 2007-04-18 21:50:52 EDT
Created attachment 64257 [details]
Handler Service v01

Currently internal methods, but a way to ask the handler service to execute the correct handler for a given context (and get a proper context snapshot).

PW
Comment 9 Paul Webster CLA 2007-04-22 14:51:12 EDT
Created attachment 64547 [details]
Hander Service v02

As much as possible, execute a command within a specified application context.
PW
Comment 10 Paul Webster CLA 2007-04-22 14:52:34 EDT
(In reply to comment #9)
> Created an attachment (id=64547) [details]
> Hander Service v02

Released to HEAD >20070422
PW
Comment 11 Paul Webster CLA 2007-04-24 11:26:07 EDT
A much more predictable approach is the allow the application context to be fed into the system and control the aspects of command execution (activate handler, enable handler, execute).

The internal approach will suffice for 3.3 for use with PDE and bug 183810 has been opened to work out the API for 3.4

PW
Comment 12 Paul Webster CLA 2007-05-01 14:44:10 EDT
In I20070501-0010
PW