summaryrefslogtreecommitdiff
path: root/scripting/workben/bindings
diff options
context:
space:
mode:
authorNoel Power <npower@openoffice.org>2003-02-19 15:09:25 +0000
committerNoel Power <npower@openoffice.org>2003-02-19 15:09:25 +0000
commit7676ca6ed62a5cc03b7c42bf3f8d612e141925eb (patch)
tree6b8fadcb575d9eff68a3d2c3ff7b81e6b6a5ffc2 /scripting/workben/bindings
parent3624dc44831783cb433a289b6e6fa2c4030a9077 (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.xba39
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 ( &quot;User&quot;, &quot;Share&quot;, &quot;Document&quot; )
- languages = Array( &quot;Java&quot;, &quot;BeanShell&quot; )
+ ReDim languages(0) as String
+ languages(0) = &quot;Java&quot;
+
+ &apos; Setup languages array for all supported languages
+ oServiceManager = GetProcessServiceManager()
+ svrArray = oServiceManager.getAvailableServiceNames
+
+ langCount = 1
+ for index = 0 to ubound(svrArray)
+ iPos = inStr(svrArray(index), &quot;ScriptRuntimeFor&quot;)
+ iJava = inStr(svrArray(index), &quot;ScriptRuntimeForJava&quot;)
+
+ if (iJava = 0) and (iPos &gt; 0) then
+ lang = Mid(svrArray(index), iPos + Len(&quot;ScriptRuntimeFor&quot;)
+
+ &apos;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
- &apos;Dim scripts() as new com.sun.star.beans.PropertyValue
+ combo = bindingDialog.getControl( &quot;LocationCombo&quot; )
+ location = combo.text
+ if ( location = &quot;User&quot; ) then
+ location = &quot;user&quot;
+ elseif ( location = &quot;Share&quot; ) then
+ location = &quot;share&quot;
+ else
+ location = &quot;document&quot;
+ 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() = &quot;script://&quot; + scriptInfo.getLogicalName + &quot;?language=&quot; + scriptInfo.getLanguage() + &quot;+function=&quot; + scriptInfo.getFunctionName()
+ getScriptURI() = &quot;script://&quot; + scriptInfo.getLogicalName + &quot;?language=&quot; + scriptInfo.getLanguage() + &quot;+function=&quot; + scriptInfo.getFunctionName() + &quot;+location=&quot; + 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