Bug 197922 - [Commands] Restart command In file Menu
Summary: [Commands] Restart command In file Menu
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P5 enhancement (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, helpwanted
: 206268 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-26 03:21 EDT by Manuel Selva CLA
Modified: 2008-10-02 02:56 EDT (History)
5 users (show)

See Also:


Attachments
Patch created using Team Synchronizing view (6.37 KB, patch)
2007-08-08 13:19 EDT, Manuel Selva CLA
no flags Details | Diff
restart command v02 (4.62 KB, patch)
2007-08-21 14:00 EDT, Paul Webster CLA
no flags Details | Diff
restar command v03 (4.76 KB, patch)
2007-10-04 19:08 EDT, Manuel Selva CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Selva CLA 2007-07-26 03:21:19 EDT
It will be nice to have a restart action in the file menu (and an associated keyboard short cut). 

Each time we add plugin to our plugin directory the platform must be restarted, to do this i actually have to do:

file -> switch workspace -> other -> ok
Comment 1 Tod Creasey CLA 2007-07-26 16:44:13 EDT
We would want a command now
Comment 2 Manuel Selva CLA 2007-07-27 02:40:49 EDT
(In reply to comment #1)
> We would want a command now
> 

I have already written a plugin doing this.
I can integrate this plugin inside the workbench one and submit a patch. Where is the best place to integrate such capability, the same place as the file -> exit command ? Last week i just had a quick look on this, and think to remember that there is may be several plugins to patch ?

What key shortcut associated to this action (alt + f6, alt + ..., ctrl + ... ) ?
Comment 3 Paul Webster CLA 2007-07-27 07:43:35 EDT
(In reply to comment #2)
> I have already written a plugin doing this.
> I can integrate this plugin inside the workbench one and submit a patch. Where
> is the best place to integrate such capability, the same place as the file ->
> exit command ? Last week i just had a quick look on this, and think to remember
> that there is may be several plugins to patch ?

How I'd lay it out:
1) put the restart command in org.eclipse.ui/plugin.xml: org.eclipse.ui.file.restartWorkbench
2) put the handler (based off of org.eclipse.core.commands.AbstractHandler) in org.eclipse.ui.workbench in the org.eclipse.ui.internal.handlers package
3) add a CommandContributionItem in WorkbenchActionBuilder (in org.eclipse.ui.ide) to add it to the mainMenu/File menu

> 
> What key shortcut associated to this action (alt + f6, alt + ..., ctrl + ... )
> ?

We're really trying hard to not add keybindings in the platform workbench.  There's no common keybinding for "restart app", so you'll probably still have to  bind it in the keys preference page or still use your own little plugin to contribute it to your eclipse installations.

PW
Comment 4 Manuel Selva CLA 2007-07-27 08:56:41 EDT
> How I'd lay it out:
> 1) put the restart command in org.eclipse.ui/plugin.xml:
> org.eclipse.ui.file.restartWorkbench
> 2) put the handler (based off of org.eclipse.core.commands.AbstractHandler) in
> org.eclipse.ui.workbench in the org.eclipse.ui.internal.handlers package
> 3) add a CommandContributionItem in WorkbenchActionBuilder (in
> org.eclipse.ui.ide) to add it to the mainMenu/File menu
> 

  After looking how it works for example for file -> exit i have one question about your suggestion:

   - I didn't find any QuitHandler, but only one QuitAction responsible for exiting the workbench (in org.eclipse.ui.workbench, org.eclipse.ui.internal), so why do not implement the restart action the same way. Do you see one reason to have several handler for the restart command ?
> 
> We're really trying hard to not add keybindings in the platform workbench. 
> There's no common keybinding for "restart app", so you'll probably still have
> to  bind it in the keys preference page or still use your own little plugin to
> contribute it to your eclipse installations.
   
  OK ;o) 
> 
> PW
> 

Comment 5 Paul Webster CLA 2007-07-27 10:13:34 EDT
(In reply to comment #4)
>   After looking how it works for example for file -> exit i have one question
> about your suggestion:
> 
>    - I didn't find any QuitHandler, but only one QuitAction responsible for
> exiting the workbench (in org.eclipse.ui.workbench, org.eclipse.ui.internal),
> so why do not implement the restart action the same way. Do you see one reason
> to have several handler for the restart command ?

Actions are the "old" way ... if you look at ActionFactory.ABOUT we've started converting things like the AboutAction to the AboutHandler (we haven't arrived at QuitAction yet :-)

Just like the command org.eclipse.ui.help.aboutAction, you would provide your RestartHandler as the defaultHandler for the restartWorkbench command.

PW
Comment 6 Manuel Selva CLA 2007-07-27 10:22:20 EDT
> Actions are the "old" way ... if you look at ActionFactory.ABOUT we've started
> converting things like the AboutAction to the AboutHandler (we haven't arrived
> at QuitAction yet :-)
> 
> Just like the command org.eclipse.ui.help.aboutAction, you would provide your
> RestartHandler as the defaultHandler for the restartWorkbench command.
> 
> PW
> 

