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/02/11 23:21:19 UTC

show sidebar by code in extension

Dear all,
 It's possible to show and hide Sidebar by java code in extension by
dispatch framework or by another way ?
 I haven't found anything by searching
-- 
Borisov Anton

Re: show sidebar by code in extension

Posted by Andre Fischer <aw...@gmail.com>.
On 15.02.2014 21:55, Антон Борисов wrote:
> thanks for reply, i wanted to display some specific deck or panel
> another question about sidebar, i have two panels for one deck, it's
> displaying only one (in case when both have dlg:withtitlebar="false" in xdl
> file) but i want two panels
> in case when one of panel dlg:withtitlebar="true" it's displaying but as
> separate dialog.
>
> i found example with one panel, maybe i've missed some important  details
> about case more than one panel?

Please have a look at
https://wiki.openoffice.org/wiki/Sidebar_for_Developers

(but not right now, the Wiki server is currently down)

This page explains the structure of the Sidebar.xcu file that defines 
which panels to display in a given context.

-Andre

>
>
> 2014-02-15 21:38 GMT+04:00 Ariel Constenla-Haile <ar...@apache.org>:
>
>> Hi Антон,
>>
>> On Wed, Feb 12, 2014 at 02:21:19AM +0400, Антон Борисов wrote:
>>> Dear all,
>>>   It's possible to show and hide Sidebar by java code in extension by
>>> dispatch framework or by another way ?
>>>   I haven't found anything by searching
>> Are you trying to simply show/hide the sidebar? That would be
>> dispatching the respective command: ".uno:Sidebar". Dispatching will
>> toggle the sidebar visibility. You can also dispatch only when needed,
>> get a single status update by adding and removing a status listener at
>> the dispatch object; in the .uno:Sidebar case,
>> css.frame.FeatureStateEvent.State is bool, where true means the sidebar is
>> visible, false it hidden.
>>
>> If you want to display some specific deck or panel, then it is
>> impossible. In theory, panels are UI elements with resource URL schema
>> "private:resource/toolpanel/", and the code is still there, but it is
>> broken, you cannot use the LayoutManager to show/hide panels.
>>
>>
>> Regards
>> --
>> Ariel Constenla-Haile
>> La Plata, Argentina
>>
>
>


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


Re: show sidebar by code in extension

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Антон,

On Sun, Feb 16, 2014 at 12:55:15AM +0400, Антон Борисов wrote:
> thanks for reply, i wanted to display some specific deck or panel
> another question about sidebar, i have two panels for one deck, it's
> displaying only one (in case when both have dlg:withtitlebar="false" in xdl
> file) but i want two panels
> in case when one of panel dlg:withtitlebar="true" it's displaying but as
> separate dialog.

If you want to use a dialog created in the Basic IDE as a control
container in the sidebar or in a tab of the Options dialogs,
dlg:withtitlebar *must* always be "false".

> i found example with one panel, maybe i've missed some important  details
> about case more than one panel?

I just took the example from
http://people.apache.org/~af/SidebarSearchDemo.zip and added the same
panel twice (copy the SearchAndReplacePanel node and rename to something
else), and it seems to work:
http://people.apache.org/~arielch/tmp/sidebar_2panels.png
Modified Sidebar.xcu: http://people.apache.org/~arielch/tmp/Sidebar.xcu

You might be missing something, so take a look at that example.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: show sidebar by code in extension

Posted by Антон Борисов <an...@gmail.com>.
thanks for reply, i wanted to display some specific deck or panel
another question about sidebar, i have two panels for one deck, it's
displaying only one (in case when both have dlg:withtitlebar="false" in xdl
file) but i want two panels
in case when one of panel dlg:withtitlebar="true" it's displaying but as
separate dialog.

i found example with one panel, maybe i've missed some important  details
about case more than one panel?


2014-02-15 21:38 GMT+04:00 Ariel Constenla-Haile <ar...@apache.org>:

> Hi Антон,
>
> On Wed, Feb 12, 2014 at 02:21:19AM +0400, Антон Борисов wrote:
> > Dear all,
> >  It's possible to show and hide Sidebar by java code in extension by
> > dispatch framework or by another way ?
> >  I haven't found anything by searching
>
> Are you trying to simply show/hide the sidebar? That would be
> dispatching the respective command: ".uno:Sidebar". Dispatching will
> toggle the sidebar visibility. You can also dispatch only when needed,
> get a single status update by adding and removing a status listener at
> the dispatch object; in the .uno:Sidebar case,
> css.frame.FeatureStateEvent.State is bool, where true means the sidebar is
> visible, false it hidden.
>
> If you want to display some specific deck or panel, then it is
> impossible. In theory, panels are UI elements with resource URL schema
> "private:resource/toolpanel/", and the code is still there, but it is
> broken, you cannot use the LayoutManager to show/hide panels.
>
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>



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

Re: show sidebar by code in extension

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Антон,

On Wed, Feb 12, 2014 at 02:21:19AM +0400, Антон Борисов wrote:
> Dear all,
>  It's possible to show and hide Sidebar by java code in extension by
> dispatch framework or by another way ?
>  I haven't found anything by searching

Are you trying to simply show/hide the sidebar? That would be
dispatching the respective command: ".uno:Sidebar". Dispatching will
toggle the sidebar visibility. You can also dispatch only when needed,
get a single status update by adding and removing a status listener at
the dispatch object; in the .uno:Sidebar case,
css.frame.FeatureStateEvent.State is bool, where true means the sidebar is
visible, false it hidden.

If you want to display some specific deck or panel, then it is
impossible. In theory, panels are UI elements with resource URL schema
"private:resource/toolpanel/", and the code is still there, but it is
broken, you cannot use the LayoutManager to show/hide panels.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina