// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. #pragma once #include "IDataTableEditor.h" #include "Toolkits/AssetEditorToolkit.h" /** Viewer/editor for a DataTable */ class FDataTableEditor : public IDataTableEditor { public: virtual void RegisterTabSpawners(const TSharedRef& TabManager) override; virtual void UnregisterTabSpawners(const TSharedRef& TabManager) override; /** * Edits the specified table * * @param Mode Asset editing mode for this editor (standalone or world-centric) * @param InitToolkitHost When Mode is WorldCentric, this is the level editor instance to spawn this editor within * @param Table The table to edit */ void InitDataTableEditor( const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, UDataTable* Table ); /** Destructor */ virtual ~FDataTableEditor(); /* Create the uniform grid panel */ TSharedPtr CreateGridPanel(); /** IToolkit interface */ virtual FName GetToolkitFName() const override; virtual FText GetBaseToolkitName() const override; virtual FString GetWorldCentricTabPrefix() const override; virtual FLinearColor GetWorldCentricTabColorScale() const override; /* Called when DataTable was reloaded */ virtual void OnDataTableReloaded() override; private: void ReloadVisibleData(); void OnSearchTextChanged(const FText& SearchText); TSharedRef CreateContentBox(); /** Spawns the tab with the data table inside */ TSharedRef SpawnTab_DataTable( const FSpawnTabArgs& Args ); private: /** Cached table data */ TArray > CachedDataTable; /** Visibility of data table rows */ TArray RowsVisibility; /** Search box */ TSharedPtr SearchBox; /** Scroll containing data table */ TSharedPtr ScrollBoxWidget; /**Border surrounding the GridPanel */ TSharedPtr GridPanelOwner; /* The DataTable that is active in the editor */ UDataTable* DataTable; /** The tab id for the data table tab */ static const FName DataTableTabId; };