Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::DocumentPropertyEditor::ReflectionAdapter Class Reference

#include <ReflectionAdapter.h>

Inherits AZ::DocumentPropertyEditor::RoutingAdapter.

Classes

struct  PropertyChangeInfo
 Holds the parameters that define a specific property change event. More...
 

Public Types

using PropertyChangeEvent = Event< const PropertyChangeInfo & >
 
- Public Types inherited from AZ::DocumentPropertyEditor::DocumentAdapter
using ResetEvent = Event<>
 
using ChangedEvent = Event< const Dom::Patch & >
 
using MessageEvent = Event< const AdapterMessage &, Dom::Value & >
 

Public Member Functions

 ReflectionAdapter ()
 Creates an uninitialized (empty) ReflectionAdapter.
 
 ReflectionAdapter (void *instance, AZ::TypeId typeId)
 
void SetValue (void *instance, AZ::TypeId typeId)
 
void ConnectPropertyChangeHandler (PropertyChangeEvent::Handler &handler)
 
void NotifyPropertyChanged (const PropertyChangeInfo &changeInfo)
 
virtual void CreateLabel (AdapterBuilder *adapterBuilder, AZStd::string_view labelText, AZStd::string_view serializedPath)
 
virtual void UpdateDomContents (const PropertyChangeInfo &propertyChangeInfo)
 
void * GetInstance ()
 
const void * GetInstance () const
 
AZ::TypeId GetTypeId () const
 
ExpanderSettingsCreateExpanderSettings (DocumentAdapter *referenceAdapter, const AZStd::string &settingsRegistryKey=AZStd::string(), const AZStd::string &propertyEditorName=AZStd::string()) override
 
- Public Member Functions inherited from AZ::DocumentPropertyEditor::DocumentAdapter
 AZ_RTTI (DocumentAdapter, "{8CEFE485-45C2-4ECC-B9D1-BBE75C7B02AB}")
 
Dom::Value GetContents () const
 
void ConnectResetHandler (ResetEvent::Handler &handler)
 
void ConnectChangedHandler (ChangedEvent::Handler &handler)
 
void ConnectMessageHandler (MessageEvent::Handler &handler)
 
virtual void SetRouter (RoutingAdapter *router, const Dom::Path &route)
 
Dom::Value SendAdapterMessage (const AdapterMessage &message)
 
bool IsEmpty ()
 
virtual ExpanderSettingsCreateExpanderSettings (DocumentAdapter *referenceAdapter, const AZStd::string &settingsRegistryKey=AZStd::string(), const AZStd::string &propertyEditorName=AZStd::string())
 

Static Public Member Functions

static void InvokeChangeNotify (const AZ::Dom::Value &domNode)
 
- Static Public Member Functions inherited from AZ::DocumentPropertyEditor::DocumentAdapter
static bool IsDebugModeEnabled ()
 
static void SetDebugModeEnabled (bool enableDebugMode)
 
static bool IsRow (const Dom::Value &domValue)
 convenience method to determine whether a particular Dom Value is a row
 

Protected Member Functions

Dom::Value GenerateContents () override
 
Dom::Value HandleMessage (const AdapterMessage &message) override
 
- Protected Member Functions inherited from AZ::DocumentPropertyEditor::RoutingAdapter
void ClearRoutes ()
 
void AddRoute (const Dom::Path &route, DocumentAdapterPtr adapter)
 
void RemoveRoute (const Dom::Path &route)
 Removes a route at a given path, and all of its subpaths.
 
void SetRouter (RoutingAdapter *router, const Dom::Path &route) override
 
- Protected Member Functions inherited from AZ::DocumentPropertyEditor::DocumentAdapter
virtual Dom::Value GenerateContents ()=0
 
virtual Dom::Value HandleMessage (const AdapterMessage &message)
 
void NotifyResetDocument (DocumentResetType resetType=DocumentResetType::SoftReset)
 
void NotifyContentsChanged (const Dom::Patch &patch)
 

Friends

struct ReflectionAdapterReflectionImpl
 

Additional Inherited Members

- Protected Types inherited from AZ::DocumentPropertyEditor::DocumentAdapter
enum class  DocumentResetType { SoftReset , HardReset }
 Specifies the type of reset operation triggered in NotifyResetDocument. More...
 

Detailed Description

ReflectionAdapter turns an in-memory instance of an object backed by the AZ Reflection system (via SerializeContext & EditContext) and creates a property grid that supports editing its members in a manner outlined by its reflection data.

Constructor & Destructor Documentation

◆ ReflectionAdapter()

AZ::DocumentPropertyEditor::ReflectionAdapter::ReflectionAdapter ( void *  instance,
AZ::TypeId  typeId 
)

Creates a ReflectionAdapter with a contents comrpised of the reflected data of the specified instance.

See also
SetValue

Member Function Documentation

◆ ConnectPropertyChangeHandler()

void AZ::DocumentPropertyEditor::ReflectionAdapter::ConnectPropertyChangeHandler ( PropertyChangeEvent::Handler &  handler)

Connects a listener to the event fired when a property has been changed. This can be used to notify the view of changes to the DOM, e.g. notifying an editor of document changes.

◆ CreateExpanderSettings()

ExpanderSettings * AZ::DocumentPropertyEditor::ReflectionAdapter::CreateExpanderSettings ( DocumentAdapter referenceAdapter,
const AZStd::string &  settingsRegistryKey = AZStd::string(),
const AZStd::string &  propertyEditorName = AZStd::string() 
)
overridevirtual

◆ CreateLabel()

virtual void AZ::DocumentPropertyEditor::ReflectionAdapter::CreateLabel ( AdapterBuilder adapterBuilder,
AZStd::string_view  labelText,
AZStd::string_view  serializedPath 
)
virtual

Creates a node for displaying label information. Subclass adapter can override the default behavior.

Parameters
adapterBuilderThe adapter builder currently being used by this adapter.
labelTextThe text string to be displayed in label.
serializedPathThe serialized path fetched from AZ::Reflection::DescriptorAttributes.

◆ GenerateContents()

Dom::Value AZ::DocumentPropertyEditor::ReflectionAdapter::GenerateContents ( )
overrideprotectedvirtual

Generates the contents of this adapter. This must be an Adapter DOM node. These contents will be cached - to notify clients of changes to the structure, NotifyResetDocument or NotifyContentsChanged must be used.

See also
AdapterBuilder for building out this DOM structure.

Implements AZ::DocumentPropertyEditor::DocumentAdapter.

◆ HandleMessage()

Dom::Value AZ::DocumentPropertyEditor::ReflectionAdapter::HandleMessage ( const AdapterMessage message)
overrideprotectedvirtual

Called by SendAdapterMessage before the view is notified. This may be overridden to handle BoundAdapterMessages on fields.

Reimplemented from AZ::DocumentPropertyEditor::DocumentAdapter.

◆ InvokeChangeNotify()

static void AZ::DocumentPropertyEditor::ReflectionAdapter::InvokeChangeNotify ( const AZ::Dom::Value &  domNode)
static

Invokes the ChangeNotify attribute for an Adapter, if present, and follows up with a tree refresh if needed.

◆ NotifyPropertyChanged()

void AZ::DocumentPropertyEditor::ReflectionAdapter::NotifyPropertyChanged ( const PropertyChangeInfo changeInfo)

Call this to trigger a PropertyChangeEvent to notify the view that one of this adapter's property editor instances has altered its value.

◆ SetValue()

void AZ::DocumentPropertyEditor::ReflectionAdapter::SetValue ( void *  instance,
AZ::TypeId  typeId 
)

Sets the instance to reflect. If typeId is a type registered to SerializeContext, this adapter will produce a property grid based on its contents.

◆ UpdateDomContents()

virtual void AZ::DocumentPropertyEditor::ReflectionAdapter::UpdateDomContents ( const PropertyChangeInfo propertyChangeInfo)
virtual

Updates the contents of adapter Dom contents using the property change information provided. Child adapters can override this function to make more changes to the Dom in addition to the property changes.

Parameters
propertyChangeInfoObject containing information about the property change.

The documentation for this class was generated from the following file: