Re: What's the status of using Glade .ui files in extensions?

2019-10-28 Thread Rob Barry
I recently wrote an extension which allows you to use the XDG dialog system 
(with the associated GUI
design tools in LibreOffice) in panels (and theoretically other areas of the LO 
UI. It at least
addresses the issue of GUI design and internationalisation pretty well.
Take a look at the following and see if they help you:- 
https://gitlab.com/muishkin/mwnci---deep-spreadsheets- 
https://gitlab.com/muishkin/mwnci---deep-spreadsheets/blob/master/docs/OfficeInterface.md#repurposing-the-xdg-dialog-system
Of course this is all in Java but it could be repurposed using any supported LO 
extension language.
Let me know if you have any questions. 

On Mon, 2019-10-28 at 17:12 +0100, Thorsten Behrens wrote:
> LRN wrote:
> > I see. Okay then, i'll try to make do without this feature.
> The feature per se would be very useful though; not sure if there's away 
> around the compatibility
> issue.
> @Bubli: was there some feature branch somewhere still, for people 
> tolook/continue with?
> Cheers,
> -- Thorsten___LibreOffice mailing 
> listlibreoff...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
-- 
Thanks,

Rob
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Java Custom JRE Support (Extensions)

2019-09-23 Thread Rob Barry
Hi All,

I've been developing an extension for LibreOffice in Java and have defaulted to 
targeting the v1.8
JDK. 

One issue I've noticed with this is that LibreOffice on Windows requires the 
x64 JRE in order to
execute the extension. Given this is not the standard/suggested JRE download 
for windows it adds a
bit of complication when a user attempts to install the extension.

One way I thought this could be fixed is to use the jlink (
https://docs.oracle.com/en/java/javase/11/tools/jlink.html + 
https://blog.idrsolutions.com/2017/05/java-9-jlink-explained-in-5-minutes/) 
functionality which the
JDK v9 ships with. Broadly speaking this allows the developer to create a 
custom JRE for the
application which contains a sub-set of the modules contained in the standard 
JRE (so it's more
performant + uses less memory). I've also read suggestions that Java 
development will be moving
further in this direction with standard JREs not shipped by Oracle at all. 

"Developers who deploy desktop applications to individual consumers (eg, games, 
personal banking, or
other B2C applications) will need to transition to other deployment 
technologies such as the jlink
and/or third party packaging and deployment solutions before the end of 2020." 
- 
https://www.oracle.com/technetwork/java/javase/javaclientroadmapupdate2018mar-4414431.pdf

This leads to my question: does LibreOffice have any support for the use of 
jlink custom-built JREs
to build extensions?  Alternatively, are there any plans to support this in 
future?

-- 
Thanks,

Rob

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: Java Custom JRE Support (Extensions)

2019-09-16 Thread Rob Barry
On Mon, 2019-09-16 at 14:22 +0200, Stephan Bergmann wrote:
> On 16/09/2019 13:42, Rob Barry wrote:
> > I've been developing an extension for LibreOffice in Java and have 
> > defaulted to targeting the
> > v1.8
> > JDK.
> > 
> > One issue I've noticed with this is that LibreOffice on Windows requires 
> > the x64 JRE in order to
> > execute the extension. Given this is not the standard/suggested JRE 
> > download for windows it adds
> > a
> > bit of complication when a user attempts to install the extension.
> 
> Not sure what "the standard/suggested JRE download for windows" would 
> be.  But note that LO runs the JVM in-process in its own soffice.bin 
> process, so for a 32-bit LO installation the user needs to obtain a 
> 32-bit JRE, while for a 64-bit LO installation they need to obtain a 
> 64-bit JRE.
> 

Essentially, the preferred download option on Windows seems to be the x86 JRE 
rather than the x64
one, even when the user is running an x64 version of Windows. This may conflict 
with the default
download for libreoffice. Essentially, this may confuse non-technical users. 
But this issue is just a
side-note really.

See the following for an example of the confusion in the wild: 
https://ask.libreoffice.org/en/question/141067/why-does-libre-office-suddenly-not-recognize-java/

> > One way I thought this could be fixed is to use the jlink (
> > https://docs.oracle.com/en/java/javase/11/tools/jlink.html
> >  +
> > https://blog.idrsolutions.com/2017/05/java-9-jlink-explained-in-5-minutes/
> > ) functionality which the
> > JDK v9 ships with. Broadly speaking this allows the developer to create a 
> > custom JRE for the
> > application which contains a sub-set of the modules contained in the 
> > standard JRE (so it's more
> > performant + uses less memory). I've also read suggestions that Java 
> > development will be moving
> > further in this direction with standard JREs not shipped by Oracle at all.
> > 
> > "Developers who deploy desktop applications to individual consumers (eg, 
> > games, personal banking,
> > or
> > other B2C applications) will need to transition to other deployment 
> > technologies such as the
> > jlink
> > and/or third party packaging and deployment solutions before the end of 
> > 2020." -
> > https://www.oracle.com/technetwork/java/javase/javaclientroadmapupdate2018mar-4414431.pdf
> > 
> > 
> > This leads to my question: does LibreOffice have any support for the use of 
> > jlink custom-built
> > JREs
> > to build extensions?  Alternatively, are there any plans to support this in 
> > future?
> 
> There are no such plans by anyone I'm aware of at least.  As above, LO 
> uses a single in-process JVM for all of its Java needs (from extensions 
> and from whatever core components that use Java).
> 

