You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@openoffice.apache.org by Антон Борисов <an...@gmail.com> on 2014/04/13 16:02:29 UTC

Sidebar Panel DIalog and XDialogEventHandler

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.
If i'm not calling execute, public XUIElement createUIElement() returns new
UIElement(
                    sResourceURL,
                    aPanel);
and handling will not working.
it show error "An appropriate component method "methodName" could not be
found. Check spelling of method name"


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"
dlg:moveable="true" dlg:withtitlebar="false">
 <dlg:bulletinboard>
  <dlg:combobox dlg:id="aNodeComboBox" dlg:tab-index="0" dlg:left="5"
dlg:top="10" dlg:width="76" dlg:height="9" dlg:value="aNodeComboBox"
dlg:spin="true">
   <script:event script:event-name="on-performaction"
script:macro-name="vnd.sun.star.UNO:aNodeComboboxExecute"
script:language="UNO"/>
   <script:event script:event-name="on-textchange"
script:macro-name="vnd.sun.star.UNO:aNodeComboboxTextModified"
script:language="UNO"/>
   <script:event script:event-name="on-focus"
script:macro-name="vnd.sun.star.UNO:aNodeReceivedFocus"
script:language="UNO"/>
  </dlg:combobox>
  <dlg:combobox dlg:id="zNodeComboBox" dlg:tab-index="1" dlg:left="83"
dlg:top="10" dlg:width="68" dlg:height="9" dlg:value="zNodeComboBox"
dlg:spin="true">
   <script:event script:event-name="on-performaction"
script:macro-name="vnd.sun.star.UNO:zNodeComboboxExecute"
script:language="UNO"/>
   <script:event script:event-name="on-textchange"
script:macro-name="vnd.sun.star.UNO:zNodeComboboxTextModified"
script:language="UNO"/>
   <script:event script:event-name="on-itemstatechange"
script:macro-name="vnd.sun.star.UNO:zNodeComboboxItemStatusChanged"
script:language="UNO"/>
   <script:event script:event-name="on-focus"
script:macro-name="vnd.sun.star.UNO:zNodeReceivedFocus"
script:language="UNO"/>
  </dlg:combobox>
  <dlg:button dlg:id="aNodeResetButton" dlg:tab-index="2" dlg:left="5"
dlg:top="22" dlg:width="72" dlg:height="18" dlg:value="aNodeResetButton">
   <script:event script:event-name="on-performaction"
script:macro-name="vnd.sun.star.UNO:aNodeReset" script:language="UNO"/>
  </dlg:button>
  <dlg:button dlg:id="zNodeResetButton" dlg:tab-index="3" dlg:left="83"
dlg:top="24" dlg:width="66" dlg:height="16" dlg:value="zNodeResetButton">
   <script:event script:event-name="on-performaction"
script:macro-name="vnd.sun.star.UNO:zNodeReset" script:language="UNO"/>
  </dlg:button>
  <dlg:button dlg:id="aNodeSetButton" dlg:tab-index="4" dlg:visible="false"
dlg:left="6" dlg:top="47" dlg:width="71" dlg:height="14"
dlg:value="aNodeSetButton">
   <script:event script:event-name="on-performaction"
script:macro-name="vnd.sun.star.UNO:aNodeSet" script:language="UNO"/>
  </dlg:button>
  <dlg:button dlg:id="zNodeSetButton" dlg:tab-index="5" dlg:visible="false"
dlg:left="83" dlg:top="47" dlg:width="65" dlg:height="14"
dlg:value="zNodeSetButton">
   <script:event script:event-name="on-performaction"
script:macro-name="vnd.sun.star.UNO:zNodeSetButton" script:language="UNO"/>
  </dlg:button>
  <dlg:button dlg:id="linkButton" dlg:tab-index="6" dlg:left="46"
dlg:top="70" dlg:width="66" dlg:height="19" dlg:value="LINK"/>
 </dlg:bulletinboard>
</dlg:window>

Thanks,
-- 
Borisov Anton

Re: Sidebar Panel DIalog and XDialogEventHandler

Posted by Антон Борисов <an...@gmail.com>.
thanks for replies


2014-04-14 11:45 GMT+04:00 Andre Fischer <aw...@gmail.com>:

> On 13.04.2014 22:38, Ariel Constenla-Haile wrote:
>
>> 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
>>
>
> You can find more information here:
>     https://wiki.openoffice.org/wiki/Sidebar_for_Developers
>
> -Andre
>
>
>  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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: api-help@openoffice.apache.org
>
>


-- 
Борисов Антон

Re: Sidebar Panel DIalog and XDialogEventHandler

Posted by Andre Fischer <aw...@gmail.com>.
On 13.04.2014 22:38, Ariel Constenla-Haile wrote:
> 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

You can find more information here:
     https://wiki.openoffice.org/wiki/Sidebar_for_Developers

-Andre

>> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org


Re: Sidebar Panel DIalog and XDialogEventHandler

Posted by Ariel Constenla-Haile <ar...@apache.org>.
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