Re: [api-dev] Regarding XJobExecutor.
bharathy b wrote: Hi Andreas thank you, i tried the solution you specified. In the Addons.xcu i made the following changes. node oor:name=m1 oor:op=replace prop oor:name=URL oor:type=xs:string valueservice:name.vojta.openoffice.wavelet.Wavelet?button1/value /prop node oor:name=m2 oor:op=replace prop oor:name=URL oor:type=xs:string valueservice:name.vojta.openoffice.wavelet.Wavelet?button2/value /prop and in Wavelet.java i made the following change public void trigger(String buttonName) { try{ if (buttonName == button1) { URL yahoo = new URL(http://www.yahoo.com/;); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; File outFile = new File(c:\\button1.htm); FileWriter out = new FileWriter(outFile); while ((inputLine = in.readLine()) != null) { out.write(inputLine); } in.close(); out.close(); } else if (buttonName == button2) { URL google = new URL(http://www.google.com/;); BufferedReader in = new BufferedReader( new InputStreamReader( google.openStream())); String inputLine; File outFile = new File(c:\\button2.htm); FileWriter out = new FileWriter(outFile); while ((inputLine = in.readLine()) != null) { out.write(inputLine); } in.close(); out.close(); } } catch(java.io.IOException e){} } The buttons appear but dont get triggered. Whats wrong in this method? If this method will be called ... nothing was wrong. If it's not called you may be implement your service wrong. Then the optional interface XJobExecutor couldnt be queried on your implementation and isnt used. Was your methor trigger() called ... even with right or wrong arguments ? If not - please check your service implementation and registration. Regarding the ProtocolHandlerAddon method.. I want to know where should i define sayHello( ). public String sayHello() { return Hello world } This is XTestFunction1.idl in C:\ProtoToolbar\Code\com\sun\star\demo #include com/sun/star/uno/XInterface.idl module com { module sun { module star { module demo { interface XTestFunction1 : com::sun::star::uno::XInterface { String sayHello(); }; };};};}; This is TestFunction1.idl in C:\ProtoToolbar\Code\com\sun\star\demo #include XTestFunction1.idl module com { module sun { module star { module demo { service TestFunction1 { interface com::sun::star::demo::XTestFunction1; };};};};}; C:\ProtoToolbar\Code\com\sun\star\demo also contains TestFunction1.urd, XTestFunction1.urd and demo.rdb Should i define sayHello( ) in TestFunction1.java or XTestFunction1.java? so that sayHello( ) gets called onclick of the button Should the value of the URL in the Addons.xcu be prop oor:name=URL oor:type=xs:string value com.sun.star.demo:sayHello/value /prop I am not able to understand this one point.. Implementing a ProtocolHandler isnt so different against implementation of a JobExecutor. All interfaces are still defined and can be used. But your implementation has to support and implement it. A Protocolhandler has to implement the existing interfaces: com.sun.star.frame.XDispatchProvider com.sun.star.frame.XDispatch [optional] com.sun.star.lang.XInitialization With regards, Bharathy B Regards Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Regarding XJobExecutor.
Hi Andreas thank you, i agree i must have gone wrong somewhere. i will redo it and check the service implementation and registration. I tried the ProtocolHandlerAddon_java in SDK after reading the Dev Guide. but i didnt succeed.The buttons are grayed out. i have been trying to add a toolbar using ProtocolHandlerAddon since the last few days. I will be very thankfull if any can provide me an ProtocolHandlerAddon_java example which can add a toolbar. With Regards, Bharathy B Andreas Schlüns [EMAIL PROTECTED] wrote: bharathy b wrote: Hi Andreas thank you, i tried the solution you specified. In the Addons.xcu i made the following changes. service:name.vojta.openoffice.wavelet.Wavelet?button1 service:name.vojta.openoffice.wavelet.Wavelet?button2 and in Wavelet.java i made the following change public void trigger(String buttonName) { try{ if (buttonName == button1) { URL yahoo = new URL(http://www.yahoo.com/;); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; File outFile = new File(c:\\button1.htm); FileWriter out = new FileWriter(outFile); while ((inputLine = in.readLine()) != null) { out.write(inputLine); } in.close(); out.close(); } else if (buttonName == button2) { URL google = new URL(http://www.google.com/;); BufferedReader in = new BufferedReader( new InputStreamReader( google.openStream())); String inputLine; File outFile = new File(c:\\button2.htm); FileWriter out = new FileWriter(outFile); while ((inputLine = in.readLine()) != null) { out.write(inputLine); } in.close(); out.close(); } } catch(java.io.IOException e){} } The buttons appear but dont get triggered. Whats wrong in this method? If this method will be called ... nothing was wrong. If it's not called you may be implement your service wrong. Then the optional interface XJobExecutor couldnt be queried on your implementation and isnt used. Was your methor trigger() called ... even with right or wrong arguments ? If not - please check your service implementation and registration. Regarding the ProtocolHandlerAddon method.. I want to know where should i define sayHello( ). public String sayHello() { return Hello world } This is XTestFunction1.idl in C:\ProtoToolbar\Code\com\sun\star\demo #include module com { module sun { module star { module demo { interface XTestFunction1 : com::sun::star::uno::XInterface { String sayHello(); }; };};};}; This is TestFunction1.idl in C:\ProtoToolbar\Code\com\sun\star\demo #include XTestFunction1.idl module com { module sun { module star { module demo { service TestFunction1 { interface com::sun::star::demo::XTestFunction1; };};};};}; C:\ProtoToolbar\Code\com\sun\star\demo also contains TestFunction1.urd, XTestFunction1.urd and demo.rdb Should i define sayHello( ) in TestFunction1.java or XTestFunction1.java? so that sayHello( ) gets called onclick of the button Should the value of the URL in the Addons.xcu be com.sun.star.demo:sayHello I am not able to understand this one point.. Implementing a ProtocolHandler isnt so different against implementation of a JobExecutor. All interfaces are still defined and can be used. But your implementation has to support and implement it. A Protocolhandler has to implement the existing interfaces: com.sun.star.frame.XDispatchProvider com.sun.star.frame.XDispatch [optional] com.sun.star.lang.XInitialization With regards, Bharathy B Regards Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - See the all-new, redesigned Yahoo.com. Check it out.
[api-dev] Macro editing
Hi all, I'm using OO Writer 2.0.3 on Linux system. I tried to edit Javascript, Python and BeanShell macro, but I failed because on Edit command, OO crash. All works instead on Windows system. Could anyone help me? Thanks, Angela - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Set width of column in texttable in basic
Hello! I just want to set the width of a cell in a writers texttable (OO 2.0.2, Windows). I found this message http://api.openoffice.org/servlets/ReadMsg?list=devmsgNo=3446 and adapted it to basic: oDesktop = createUnoService( com.sun.star.frame.Desktop ) Dim mArgs(0) As New com.sun.star.beans.PropertyValue oDoc = oDesktop.loadComponentFromURL(file:///e:/test.ott, _blank, 0, mArgs()) oTable = oDoc.getTextTables.getByName(Table2) oT = oTable.TableColumnSeparators oT(1).Position = 123 oTable.TableColumnSeparators = oT But OO says that oT(1) has no member Position. Is it just too hot today for me to get the clue or what could be the problem? Has somebody a working example in basic to set the width of a texttable-column in writer? Regards Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Set width of column in texttable in basic
Download my free macro document and find section 8.7 titled Column Widths Martin Thoma wrote: Hello! I just want to set the width of a cell in a writers texttable (OO 2.0.2, Windows). I found this message http://api.openoffice.org/servlets/ReadMsg?list=devmsgNo=3446 and adapted it to basic: oDesktop = createUnoService( com.sun.star.frame.Desktop ) Dim mArgs(0) As New com.sun.star.beans.PropertyValue oDoc = oDesktop.loadComponentFromURL(file:///e:/test.ott, _blank, 0, mArgs()) oTable = oDoc.getTextTables.getByName(Table2) oT = oTable.TableColumnSeparators oT(1).Position = 123 oTable.TableColumnSeparators = oT But OO says that oT(1) has no member Position. Is it just too hot today for me to get the clue or what could be the problem? Has somebody a working example in basic to set the width of a texttable-column in writer? Regards Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt My Book: http://www.hentzenwerke.com/catalog/oome.htm Info: http://www.pitonyak.org/oo.php See Also: http://documentation.openoffice.org/HOW_TO/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]