Implementation of XUIElementFactory Java UNO API component provide only "Frame" property but not "ParentWindow" (instead OpenOffice that works correctly). Sample code: public XUIElement createUIElement(String url, PropertyValue[] properties) throws NoSuchElementException, IllegalArgumentException { try { if (!url.startsWith("private:resource/toolpanel/com.example.xtoolpanel")) { throw new NoSuchElementException(url); } // retrieve the parent window and frame XWindow xParentWindow = null; XFrame frame = null; for (int i = 0; i < properties.length; i++) { PropertyValue propertyValue = properties[i]; if (propertyValue.Name.equals("ParentWindow")) { xParentWindow = UnoRuntime.queryInterface(XWindow.class, propertyValue.Value); break; } else if (propertyValue.Name.equals("Frame")) { frame = UnoRuntime.queryInterface(XFrame.class, propertyValue.Value); break; } } if (xParentWindow == null) { throw new IllegalArgumentException("No parent window or frame provided in the creation arguments. Cannot create tool panel."); } /// create the panel XUIElement xUIElement = new AddInPanel(m_xContext, frame, xParentWindow); return xUIElement; } catch (Exception ex) { ex.printStackTrace(); } return null; }
Stephan, Michael - Advice here?
is the problem that there is no "ParentWindow" property in "properties" or is there one and it is 0? there's a whole bunch of places calling createUIElement, and i wonder which of these would be the culprit... framework/source/layoutmanager/layoutmanager.cxx: xUIElement = m_xUIEleme ntFactoryManager->createUIElement( aName, aPropSeq ); framework/source/layoutmanager/toolbarlayoutmanager.cxx: xUIElement = xUIElementFactory->createUIElement( aAddonToolBarName, aPropSeq ); framework/source/layoutmanager/toolbarlayoutmanager.cxx: xUIElement = xUIElementFactory->createUIElement( aName, aPropSeq ); framework/source/uifactory/uielementfactorymanager.cxx: return xUIEle mentFactory->createUIElement( ResourceURL, Args ); sfx2/source/dialog/taskpane.cxx: xFactory->createUIElement( m_sResourceURL, aCreationArgs.getPropertyValues() ), sfx2/source/sidebar/SidebarController.cxx: xUIElementFactory->createUIElement( sfx2/source/toolbox/tbxitem.cxx: xUIElement = xUIElementFactory->createUIElement( rSubToolBarResName, aPropSeq ); ... so these do not even attempt to add a "ParentWindow": ToolbarLayoutManager::implts_createAddonsToolBars ToolbarLayoutManager::implts_createElement LayoutManager::implts_createElement SfxToolBoxControl::createAndPositionSubToolBar
I sort of suspect that this is something based on one of the sdk examples. e.g. sdk/examples/python/toolpanel and so its probably the sfx2/source/dialog/taskpane.cxx thing (maybe) But I'm not sure how that toolpanel example is supposed to work, i.e. if I build it and install it in LibreOffice 4.1 or Apache OpenOffice 4.1 then I don't see any UI thing to view that example. I think we need something we can reproduce the reported problem with and info as to what version of OpenOffice it does work in
Dear Bug Submitter, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/FDO/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team
Dear Bug Submitter, Please read this message in its entirety before proceeding. Your bug report is being closed as INVALID due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of FDO
Migrating Whiteboard tags to Keywords: (Need_Advice -> needAdvice) [NinjaEdit]
'needsConfirmationAdvice' is only used for unconfirmed bugs. Removing it from this bug. [NinjaEdit]