30 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
40 ScPanelFactory::ScPanelFactory()
44 ScPanelFactory::~ScPanelFactory()
48 Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
49 const OUString& rsResourceURL,
50 const ::css::uno::Sequence<css::beans::PropertyValue>& rArguments)
52 Reference<ui::XUIElement> xElement;
56 const ::comphelper::NamedValueCollection
aArguments (rArguments);
57 Reference<frame::XFrame>
xFrame (aArguments.getOrDefault(
"Frame", Reference<frame::XFrame>()));
58 Reference<awt::XWindow> xParentWindow (aArguments.getOrDefault(
"ParentWindow", Reference<awt::XWindow>()));
59 const sal_uInt64 nBindingsValue (aArguments.getOrDefault(
"SfxBindings", sal_uInt64(0)));
64 pParent = pTunnel->getWidget();
68 "PanelFactory::createUIElement called without ParentWindow",
72 "PanelFactory::createUIElement called without Frame",
74 if (pBindings ==
nullptr)
76 "PanelFactory::createUIElement called without SfxBindings",
79 sal_Int32 nMinimumSize = -1;
80 std::unique_ptr<PanelLayout> xPanel;
81 if (rsResourceURL.endsWith(
"/AlignmentPropertyPanel"))
82 xPanel = AlignmentPropertyPanel::Create( pParent,
xFrame, pBindings );
83 else if (rsResourceURL.endsWith(
"/CellAppearancePropertyPanel"))
84 xPanel = CellAppearancePropertyPanel::Create( pParent,
xFrame, pBindings );
85 else if (rsResourceURL.endsWith(
"/NumberFormatPropertyPanel"))
86 xPanel = NumberFormatPropertyPanel::Create( pParent,
xFrame, pBindings );
87 else if (rsResourceURL.endsWith(
"/NavigatorPanel"))
89 xPanel = std::make_unique<ScNavigatorDlg>(pBindings, pParent,
nullptr);
92 else if (rsResourceURL.endsWith(
"/FunctionsPanel"))
94 xPanel = std::make_unique<ScFunctionWin>(pParent);
103 ui::LayoutSize(nMinimumSize,-1,-1));
105 catch (
const uno::RuntimeException &)
109 catch (
const uno::Exception&)
112 throw lang::WrappedTargetRuntimeException(
113 "ScPanelFactory::createUIElement exception",
120 OUString ScPanelFactory::getImplementationName()
122 return "org.apache.openoffice.comp.sc.sidebar.ScPanelFactory";
125 sal_Bool ScPanelFactory::supportsService(OUString
const & ServiceName)
130 css::uno::Sequence<OUString> ScPanelFactory::getSupportedServiceNames()
132 return {
"com.sun.star.ui.UIElementFactory" };
137 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ScPanelFactory_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Reference< XFrame > xFrame
Sequence< PropertyValue > aArguments
Any SAL_CALL getCaughtException()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)