1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "eformspropertyhandler.hxx"
21 #include "formstrings.hxx"
22 #include "formmetadata.hxx"
23 #include "pcrservices.hxx"
24 #include "propctrlr.hrc"
25 #include "formbrowsertools.hxx"
26 #include "eformshelper.hxx"
27 #include "handlerhelper.hxx"
29 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
30 #include <com/sun/star/inspection/PropertyControlType.hpp>
31 #include <com/sun/star/inspection/XObjectInspectorUI.hpp>
32 #include <tools/debug.hxx>
37 extern "C" void SAL_CALL
createRegistryInfo_EFormsPropertyHandler()
39 ::pcr::EFormsPropertyHandler::registerImplementation();
47 using namespace ::com::sun::star
;
48 using namespace ::com::sun::star::uno
;
49 using namespace ::com::sun::star::lang
;
50 using namespace ::com::sun::star::beans
;
51 using namespace ::com::sun::star::xforms
;
52 using namespace ::com::sun::star::script
;
53 using namespace ::com::sun::star::ui::dialogs
;
54 using namespace ::com::sun::star::form::binding
;
55 using namespace ::com::sun::star::inspection
;
58 //= EFormsPropertyHandler
61 EFormsPropertyHandler::EFormsPropertyHandler( const Reference
< XComponentContext
>& _rxContext
)
62 :EFormsPropertyHandler_Base( _rxContext
)
63 ,m_bSimulatingModelChange( false )
68 EFormsPropertyHandler::~EFormsPropertyHandler( )
73 OUString SAL_CALL
EFormsPropertyHandler::getImplementationName_static( ) throw (RuntimeException
)
75 return OUString( "com.sun.star.comp.extensions.EFormsPropertyHandler" );
79 Sequence
< OUString
> SAL_CALL
EFormsPropertyHandler::getSupportedServiceNames_static( ) throw (RuntimeException
)
81 Sequence
< OUString
> aSupported( 1 );
82 aSupported
[0] = "com.sun.star.form.inspection.XMLFormsPropertyHandler";
87 OUString
EFormsPropertyHandler::getModelNamePropertyValue() const
89 OUString sModelName
= m_pHelper
->getCurrentFormModelName();
90 if ( sModelName
.isEmpty() )
91 sModelName
= m_sBindingLessModelName
;
96 Any SAL_CALL
EFormsPropertyHandler::getPropertyValue( const OUString
& _rPropertyName
) throw (UnknownPropertyException
, RuntimeException
, std::exception
)
98 ::osl::MutexGuard
aGuard( m_aMutex
);
99 PropertyId
nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName
) );
101 OSL_ENSURE( m_pHelper
.get(), "EFormsPropertyHandler::getPropertyValue: we don't have any SupportedProperties!" );
102 // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
109 case PROPERTY_ID_LIST_BINDING
:
110 aReturn
<<= m_pHelper
->getCurrentListSourceBinding();
113 case PROPERTY_ID_XML_DATA_MODEL
:
114 aReturn
<<= getModelNamePropertyValue();
117 case PROPERTY_ID_BINDING_NAME
:
118 aReturn
<<= m_pHelper
->getCurrentBindingName();
121 case PROPERTY_ID_BIND_EXPRESSION
:
122 case PROPERTY_ID_XSD_CONSTRAINT
:
123 case PROPERTY_ID_XSD_CALCULATION
:
124 case PROPERTY_ID_XSD_REQUIRED
:
125 case PROPERTY_ID_XSD_RELEVANT
:
126 case PROPERTY_ID_XSD_READONLY
:
128 Reference
< XPropertySet
> xBindingProps( m_pHelper
->getCurrentBinding() );
129 if ( xBindingProps
.is() )
131 aReturn
= xBindingProps
->getPropertyValue( _rPropertyName
);
132 DBG_ASSERT( aReturn
.getValueType().equals( ::cppu::UnoType
<OUString
>::get() ),
133 "EFormsPropertyHandler::getPropertyValue: invalid BindingExpression value type!" );
136 aReturn
<<= OUString();
141 OSL_FAIL( "EFormsPropertyHandler::getPropertyValue: cannot handle this property!" );
145 catch( const Exception
& )
147 #if OSL_DEBUG_LEVEL > 0
148 OString
sMessage( "EFormsPropertyHandler::getPropertyValue: caught an exception!" );
149 sMessage
+= "\n(have been asked for the \"";
150 sMessage
+= OString( _rPropertyName
.getStr(), _rPropertyName
.getLength(), RTL_TEXTENCODING_ASCII_US
);
151 sMessage
+= "\" property.)";
152 OSL_FAIL( sMessage
.getStr() );
159 void SAL_CALL
EFormsPropertyHandler::setPropertyValue( const OUString
& _rPropertyName
, const Any
& _rValue
) throw (UnknownPropertyException
, RuntimeException
, std::exception
)
161 ::osl::MutexGuard
aGuard( m_aMutex
);
162 PropertyId
nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName
) );
164 OSL_ENSURE( m_pHelper
.get(), "EFormsPropertyHandler::setPropertyValue: we don't have any SupportedProperties!" );
165 // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
169 Any aOldValue
= getPropertyValue( _rPropertyName
);
173 case PROPERTY_ID_LIST_BINDING
:
175 Reference
< XListEntrySource
> xSource
;
176 OSL_VERIFY( _rValue
>>= xSource
);
177 m_pHelper
->setListSourceBinding( xSource
);
181 case PROPERTY_ID_XML_DATA_MODEL
:
183 OSL_VERIFY( _rValue
>>= m_sBindingLessModelName
);
185 // if the model changed, reset the binding to NULL
186 if ( m_pHelper
->getCurrentFormModelName() != m_sBindingLessModelName
)
188 OUString sOldBindingName
= m_pHelper
->getCurrentBindingName();
189 m_pHelper
->setBinding( NULL
);
190 firePropertyChange( PROPERTY_BINDING_NAME
, PROPERTY_ID_BINDING_NAME
,
191 makeAny( sOldBindingName
), makeAny( OUString() ) );
196 case PROPERTY_ID_BINDING_NAME
:
198 OUString sNewBindingName
;
199 OSL_VERIFY( _rValue
>>= sNewBindingName
);
201 bool bPreviouslyEmptyModel
= !m_pHelper
->getCurrentFormModel().is();
203 Reference
< XPropertySet
> xNewBinding
;
204 if ( !sNewBindingName
.isEmpty() )
205 // obtain the binding with this name, for the current model
206 xNewBinding
= m_pHelper
->getOrCreateBindingForModel( getModelNamePropertyValue(), sNewBindingName
);
208 m_pHelper
->setBinding( xNewBinding
);
210 if ( bPreviouslyEmptyModel
)
211 { // simulate a property change for the model property
212 // This is because we "simulate" the Model property by remembering the
213 // value ourself. Other instances might, however, not know this value,
214 // but prefer to retrieve it somewhere else - e.g. from the EFormsHelper
216 // The really correct solution would be if *all* property handlers
217 // obtain a "current property value" for *all* properties from a central
218 // instance. Then, handler A could ask it for the value of property
219 // X, and this request would be re-routed to handler B, which ultimately
220 // knows the current value.
221 // However, there's no such mechanism in place currently.
222 m_bSimulatingModelChange
= true;
223 firePropertyChange( PROPERTY_XML_DATA_MODEL
, PROPERTY_ID_XML_DATA_MODEL
,
224 makeAny( OUString() ), makeAny( getModelNamePropertyValue() ) );
225 m_bSimulatingModelChange
= false;
230 case PROPERTY_ID_BIND_EXPRESSION
:
232 Reference
< XPropertySet
> xBinding( m_pHelper
->getCurrentBinding() );
233 OSL_ENSURE( xBinding
.is(), "You should not reach this without an active binding!" );
235 xBinding
->setPropertyValue( PROPERTY_BIND_EXPRESSION
, _rValue
);
239 case PROPERTY_ID_XSD_REQUIRED
:
240 case PROPERTY_ID_XSD_RELEVANT
:
241 case PROPERTY_ID_XSD_READONLY
:
242 case PROPERTY_ID_XSD_CONSTRAINT
:
243 case PROPERTY_ID_XSD_CALCULATION
:
245 Reference
< XPropertySet
> xBindingProps( m_pHelper
->getCurrentBinding() );
246 DBG_ASSERT( xBindingProps
.is(), "EFormsPropertyHandler::setPropertyValue: how can I set a property if there's no binding?" );
247 if ( xBindingProps
.is() )
249 DBG_ASSERT( _rValue
.getValueType().equals( ::cppu::UnoType
<OUString
>::get() ),
250 "EFormsPropertyHandler::setPropertyValue: invalid value type!" );
251 xBindingProps
->setPropertyValue( _rPropertyName
, _rValue
);
257 OSL_FAIL( "EFormsPropertyHandler::setPropertyValue: cannot handle this property!" );
261 impl_setContextDocumentModified_nothrow();
263 Any
aNewValue( getPropertyValue( _rPropertyName
) );
264 firePropertyChange( _rPropertyName
, nPropId
, aOldValue
, aNewValue
);
266 catch( const Exception
& )
268 OSL_FAIL( "EFormsPropertyHandler::setPropertyValue: caught an exception!" );
273 void EFormsPropertyHandler::onNewComponent()
275 EFormsPropertyHandler_Base::onNewComponent();
277 Reference
< frame::XModel
> xDocument( impl_getContextDocument_nothrow() );
278 DBG_ASSERT( xDocument
.is(), "EFormsPropertyHandler::onNewComponent: no document!" );
279 if ( EFormsHelper::isEForm( xDocument
) )
280 m_pHelper
.reset( new EFormsHelper( m_aMutex
, m_xComponent
, xDocument
) );
286 Sequence
< Property
> SAL_CALL
EFormsPropertyHandler::doDescribeSupportedProperties() const
288 ::std::vector
< Property
> aProperties
;
290 if ( m_pHelper
.get() )
292 if ( m_pHelper
->canBindToAnyDataType() )
294 aProperties
.reserve( 7 );
295 addStringPropertyDescription( aProperties
, PROPERTY_XML_DATA_MODEL
);
296 addStringPropertyDescription( aProperties
, PROPERTY_BINDING_NAME
);
297 addStringPropertyDescription( aProperties
, PROPERTY_BIND_EXPRESSION
);
298 addStringPropertyDescription( aProperties
, PROPERTY_XSD_REQUIRED
);
299 addStringPropertyDescription( aProperties
, PROPERTY_XSD_RELEVANT
);
300 addStringPropertyDescription( aProperties
, PROPERTY_XSD_READONLY
);
301 addStringPropertyDescription( aProperties
, PROPERTY_XSD_CONSTRAINT
);
302 addStringPropertyDescription( aProperties
, PROPERTY_XSD_CALCULATION
);
304 if ( m_pHelper
->isListEntrySink() )
306 implAddPropertyDescription( aProperties
, PROPERTY_LIST_BINDING
,
307 cppu::UnoType
<XListEntrySource
>::get() );
311 if ( aProperties
.empty() )
312 return Sequence
< Property
>();
313 return Sequence
< Property
>( &(*aProperties
.begin()), aProperties
.size() );
317 Any SAL_CALL
EFormsPropertyHandler::convertToPropertyValue( const OUString
& _rPropertyName
, const Any
& _rControlValue
) throw (UnknownPropertyException
, RuntimeException
, std::exception
)
319 ::osl::MutexGuard
aGuard( m_aMutex
);
322 OSL_ENSURE( m_pHelper
.get(), "EFormsPropertyHandler::convertToPropertyValue: we have no SupportedProperties!" );
323 if ( !m_pHelper
.get() )
326 PropertyId
nPropId( m_pInfoService
->getPropertyId( _rPropertyName
) );
328 OUString sControlValue
;
331 case PROPERTY_ID_LIST_BINDING
:
333 OSL_VERIFY( _rControlValue
>>= sControlValue
);
334 Reference
< XListEntrySource
> xListSource( m_pHelper
->getModelElementFromUIName( EFormsHelper::Binding
, sControlValue
), UNO_QUERY
);
335 OSL_ENSURE( xListSource
.is() || !m_pHelper
->getModelElementFromUIName( EFormsHelper::Binding
, sControlValue
).is(),
336 "EFormsPropertyHandler::convertToPropertyValue: there's a binding which is no ListEntrySource!" );
337 aReturn
<<= xListSource
;
342 aReturn
= EFormsPropertyHandler_Base::convertToPropertyValue( _rPropertyName
, _rControlValue
);
350 Any SAL_CALL
EFormsPropertyHandler::convertToControlValue( const OUString
& _rPropertyName
, const Any
& _rPropertyValue
, const Type
& _rControlValueType
) throw (UnknownPropertyException
, RuntimeException
, std::exception
)
352 ::osl::MutexGuard
aGuard( m_aMutex
);
355 OSL_ENSURE( m_pHelper
.get(), "EFormsPropertyHandler::convertToControlValue: we have no SupportedProperties!" );
356 if ( !m_pHelper
.get() )
359 PropertyId
nPropId( m_pInfoService
->getPropertyId( _rPropertyName
) );
361 OSL_ENSURE( _rControlValueType
.getTypeClass() == TypeClass_STRING
,
362 "EFormsPropertyHandler::convertToControlValue: all our controls should use strings for value exchange!" );
366 case PROPERTY_ID_LIST_BINDING
:
368 Reference
< XPropertySet
> xListSourceBinding( _rPropertyValue
, UNO_QUERY
);
369 if ( xListSourceBinding
.is() )
370 aReturn
<<= EFormsHelper::getModelElementUIName( EFormsHelper::Binding
, xListSourceBinding
);
375 aReturn
= EFormsPropertyHandler_Base::convertToControlValue( _rPropertyName
, _rPropertyValue
, _rControlValueType
);
383 Sequence
< OUString
> SAL_CALL
EFormsPropertyHandler::getActuatingProperties( ) throw (RuntimeException
, std::exception
)
385 ::osl::MutexGuard
aGuard( m_aMutex
);
386 if ( !m_pHelper
.get() )
387 return Sequence
< OUString
>();
389 ::std::vector
< OUString
> aInterestedInActuations( 2 );
390 aInterestedInActuations
[ 0 ] = PROPERTY_XML_DATA_MODEL
;
391 aInterestedInActuations
[ 1 ] = PROPERTY_BINDING_NAME
;
392 return Sequence
< OUString
>( &(*aInterestedInActuations
.begin()), aInterestedInActuations
.size() );
396 Sequence
< OUString
> SAL_CALL
EFormsPropertyHandler::getSupersededProperties( ) throw (RuntimeException
, std::exception
)
398 ::osl::MutexGuard
aGuard( m_aMutex
);
399 if ( !m_pHelper
.get() )
400 return Sequence
< OUString
>();
402 Sequence
< OUString
> aReturn( 1 );
403 aReturn
[ 0 ] = PROPERTY_INPUT_REQUIRED
;
408 LineDescriptor SAL_CALL
EFormsPropertyHandler::describePropertyLine( const OUString
& _rPropertyName
,
409 const Reference
< XPropertyControlFactory
>& _rxControlFactory
)
410 throw (UnknownPropertyException
, NullPointerException
, RuntimeException
, std::exception
)
412 ::osl::MutexGuard
aGuard( m_aMutex
);
413 if ( !_rxControlFactory
.is() )
414 throw NullPointerException();
415 if ( !m_pHelper
.get() )
416 throw RuntimeException();
418 LineDescriptor aDescriptor
;
419 sal_Int16 nControlType
= PropertyControlType::TextField
;
420 ::std::vector
< OUString
> aListEntries
;
421 PropertyId
nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName
) );
424 case PROPERTY_ID_LIST_BINDING
:
425 nControlType
= PropertyControlType::ListBox
;
426 const_cast< EFormsHelper
* >( m_pHelper
.get() )->getAllElementUINames( EFormsHelper::Binding
, aListEntries
, true );
429 case PROPERTY_ID_XML_DATA_MODEL
:
430 nControlType
= PropertyControlType::ListBox
;
431 m_pHelper
->getFormModelNames( aListEntries
);
434 case PROPERTY_ID_BINDING_NAME
:
436 nControlType
= PropertyControlType::ComboBox
;
437 OUString
sCurrentModel( getModelNamePropertyValue() );
438 if ( !sCurrentModel
.isEmpty() )
439 m_pHelper
->getBindingNames( sCurrentModel
, aListEntries
);
443 case PROPERTY_ID_BIND_EXPRESSION
: aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_BIND_EXPRESSION
; break;
444 case PROPERTY_ID_XSD_REQUIRED
: aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_XSD_REQUIRED
; break;
445 case PROPERTY_ID_XSD_RELEVANT
: aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_XSD_RELEVANT
; break;
446 case PROPERTY_ID_XSD_READONLY
: aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_XSD_READONLY
; break;
447 case PROPERTY_ID_XSD_CONSTRAINT
: aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_XSD_CONSTRAINT
; break;
448 case PROPERTY_ID_XSD_CALCULATION
: aDescriptor
.PrimaryButtonId
= UID_PROP_DLG_XSD_CALCULATION
; break;
451 OSL_FAIL( "EFormsPropertyHandler::describePropertyLine: cannot handle this property!" );
455 switch ( nControlType
)
457 case PropertyControlType::ListBox
:
458 aDescriptor
.Control
= PropertyHandlerHelper::createListBoxControl( _rxControlFactory
, aListEntries
, false, true );
460 case PropertyControlType::ComboBox
:
461 aDescriptor
.Control
= PropertyHandlerHelper::createComboBoxControl( _rxControlFactory
, aListEntries
, false, true );
464 aDescriptor
.Control
= _rxControlFactory
->createPropertyControl( nControlType
, sal_False
);
468 aDescriptor
.DisplayName
= m_pInfoService
->getPropertyTranslation( nPropId
);
469 aDescriptor
.Category
= "Data";
470 aDescriptor
.HelpURL
= HelpIdUrl::getHelpURL( m_pInfoService
->getPropertyHelpId( nPropId
) );
475 InteractiveSelectionResult SAL_CALL
EFormsPropertyHandler::onInteractivePropertySelection( const OUString
& _rPropertyName
, sal_Bool
/*_bPrimary*/, Any
& _rData
, const Reference
< XObjectInspectorUI
>& _rxInspectorUI
) throw (UnknownPropertyException
, NullPointerException
, RuntimeException
, std::exception
)
477 if ( !_rxInspectorUI
.is() )
478 throw NullPointerException();
480 ::osl::MutexGuard
aGuard( m_aMutex
);
481 OSL_ENSURE( m_pHelper
.get(), "EFormsPropertyHandler::onInteractivePropertySelection: we do not have any SupportedProperties!" );
482 if ( !m_pHelper
.get() )
483 return InteractiveSelectionResult_Cancelled
;
485 PropertyId
nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName
) );
487 OSL_ENSURE( ( PROPERTY_ID_BINDING_NAME
== nPropId
)
488 || ( PROPERTY_ID_BIND_EXPRESSION
== nPropId
)
489 || ( PROPERTY_ID_XSD_REQUIRED
== nPropId
)
490 || ( PROPERTY_ID_XSD_RELEVANT
== nPropId
)
491 || ( PROPERTY_ID_XSD_READONLY
== nPropId
)
492 || ( PROPERTY_ID_XSD_CONSTRAINT
== nPropId
)
493 || ( PROPERTY_ID_XSD_CALCULATION
== nPropId
), "EFormsPropertyHandler::onInteractivePropertySelection: unexpected!" );
497 Reference
< XExecutableDialog
> xDialog
;
498 xDialog
.set( m_xContext
->getServiceManager()->createInstanceWithContext( "com.sun.star.xforms.ui.dialogs.AddCondition", m_xContext
), UNO_QUERY
);
499 Reference
< XPropertySet
> xDialogProps( xDialog
, UNO_QUERY_THROW
);
501 // the model for the dialog to work with
502 Reference
< xforms::XModel
> xModel( m_pHelper
->getCurrentFormModel() );
503 // the binding for the dialog to work with
504 Reference
< XPropertySet
> xBinding( m_pHelper
->getCurrentBinding() );
505 // the aspect of the binding which the dialog should modify
506 OUString
sFacetName( _rPropertyName
);
508 OSL_ENSURE( xModel
.is() && xBinding
.is() && !sFacetName
.isEmpty(),
509 "EFormsPropertyHandler::onInteractivePropertySelection: something is missing for the dialog initialization!" );
510 if ( !( xModel
.is() && xBinding
.is() && !sFacetName
.isEmpty() ) )
511 return InteractiveSelectionResult_Cancelled
;
513 xDialogProps
->setPropertyValue("FormModel", makeAny( xModel
) );
514 xDialogProps
->setPropertyValue("Binding", makeAny( xBinding
) );
515 xDialogProps
->setPropertyValue("FacetName", makeAny( sFacetName
) );
517 if ( !xDialog
->execute() )
519 return InteractiveSelectionResult_Cancelled
;
521 _rData
= xDialogProps
->getPropertyValue("ConditionValue");
522 return InteractiveSelectionResult_ObtainedValue
;
524 catch( const Exception
& )
526 OSL_FAIL( "EFormsPropertyHandler::onInteractivePropertySelection: caught an exception!" );
529 // something went wrong here ...(but has been asserted already)
530 return InteractiveSelectionResult_Cancelled
;
534 void SAL_CALL
EFormsPropertyHandler::addPropertyChangeListener( const Reference
< XPropertyChangeListener
>& _rxListener
) throw (NullPointerException
, RuntimeException
, std::exception
)
536 ::osl::MutexGuard
aGuard( m_aMutex
);
537 EFormsPropertyHandler_Base::addPropertyChangeListener( _rxListener
);
538 if ( m_pHelper
.get() )
539 m_pHelper
->registerBindingListener( _rxListener
);
543 void SAL_CALL
EFormsPropertyHandler::removePropertyChangeListener( const Reference
< XPropertyChangeListener
>& _rxListener
) throw (RuntimeException
, std::exception
)
545 ::osl::MutexGuard
aGuard( m_aMutex
);
546 if ( m_pHelper
.get() )
547 m_pHelper
->revokeBindingListener( _rxListener
);
548 EFormsPropertyHandler_Base::removePropertyChangeListener( _rxListener
);
552 void SAL_CALL
EFormsPropertyHandler::actuatingPropertyChanged( const OUString
& _rActuatingPropertyName
, const Any
& _rNewValue
, const Any
& /*_rOldValue*/, const Reference
< XObjectInspectorUI
>& _rxInspectorUI
, sal_Bool
) throw (NullPointerException
, RuntimeException
, std::exception
)
554 if ( !_rxInspectorUI
.is() )
555 throw NullPointerException();
557 ::osl::MutexGuard
aGuard( m_aMutex
);
558 PropertyId
nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName
) );
559 OSL_PRECOND( m_pHelper
.get(), "EFormsPropertyHandler::actuatingPropertyChanged: inconsistentcy!" );
560 // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties
562 DBG_ASSERT( _rxInspectorUI
.is(), "EFormsPropertyHandler::actuatingPropertyChanged: invalid callback!" );
563 if ( !_rxInspectorUI
.is() )
566 switch ( nActuatingPropId
)
568 case PROPERTY_ID_XML_DATA_MODEL
:
570 if ( m_bSimulatingModelChange
)
572 OUString sDataModelName
;
573 OSL_VERIFY( _rNewValue
>>= sDataModelName
);
574 bool bBoundToSomeModel
= !sDataModelName
.isEmpty();
575 _rxInspectorUI
->rebuildPropertyUI( PROPERTY_BINDING_NAME
);
576 _rxInspectorUI
->enablePropertyUI( PROPERTY_BINDING_NAME
, bBoundToSomeModel
);
580 case PROPERTY_ID_BINDING_NAME
:
582 bool bHaveABinding
= !m_pHelper
->getCurrentBindingName().isEmpty();
583 _rxInspectorUI
->enablePropertyUI( PROPERTY_BIND_EXPRESSION
, bHaveABinding
);
584 _rxInspectorUI
->enablePropertyUI( PROPERTY_XSD_REQUIRED
, bHaveABinding
);
585 _rxInspectorUI
->enablePropertyUI( PROPERTY_XSD_RELEVANT
, bHaveABinding
);
586 _rxInspectorUI
->enablePropertyUI( PROPERTY_XSD_READONLY
, bHaveABinding
);
587 _rxInspectorUI
->enablePropertyUI( PROPERTY_XSD_CONSTRAINT
, bHaveABinding
);
588 _rxInspectorUI
->enablePropertyUI( PROPERTY_XSD_CALCULATION
, bHaveABinding
);
589 _rxInspectorUI
->enablePropertyUI( PROPERTY_XSD_DATA_TYPE
, bHaveABinding
);
594 OSL_FAIL( "EFormsPropertyHandler::actuatingPropertyChanged: cannot handle this property!" );
603 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */