Kaydet (Commit) 0bca4008 authored tarafından Sander Vesik's avatar Sander Vesik

INTEGRATION: CWS scriptingf5 (1.1.2); FILE ADDED

2004/03/22 16:27:26 toconnor 1.1.2.2: #i22570# - Update URL usage in examples to new non hierarchical scheme
2004/02/19 17:48:03 toconnor 1.1.2.1: #i25271# Add Highlight example in all languages. Use DialogProvider to
create XDialog and display it.
üst 33f8fae3
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.lang.XMultiComponentFactory);
importClass(Packages.com.sun.star.awt.XDialogProvider);
importClass(Packages.com.sun.star.awt.XDialog);
importClass(Packages.com.sun.star.uno.Exception);
importClass(Packages.drafts.com.sun.star.script.provider.XScriptContext);
importClass(java.lang.Thread);
importClass(java.lang.System);
function getDialogProvider()
{
// UNO awt components of the Highlight dialog
xmcf = XSCRIPTCONTEXT.getComponentContext().getServiceManager();
args = new Array;
args[0] = XSCRIPTCONTEXT.getDocument();
try {
obj = xmcf.createInstanceWithArgumentsAndContext(
"com.sun.star.awt.DialogProvider", args,
XSCRIPTCONTEXT.getComponentContext());
}
catch (e) {
System.err.println("Error getting DialogProvider object");
return null;
}
return UnoRuntime.queryInterface(XDialogProvider, obj);
}
xDialogProvider = getDialogProvider();
if (xDialogProvider != null)
{
try {
findDialog = xDialogProvider.createDialog("vnd.sun.star.script:" +
"ScriptBindingLibrary.Highlight?location=application");
findDialog.execute();
}
catch (e) {
System.err.println("Got exception on first creating dialog: " +
e.getMessage());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment