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()), and perhaps the controller for its model?

OK. Some more information: I want to print my XComponent on different
printer trays.

Here my class definition and the initialization of the two variables
xFrame and xComponentContext:
-----%<-----
public class JudasPrintTraysProtocolHandler extends ComponentBase
        implements XServiceInfo, XDispatchProvider, XInitialization {
/**
 * Points to the component context in which this handler object creates
 */
private XComponentContext xContext;

/**
 * Points to the frame context in which this handler runs
 */
private XFrame xFrame;

/**
 * Initialize a new instance of this class with default values.
 *
 * @param context
 *            Current XComponentContext.
 */
public JudasPrintTraysProtocolHandler(XComponentContext context) {
        xContext = context;
}

/**
 * XInitialization implementation
 *
 * @throws Exception
 */
public void initialize(Object[] object) throws
                com.sun.star.uno.Exception {

        if (object.length > 0) {
                xFrame = (XFrame) UnoRuntime
                        .queryInterface(XFrame.class, object[0]);
        }
}
-----%<----

Is there an other way to get the XComponent?

Greetings, Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to