Files
UnrealEngineUWP/Engine/Source/Editor/ConfigEditor/Private/PropertyVisualization/ConfigPropertyColumn.cpp
Terence Burns 14cb541a13 Config Editor added to UE4.
We now have the capacity to set a uproperty value anywhere in the config file hierarchy

Satisfies UEPLAT-429

The user can now use the 'ConfigHierarchyEditable' meta flag in their uproperties to present a butoon that allows the property to be edited in the config hierarchy, where applicable.
Target platform is configurable.

[CL 2521330 by Terence Burns in Main branch]
2015-04-22 13:40:06 -04:00

60 lines
1.9 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "ConfigEditorPCH.h"
#include "ConfigPropertyColumn.h"
#include "ConfigPropertyCellPresenter.h"
#include "Editor/PropertyEditor/Public/PropertyHandle.h"
#include "Editor/PropertyEditor/Public/PropertyPath.h"
#include "Editor/PropertyEditor/Public/IPropertyTable.h"
#define LOCTEXT_NAMESPACE "ConfigEditor"
bool FConfigPropertyCustomColumn::Supports(const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities) const
{
bool IsSupported = false;
if (Column->GetDataSource()->IsValid())
{
TSharedPtr< FPropertyPath > PropertyPath = Column->GetDataSource()->AsPropertyPath();
if (PropertyPath.IsValid() && PropertyPath->GetNumProperties() > 0)
{
const FPropertyInfo& PropertyInfo = PropertyPath->GetRootProperty();
UProperty* Property = PropertyInfo.Property.Get();
IsSupported = Property->GetFName() == TEXT("ExternalProperty");
}
}
return IsSupported;
}
TSharedPtr< SWidget > FConfigPropertyCustomColumn::CreateColumnLabel(const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities, const FName& Style) const
{
if (Column->GetDataSource()->IsValid())
{
TSharedPtr< FPropertyPath > PropertyPath = Column->GetDataSource()->AsPropertyPath();
if (PropertyPath.IsValid() && PropertyPath->GetNumProperties() > 0)
{
return SNew(STextBlock)
.Text(EditProperty->GetDisplayNameText());
}
}
return SNullWidget::NullWidget;
}
TSharedPtr< IPropertyTableCellPresenter > FConfigPropertyCustomColumn::CreateCellPresenter(const TSharedRef< IPropertyTableCell >& Cell, const TSharedRef< IPropertyTableUtilities >& Utilities, const FName& Style) const
{
TSharedPtr< IPropertyHandle > PropertyHandle = Cell->GetPropertyHandle();
if (PropertyHandle.IsValid())
{
return MakeShareable(new FConfigPropertyCellPresenter(PropertyHandle));
}
return nullptr;
}
#undef LOCTEXT_NAMESPACE