https://bugs.freedesktop.org/show_bug.cgi?id=87884

            Bug ID: 87884
           Summary: tabpages not displayed in Java dialog
           Product: LibreOffice
           Version: 4.2.7.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: sdk
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 111543
  --> https://bugs.freedesktop.org/attachment.cgi?id=111543&action=edit
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);

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to