Created attachment 111543 [details] source file in which a dialog with tab pages is created When creating a UNO dialog in Java (using Libreoffice SDK 4.2.7.2 coded using the Netbeans Openoffice plugin 4.0.6) adding tab pages to a dialog does not work. I am adding tab pages by creating a UnoControlTabPageContainerModel, querying its interface and subsequently adding individual tab pages to it by using the function createTabPage(). However, in Libreoffice it merely shows a dialog window without tab pages. However, the same code reportedly works in Openoffice (see user Hanya in https://forum.openoffice.org/en/forum/viewtopic.php?f=44&t=74391&p=336538#p336538) and produces a functional dialog with tab pages. The important part of the code (full code is attached below): Object oDialogProvider =m_xMCF.createInstanceWithContext("com.sun.star.awt.DialogProvider", m_xContext); XDialogProvider xDialogProvider = UnoRuntime.queryInterface(XDialogProvider.class, oDialogProvider); XDialog xDialog = xDialogProvider.createDialog("vnd.sun.star.script:Standard.Dialog1?location=application"); if (xDialog == null) return; XControlModel xDialogModel = UnoRuntime.queryInterface(XControl.class, xDialog).getModel(); XMultiServiceFactory xMsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel); XNameContainer xNameContainer = UnoRuntime.queryInterface(XNameContainer.class, xDialogModel); Object tabPagesModel = xMsf.createInstance("com.sun.star.awt.tab.UnoControlTabPageContainerModel"); xNameContainer.insertByName("tab", tabPagesModel); XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, tabPagesModel); xPropSet.setPropertyValue("Width", 100); xPropSet.setPropertyValue("Height", 100); XTabPageContainerModel xTabPagesModel = UnoRuntime.queryInterface(XTabPageContainerModel.class, tabPagesModel); XTabPageModel xTabPageModel1 = xTabPagesModel.createTabPage((short) 1); xTabPageModel1.setTitle("Page 1"); xTabPagesModel.insertByIndex(0, xTabPageModel1); XTabPageModel xTabPageModel2 = xTabPagesModel.createTabPage((short) 2); xTabPageModel2.setTitle("Page 2"); xTabPagesModel.insertByIndex(1, xTabPageModel2);
Created attachment 111544 [details] screenshot of the resulting dialog
Stephan: one for you?
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.