JavaScript to tell if ActiveHelp is available? [message #605441] |
Fri, 21 December 2007 22:21 |
Eclipse User |
|
|
|
Originally posted by: ddirks.ittvis.com
Hi all,
I have help content that includes ActiveHelp links that call some custom
actions. Since the same content may be running in a workbench, in the
stand-alone help, or in an Infocenter. I'm looking for a way to tell
*in JavaScript* whether the ActiveHelp is available, so I can make the
links behave as I want them to in all situations.
I have tried several variations of the following JavaScript function:
//---------------------------------------------------------- -
function activeHelpIsAvailable() {
var available = 0;
if (liveAction(
"org.eclipse.help.ui",
"org.eclipse.help.ui.internal.ExecuteCommandAction",
"org.eclipse.ui.PlatformUI.isWorkbenchRunning()")
//"org.eclipse.core.runtime.Platform.isRunning()")
//"org.eclipse.ui.PlatformUI.getWorkbench()")
!= null) {
available = 1;
}
return available;
}
//---------------------------------------------------------- -
but none of the functions I've tried calling to determine whether
the workbench is running:
* org.eclipse.ui.PlatformUI.isWorkbenchRunning()
* org.eclipse.core.runtime.Platform.isRunning()
* org.eclipse.ui.PlatformUI.getWorkbench()
returns anything but null.
Am I way off the track here? Is there some obvious way to do this
that I'm missing? Or some non-obvious way?
This needs to work in Eclipse 3.3.
Thanks for any help,
Doug Dirks
|
|
|
Powered by
FUDForum. Page generated in 0.02808 seconds