diff options
author | Noel Power <npower@openoffice.org> | 2003-02-19 15:09:25 +0000 |
---|---|---|
committer | Noel Power <npower@openoffice.org> | 2003-02-19 15:09:25 +0000 |
commit | 7676ca6ed62a5cc03b7c42bf3f8d612e141925eb (patch) | |
tree | 6b8fadcb575d9eff68a3d2c3ff7b81e6b6a5ffc2 /scripting/workben/bindings | |
parent | 3624dc44831783cb433a289b6e6fa2c4030a9077 (diff) |
Added changes to insert location information to script uri, also new code to dynamically determine the languages available for framework.
Diffstat (limited to 'scripting/workben/bindings')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba index 1d507ab97f13..0082aa7d4fce 100644 --- a/scripting/workben/bindings/ScriptBinding.xba +++ b/scripting/workben/bindings/ScriptBinding.xba @@ -201,11 +201,33 @@ Sub ExecuteKeyBinding() bindingDialog.execute() end Sub + Sub initialiseNavigationComboArrays() locations = Array ( "User", "Share", "Document" ) - languages = Array( "Java", "BeanShell" ) + ReDim languages(0) as String + languages(0) = "Java" + + ' Setup languages array for all supported languages + oServiceManager = GetProcessServiceManager() + svrArray = oServiceManager.getAvailableServiceNames + + langCount = 1 + for index = 0 to ubound(svrArray) + iPos = inStr(svrArray(index), "ScriptRuntimeFor") + iJava = inStr(svrArray(index), "ScriptRuntimeForJava") + + if (iJava = 0) and (iPos > 0) then + lang = Mid(svrArray(index), iPos + Len("ScriptRuntimeFor") + + 'Add to language vector + ReDim Preserve languages(langCount) as String + languages(langCount) = lang + langCount = langCount +1 + endif + next index End Sub + Sub ExecuteEventBinding createAllEventTypes() createAllEventBindings() @@ -315,7 +337,16 @@ function GetDocumentType( bindingType as string ) as string end function function getScriptURI( selectedScript as String ) as String - 'Dim scripts() as new com.sun.star.beans.PropertyValue + combo = bindingDialog.getControl( "LocationCombo" ) + location = combo.text + if ( location = "User" ) then + location = "user" + elseif ( location = "Share" ) then + location = "share" + else + location = "document" + end if + Dim scriptInfo as Object scripts() = scriptDisplayList(0) for n = LBOUND( scripts() ) to UBOUND( scripts() ) @@ -326,7 +357,7 @@ function getScriptURI( selectedScript as String ) as String end if next n - getScriptURI() = "script://" + scriptInfo.getLogicalName + "?language=" + scriptInfo.getLanguage() + "+function=" + scriptInfo.getFunctionName() + getScriptURI() = "script://" + scriptInfo.getLogicalName + "?language=" + scriptInfo.getLanguage() + "+function=" + scriptInfo.getFunctionName() + "+location=" + location end function @@ -1667,4 +1698,4 @@ sub DeleteEvent( event as String ) disp.dispatch(url,args()) end sub -</script:module> +</script:module>
\ No newline at end of file |