tag:blogger.com,1999:blog-1557780184357927241.post2383263858817820854..comments2023-06-22T20:43:37.886+05:30Comments on Eclipse Tips - Prakash G.R.: Commands Part 3: Parameters for CommandsPrakash G.R.http://www.blogger.com/profile/13046268367318873066noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-1557780184357927241.post-63565473452642336552015-01-26T14:22:06.361+05:302015-01-26T14:22:06.361+05:30@Prakash thanks a lot for the comment explaining h...@Prakash thanks a lot for the comment explaining how to get the selected argument. Not sure if you're still active on the site, but I would most likely have spent hours looking for this info without your comment here.<br /><br />Lately I've been running into a lot of situations that look very hairy, but get solved very simply with the usage of a few utility classes, like HandlerUtil, WorkspaceSynchronizer, etc.<br /><br />Is there a chapter about these classes, or how exactly are people expected to learn about those?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-5025051520755279982012-08-30T20:05:12.842+05:302012-08-30T20:05:12.842+05:30Hi Prakash ,
Thanks for the nice post. Is there a...Hi Prakash ,<br /><br />Thanks for the nice post. Is there any way the parameter value can be any other object other than String ?<br /><br />Vinodvinod alluhttps://www.blogger.com/profile/09075816143008413263noreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-3829834248363565862011-06-14T22:26:27.068+05:302011-06-14T22:26:27.068+05:30"org.eclipse.ui.handlers" allows to spec..."org.eclipse.ui.handlers" allows to specify parameters, too, but it seems they are not made available in the handler's execute method. Is this right or do I miss something?<br /><br />Not working example:<br /><br /><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />[...]Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-47515235003705659562011-04-16T09:03:56.500+05:302011-04-16T09:03:56.500+05:30HI,
How to add command handler to the menumanage...HI, <br /><br />How to add command handler to the menumanager because <br /><br />Menumanager has add method which accept action has input it will not accept command handler… <br /><br />IMenuService menuservice = (IMenuService)PlatformUI.getWorkbench().getActiveWorkbenchWi ndow().getService(IMenuService.class); <br />ICommandService commadnService = (ICommandService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getServ ice(ICommandService.class); <br />Command cmnd = commadnService.getCommand(“com.jobsleaf.comman.display”); <br />MenuManager menumgr = new MenuManager(); <br /><br />/// how can i add command to menu manager <br /><br />menuservice.populateContributionManager(menumgr,”menu:com.ericsson.properties.view.view4 “); <br /><br />Please help me i am half the way of the problem <br /><br />more info <br /><br />http://www.eclipse.org/forums/index.php?t=msg&th=207827&start=0&S=bcb7e587d80fac913deba3389ec6e070 <br />Thanks <br />AshokAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-7530657967496954222010-12-29T05:27:43.615+05:302010-12-29T05:27:43.615+05:30That top example is almost exactly what I have bee...That top example is almost exactly what I have been searching for all day. However, I can't figure out how to use it to do what I want. I want to have an eclipse cheatsheet command that opens a specified file. If I use the file open command, it doesn't let me pass in parameters and just opens the window. If I can get it to open (execute) a file then I can run AHK and AutoIt scripts to further the cheatsheet automation. Please help.Gary Shttps://www.blogger.com/profile/00947643690211883132noreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-86229450520189852662009-11-18T10:00:08.933+05:302009-11-18T10:00:08.933+05:30@Anonymous,
The 'Show View' command ...@Anonymous,<br /><br /> The 'Show View' command with view id parameter.Prakash G.R.https://www.blogger.com/profile/13046268367318873066noreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-71508392892921676112009-11-18T06:41:37.883+05:302009-11-18T06:41:37.883+05:30I'm sorry, but I'm a bit new to the Comman...I'm sorry, but I'm a bit new to the Command Framework. I'm having a hard time thinking of a situation where command parameters are useful. Would it be possible for you to give an example where the parameter value is determined at runtime? Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-72851623230645958052009-01-09T14:31:00.000+05:302009-01-09T14:31:00.000+05:30@Wayne, Yes, I'll be very much interested :-)@A...@Wayne,<BR/> Yes, I'll be very much interested :-)<BR/><BR/>@Anonymous #1:<BR/> I don't think you can change the name/label of a command.<BR/><BR/>@Anonymous #2:<BR/> In your handler's execute method,<BR/><BR/>HandlerUtil.getVariable(event, ISources.ACTIVE_CURRENT_SELECTION_NAME);<BR/><BR/>should give you the current selection. But you don't need a parameterized command for this. A normal command itself would do.Prakash G.R.https://www.blogger.com/profile/13046268367318873066noreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-30745543994037481512009-01-09T02:28:00.000+05:302009-01-09T02:28:00.000+05:30Nice series of tips on commands. It got me to thi...Nice series of tips on commands. It got me to think about reworking my old <BR/>actions. <BR/><BR/>Having one problem though... <BR/><BR/>The example shows passing static strings as parameters but if the goal is to run a handler on a user selected resource, how does one pass the selection/ resource back to the command/handler from the menuContribution/command?<BR/>(IActionDelegate had selectionChanged for this)<BR/><BR/>John C.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-49828285773989638302009-01-09T02:13:00.000+05:302009-01-09T02:13:00.000+05:30Your example showed passing strings as parameters....Your example showed passing strings as parameters. But if my goal is to select a file in the Navigator for example, show a command label in the popup menu on the file and then have my handler take some action on the selected file - How does one pass the file name as a parameter back to the command and handler?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1557780184357927241.post-27475821864846941832009-01-08T21:38:00.000+05:302009-01-08T21:38:00.000+05:30Are you interested in turning these posts into an ...Are you interested in turning these posts into an article for <A HREF="http://www.eclipse.org/articles" REL="nofollow">Eclipse Corner</A>?<BR/><BR/>Please see <A HREF="https://bugs.eclipse.org/bugs/show_bug.cgi?id=223445" REL="nofollow">Bug 223445</A>Waynehttps://www.blogger.com/profile/02277665617356449769noreply@blogger.com