If extensions and everything else use the built-in JVM, why is there a JRE 
selection dialog in the
settings and why are users prompted to install a JRE when installing Java 
extensions? See 
https://libreofficehelp.com/how-to-fix-libreoffice-requires-a-java-runtime-environment-error/

> 

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Java Custom JRE Support (Extensions)

2019-09-16 Thread Rob Barry
Hi All,

I've been developing an extension for LibreOffice in Java and have defaulted to 
targeting the v1.8
JDK. 

One issue I've noticed with this is that LibreOffice on Windows requires the 
x64 JRE in order to
execute the extension. Given this is not the standard/suggested JRE download 
for windows it adds a
bit of complication when a user attempts to install the extension.

One way I thought this could be fixed is to use the jlink (
https://docs.oracle.com/en/java/javase/11/tools/jlink.html + 
https://blog.idrsolutions.com/2017/05/java-9-jlink-explained-in-5-minutes/) 
functionality which the
JDK v9 ships with. Broadly speaking this allows the developer to create a 
custom JRE for the
application which contains a sub-set of the modules contained in the standard 
JRE (so it's more
performant + uses less memory). I've also read suggestions that Java 
development will be moving
further in this direction with standard JREs not shipped by Oracle at all. 

"Developers who deploy desktop applications to individual consumers (eg, games, 
personal banking, or
other B2C applications) will need to transition to other deployment 
technologies such as the jlink
and/or third party packaging and deployment solutions before the end of 2020." 
- 
https://www.oracle.com/technetwork/java/javase/javaclientroadmapupdate2018mar-4414431.pdf

This leads to my question: does LibreOffice have any support for the use of 
jlink custom-built JREs
to build extensions?  Alternatively, are there any plans to support this in 
future?

-- 
Thanks,

Rob

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Designing GUIs for Extensions

2019-07-13 Thread Rob Barry
Hi, 

I'm wondering if someone can give me a hand. I'm developing an
extension which makes use of the sidebar functionality. I want to use
a GUI tool to develop the UI and since I didn't find anything
suggesting that the glade ui tools can be used with extensions, I've
been following the path of using '.xdg' dialogs which can be generated
inside LibreOffice (calc/base). I've been able to successfully use
these to generate standalone dialogs but I'd like to populate a sidebar
panel using the '.xdg' method. Anyone know if it's possible? 

My approach: I end up with an instance of XUnoControlDialog but haven't
been able to find a way to take the GUI elements and place them in a
different window. I thought that XControl.createPeer(toolkit,
windowPeer) (see below code) would be sufficient to link the primary
control from the dialog to the location that I want it to be output. Is
there something I'm missing or am I being hopelessly optimistic that
this will work?

I have struggled through the many UNO interfaces and haven't been able
to find any overlap that would allow me to take the populated view from
the (hidden) dialog and stick it in the sidebar panel. 

Perhaps this isn't the best approach and I'm willing to hear any other
suggestions you guys have!

Thanks,

Rob



My attempt to take the controls from the XUnoControlDialog and attach
them to a different window in the Sidebar:

XUnoControlDialog dialog = MwnciDialog.getDialog(dialogXdgRelativeUrl,
componentContext, uiHandler);

XToolkit toolkit = this.m_parentWindowPeer.getToolkit();

WindowDescriptor windowDescriptor = new WindowDescriptor();
windowDescriptor.Type = WindowClass.CONTAINER;
windowDescriptor.WindowServiceName = "";
windowDescriptor.Parent = m_parentWindowPeer;
windowDescriptor.ParentIndex = -1;
windowDescriptor.Bounds = new Rectangle(0, 0, 200, 200);
windowDescriptor.WindowAttributes =
WindowAttribute.SIZEABLE | WindowAttribute.MOVEABLE
| WindowAttribute.NODECORATION;

this.m_windowPeer = toolkit.createWindow(windowDescriptor);
this.m_window = UnoRuntime.queryInterface(XWindow.class,
this.m_windowPeer);

dialog.createPeer(toolkit, this.m_windowPeer);

m_parentWindow.setVisible(true);
m_parentWindow.setEnable(true);

this.m_window.setVisible(true);
this.m_window.setEnable(true);

this.m_window.setPosSize(0, 0, 200, 200, (short)(PosSize.Y |
PosSize.WIDTH)) ;
dialog.setPosSize(0, 0, 200, 200, (short)(PosSize.Y | PosSize.WIDTH)) ;



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice