List Info

Thread: How to tell a component the current XComponent?




How to tell a component the current XComponent?
user name
2006-03-27 12:46:04
Hi together,

I created my first component and have now a big problem:
-----%<-----
private XComponent openDocument = null;
[...]
// Querying for the interface XPrintable on the loaded
document
XPrintable xPrintable = (XPrintable)
        UnoRuntime.queryInterface(XPrintable.class,
openDocument);
-----%<-----

I want to print the current document, but I don't know how
to tell the
component the XComponent the user used when clicking on the
item of the
menu.

Can anybody tell me how to do this?

Or generally: how to give variables to components?

Greetings, Tobias

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

How to tell a component the current XComponent?
user name
2006-03-28 06:35:46
Tobias Krais wrote:

> Hi together,
> 
> I created my first component and have now a big
problem:
> -----%<-----
> private XComponent openDocument = null;
> [...]
> // Querying for the interface XPrintable on the loaded
document
> XPrintable xPrintable = (XPrintable)
>         UnoRuntime.queryInterface(XPrintable.class,
openDocument);
> -----%<-----
> 
> I want to print the current document, but I don't know
how to tell the
> component the XComponent the user used when clicking on
the item of the
> menu.
> 
> Can anybody tell me how to do this?
>
> Or generally: how to give variables to components?

By using their API.
Sorry, this isn't a joke, it's just the truth. A more
useful answer
depends on the component you want to use.

So what kind of component are you talking about? As an
example, if your
component is a job or a document event listener it gets a
frame object
on initialization or execution time (and the frame is able
to tell the
component the document it belongs to). The same is true for
Dispatch
objects since OOo2.0.x (x=2 IIRC).

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project
Lead
Please reply to the list only, nospamforMBAgmx.de is
a spam sink.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )