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, nospamforMBA gmx.de is
a spam sink.
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|