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.