Hello Антон,

On Sun, Apr 13, 2014 at 06:02:29PM +0400, Антон Борисов wrote:
> It's possible to handle sidebar panel XDialog with XDialogEventHandler ? If
> i call xDialog.execute() it will be showed not inside sidebar, just like
> plain dialog.

You don't have to use XDialog - XDialogEventHandler, because you don't
need a dialog there; what you need is a simple container of controls,
you get this with 

http://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/ContainerWindowProvider.html
http://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/XContainerWindowProvider.html#createContainerWindow
Your handle will implement
http://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/XContainerWindowEventHandler.html

> If i'm not calling execute, public XUIElement createUIElement() returns new
> UIElement(
>                     sResourceURL,
>                     aPanel);

createUIElement() is called with a sequence of
css.beans.PropertyValue's. Use that information to create your
UIElement, as it contains information that it will need:

* "Frame" - css.frame.XFrame
* "ParentWindow" - css.awt.XWindow
* "Sidebar" - css.ui.XSidebar
* "ApplicationName" - string
* "ContextName" - string
* "Theme" - css.beans.XPropertySet

Your UIElement has to take care of creating the container window used to
display inside the Sidebar, use
XContainerWindowProvider.createContainerWindow() for that; store the
XWindow in a member variable and use it as the UIElement's "real
interface" in getRealInterface().

Also note that your UIElement owns that window, so it has to care of
disposing it; so make sure

* your UIElement class inherits from
  com.sun.star.lib.uno.helper.ComponentBase, not just
  com.sun.star.lib.uno.helper.WeakBase; or implement css.lang.XComponent
  yourself

* when your UIElement is disposed, dispose the window. If you inherit
  from ComponentBase, override postDisposing()

> xdl:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN"
> "dialog.dtd">
> <dlg:window xmlns:dlg="http://openoffice.org/2000/dialog"; xmlns:script="
> http://openoffice.org/2000/script"; dlg:id="LinkNodesDialog" dlg:left="104"
> dlg:top="55" dlg:width="156" dlg:height="129" dlg:closeable="true"

Make sure that the position is 0,0 because the window will be positioned
relative to its parent window, the one you get in "ParentWindow".
You can also control the size relative to the parent's size, you will
need to add a window listener to the "ParentWindow" and react on
windowResized().


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgpACSY3fnMAA.pgp
Description: PGP signature

Reply via email to