Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-23 Thread Tobias Krais
Hi Matthias, Am I right when I assume that myComp is the same as in the first line and that it does not make a difference in using it? No. If so, why is the xStorable derived from myComp = null and the xStorable derived from this.xComponent the correct value? myComp points to a

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-23 Thread Tobias Krais
Hi again, one addition: Now the things I wanted to do are working. Thank you for your explanations. I had a method taking an XComponent. After your explanations I understood, that I can give over a XModel instead. The method did not complain. That is one thing I did not understand. Greetings

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-20 Thread Stephan Bergmann
Tobias Krais wrote: Hi Stephan, I did not follow this thread too closely. You should not worry about what toString() on a UNO proxy gives you, as those are implementation details, anyway. What is important is that those proxy objects offer the expected functionality. What exactly is your

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-20 Thread Tobias Krais
Hi Stephan, I extend the code below for better understanding, what I mean. -%- System.out.println(this.xComponent); XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); System.out.println(xModel); XController xController =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-20 Thread Stephan Bergmann
Tobias Krais wrote: Hi Stephan, I extend the code below for better understanding, what I mean. -%- System.out.println(this.xComponent); XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); System.out.println(xModel); XController xController =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-20 Thread Tobias Krais
Hi Matthias, A frame is an object implementing XComponent (amongst other interfaces) and the code above retrieves this interface. As XFrame is derived from XComponent it is not surprising that both interfaces references are the same proxy object. This also means that the queryInterface call

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-20 Thread Tobias Krais
Hi Stephan -%- System.out.println(this.xComponent); XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); System.out.println(xModel); XController xController = xModel.getCurrentController(); System.out.println(xController); XComponent myComp =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-20 Thread Mathias Bauer
Tobias Krais wrote: Hi Stephan, I extend the code below for better understanding, what I mean. -%- System.out.println(this.xComponent); XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); System.out.println(xModel); XController xController =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-19 Thread Stephan Bergmann
Tobias Krais wrote: Hi Stephan, even though I'm not the Stephan you addressed ;-) I'd try to query the XPrintable at you xModel instead of myComp. Yes, that solved my first qestion: -%- XController xController = xFrame.getController(); com.sun.star.frame.XModel xModel =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-19 Thread Tobias Krais
Hi Stephan, I did not follow this thread too closely. You should not worry about what toString() on a UNO proxy gives you, as those are implementation details, anyway. What is important is that those proxy objects offer the expected functionality. What exactly is your problem with the Java

[api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi together, this is my last day working for my current company and I'm hanging on following thing: I have to write one more UNO package. In this component, I need to get the current XComponent. I asked the question how to get the current XComponent out of an XFrame last march and got following

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Frank Schönheit - Sun Microsystems Germ any
Hi Tobias, this is my last day working for my current company and I'm hanging on following thing: I have to write one more UNO package. In this component, I need to get the current XComponent. I asked the question how to get the current XComponent out of an XFrame last march and got

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi Frank, -%- XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFrame); -%- Depending on what you mean with current component, i.e. what you want to do with it - shouldn't you ask the frame for its controller (XFrame.getController()),

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Frank Schönheit - Sun Microsystems Germ any
Hi Tobias, OK. Some more information: I want to print my XComponent on different printer trays. I don't know the printing API, but I would suurprised if it at the frame, instead of the controller/model. Finally, you want to print the document, not the window in which it by chance is just

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi Frank, OK. Some more information: I want to print my XComponent on different printer trays. I don't know the printing API, but I would suurprised if it at the frame, instead of the controller/model. Finally, you want to print the document, not the window in which it by chance is just

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi Frank So, I assume the component for you is the XComponent of the controller. Yes. But how to get it? I know how to get the XController and the XModel. But how to get the XComponent? analogous to how you get the XComponent interface of the frame, or how you get any interface for any

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Frank Schönheit - Sun Microsystems Germ any
Hi Tobias, OK. But that does not work... Here my xFrame: -%- CO [EMAIL PROTECTED] [oid=867a494;gcc3[0];c226f3b38e9111dbbb1ff0b779ca904b, type=com.sun.star.frame.XFrame] -%- Here my xController -%- CO [EMAIL PROTECTED]

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi Frank, And then I query for the xControllerComponent as you described above: -%- CO [EMAIL PROTECTED] [oid=88fee74;gcc3[0];c226f3b38e9111dbbb1ff0b779ca904b, type=com.sun.star.frame.XController] -%- How did you produce those lines? xControllerComponent.toString()? Just

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi together, after testing, I wrote this little test method: -%- public void test() { XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); com.sun.star.frame.XController xController =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Stephan Wunderlich
Hi Tobias, after testing, I wrote this little test method: -%- public void test() { XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); com.sun.star.frame.XController xController =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Stephan Bergmann
Tobias Krais wrote: Hi together, after testing, I wrote this little test method: -%- public void test() { XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); com.sun.star.frame.XController xController =

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi Stephan, -%- public void test() { XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, this.xComponent); com.sun.star.frame.XController xController = xModel.getCurrentController(); XComponent myComp = (XComponent)

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Stephan Wunderlich
Hi Tobias, That is interesting. Thank you. But if I continue the code the following way, I run into troubles (xPrintable will be null): -%- // Querying for the interface XPrintable on the loaded document XPrintable xPrintable = (XPrintable)

Re: [api-dev] Getting the XComponent out of a XFrame in a UNO Component

2006-12-18 Thread Tobias Krais
Hi Stephan, even though I'm not the Stephan you addressed ;-) I'd try to query the XPrintable at you xModel instead of myComp. Yes, that solved my first qestion: -%- XController xController = xFrame.getController(); com.sun.star.frame.XModel xModel = xController.getModel();