Bug 87884 - tabpages not displayed in Java dialog
Summary: tabpages not displayed in Java dialog
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version: 4.2.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-30 23:47 UTC by Bram Kuijper
Modified: 2014-12-31 00:04 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
source file in which a dialog with tab pages is created (4.36 KB, text/plain)
2014-12-30 23:47 UTC, Bram Kuijper
Details
screenshot of the resulting dialog (249.15 KB, image/png)
2014-12-30 23:49 UTC, Bram Kuijper
Details

Description Bram Kuijper 2014-12-30 23:47:47 UTC
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);
Comment 1 Bram Kuijper 2014-12-30 23:49:12 UTC
Created attachment 111544 [details]
screenshot of the resulting dialog
Comment 2 Julien Nabet 2014-12-31 00:04:57 UTC
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.