Thanks Paul,

I have now understood how things are managed. I will submit a patch containing the added handler and the diff result of plugin.xml (org.eclipse.ui) and the diff result of Workbench action builder. Is it the right way to submit a patch ?
Comment 7 Paul Webster CLA 2007-07-27 10:29:58 EDT
(In reply to comment #6)
> 
> I have now understood how things are managed. I will submit a patch containing
> the added handler and the diff result of plugin.xml (org.eclipse.ui) and the
> diff result of Workbench action builder. Is it the right way to submit a patch
> ?

That sounds correct, you can just attach the patch to the bug.

A good way to generate a one-off patch is to get a new workspace and use the platform-ui module (at the bottom of CVS Repository Exploring view for anonymous@dev.ecilpse.org:/cvsroot/eclipse when you expand HEAD) to check out the platform ui projects.  You'll get about 18 projects, and then you can close org.eclipse.ui.win32 and org.eclipse.ui.carbon.

If you make your changes (add the handler to org.eclipse.ui.workbench, the command definition to org.eclipse.ui, and update WorkbenchActionBuilder) you can use the Team Synchronizing Perspective to generate one patch that contains all of your modifications.

But don't worry if it's not quite correct, we'll review it and spin a new patch if necessary.

PW


Comment 8 Manuel Selva CLA 2007-07-27 10:35:19 EDT
Ok.

I will do my first (first real contribution. It's a little one, but it s the good way to start :-) ) contribution this week end.

Manuel
Comment 9 Manuel Selva CLA 2007-08-08 13:19:03 EDT
Created attachment 75690 [details]
Patch created using Team Synchronizing view

As suggested, one patch for all modification has been created using Team Synchronizing view.

Let me know if something is wrong

Regards 

Manuel
Comment 10 Paul Webster CLA 2007-08-21 14:00:53 EDT
Created attachment 76569 [details]
restart command v02

Manuel, I've updated your patch to remove ActionFactory and WorkbenchActionBuilder (those were my legacy suggestions) and add an org.eclipse.ui.menus extension into org.eclipse.ui.ide.application/plugin.xml

Could you please try out this patch?  If it is good, please update the contributor information for RestartWorkbenchHandler to include something like:
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 12116 [Contributions] widgets: MenuManager.setImageDescriptor() method needed

It goes in the copyright comment above the package statement.  You don't need the title, just the bug number will do.  Re-spin the patch with that, and then I'll see if I can get it in this week.

PW
Comment 11 Manuel Selva CLA 2007-09-10 06:53:10 EDT
(In reply to comment #10)

Hi Paul,

Sorry for my late answer but i was on holydays during the last three weeks.
I will try your patch soon (tommorow in the worst case) and let you know.

Your request concerning the patch comment will be included in the next Eclipse release ? With my name for such little modifications ?

Regards

Manuel

Comment 12 Paul Webster CLA 2007-09-24 13:52:05 EDT
ping ... I'm trying to do contributions this week and next week, if you want to get this patch in.

PW
Comment 13 Manuel Selva CLA 2007-09-28 02:44:30 EDT
(In reply to comment #12)
> ping ... I'm trying to do contributions this week and next week, if you want to
> get this patch in.
> 
> PW
> 

Hi Paul,

I have been very busy the last weeks (cause of a house moving and a lot of work). I tried this morning, today is Eclipse bug day, to test your patch, but i can't access Eclipse' CVS repositories from my work (we are behind a firewall).

I will do it this evening (i am in France), this time it's sure and let you know. 

Manuel
Comment 14 Paul Webster CLA 2007-10-03 08:05:31 EDT
ping
Comment 15 Manuel Selva CLA 2007-10-04 19:08:28 EDT
Created attachment 79780 [details]
restar command v03
Comment 16 Manuel Selva CLA 2007-10-04 19:10:38 EDT
Hi Paul,

First of all, thank you for your patience since i already told twice: "I am going to do this tommorow".  

This time is the good one. 

After a one hour hard battle on a very old 256 Ram Windows XP station here is the patch with just the contributor information for RestartWorkbenchHandler class added. Your patch works fine for me, the only problem i got was the time to build the 16 projects with 256M of Ram ;o)

Please let me know if all is ok.

Manuel
Comment 17 Miles Parker CLA 2007-10-14 22:03:42 EDT
*** Bug 206268 has been marked as a duplicate of this bug. ***
Comment 18 Manuel Selva CLA 2008-01-11 05:29:08 EST
Hi all,

I just want to have news about this feature ??

Thanks

Manuel
Comment 19 Paul Webster CLA 2008-02-03 10:46:51 EST
Released to HEAD >20080203
PW
Comment 20 Paul Webster CLA 2008-02-05 13:57:46 EST
In I20080205-0010
PW
Comment 21 Dani Megert CLA 2008-10-02 02:56:15 EDT
Using 't' for the mnemonic wasn't a good idea (see bug 249433).