Community
Participate
Working Groups
Build 20020502 I would expect Print to work on the selection of the Navigator or Packages view since Print is in the File menu. However the menu is only available if an editor is active.
Print is a global retargetable action which the views would have to handle. Defer to v3.
Reopen for investigation
Is this still an issue in 3.2?
Is there someting in comment 0 that you do not understand and that doesn't let you reproduce the problem?
reopening
Actually I was going through a lot of bug quickly - moving to Paul to investigate
Print is a retargetable action, and is only enabled if the part provides a print action. ex, AbstractTextEditor provides a print action. This doesn't look like a problem to me. PW
>This doesn't look like a problem to me. The point is that the Navigator (and also the Package Explorer) should retarget the command in order to make print work off a structured selection.
In our case the Project explorer should be providing the action handler if possible. PW
This is not an enhancement.
Created attachment 161383 [details] Preliminary work on a patch Paul, I can see that the selection changed listener is getting invoked, and telling the handler service to activate the handler, but the File -> Print menu item (in the main menu bar) does not enable. Can you help me with this? I know this bug is probably not that important, but I mainly want to learn about the actions/commands and have the experience, one time in my life, of fixing a 5 digit bug number.
(In reply to comment #11) > Created an attachment (id=161383) [details] > Preliminary work on a patch > > Paul, > > I can see that the selection changed listener is getting invoked, and telling > the handler service to activate the handler, but the File -> Print menu item > (in the main menu bar) does not enable. Can you help me with this? Sure, comments: 1) you have to entries in your plugin.xml that don't do anything 2) ActionFactory.PRINT is a retarget action. It was used in the WorkbenchActionBuilder to add Print to the main menu/toolbar, but it doesn't do anything by itself. You can't use it as your print handler. 3) For example, text does it with the code in org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPrintAction() PW
Created attachment 161790 [details] The ProjectExplorer portion This gets the action enabled properly depending on the selection. It has been tested to enable and run the action. However it needs to be finished correctly to identify which editor can print and have the editor print, which is something beyond the scope of the ProjectExplorer. Feel free to change the contents of PrintAction.updateSelection() and .run to hook up to the appropriate mechanisms.
Not sure if this is Platform Text or editor management, trying text first.
I find this confusing. Why should the enablement of the print action depend on whether the selected file is opened in an editor anywhere? I see 4 possible implementations for a Print action in Navigator-like views: 1) Print the view (similar to request in bug 108320) 2) Print the selected files (bug 6134) 3) Print the frontmost editor, i.e. Print action targets the same editor as the Save action. Not that this should work from all views that don't define their own print action. 4) Do not enable print for now I would prefer (4). Dani, please have a look (and note that the original summary has been changed).
*** This bug has been marked as a duplicate of bug 6134 ***