Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Editor.ThemeRepositorySetupView Class Referencesealed

Guided setup and explicit validated repository creation inside the existing Theme Manager. More...

Inheritance diagram for GWG.WindowFramework.Editor.ThemeRepositorySetupView:
Collaboration diagram for GWG.WindowFramework.Editor.ThemeRepositorySetupView:

Public Member Functions

 ThemeRepositorySetupView (WindowFrameThemeData source, string packageRoot, Action cancel, Func< IEnumerable< WindowFrameThemeData > > findRepositories=null)
 Builds a cancellable, local-only form using the supplied controller prefab's existing defaults.
void CancelAndDispose ()
 Cancels/cleans active work if its owner window is closing, rather than leaving an orphan operation.
ThemeRepositoryCreateRequest CaptureRequest ()
 Captures every local setup choice for the same production operation used by retained tests.
bool CreateRepository (bool showProgress=true)
 Starts the shared staged production operation behind this form's blocking progress overlay.
void RequestCancellation ()
 Pauses the scheduled copy and asks for confirmation without yet requesting cancellation.
void ResolveCancellation (bool confirmed)
 Resolves the existing inline cancellation question; No resumes unchanged, Yes starts cleanup.
bool ValidateSetup ()
 Rechecks local form input and updates the review without modifying any project/runtime state.

Properties

ThemeApplyMethods ApplyMethod [get]
 Requested scope to save on the future copied ThemeData.
bool DebugTelemetryEnabled [get]
 Requested existing telemetry option; does not change compilation/feature defines.
PanelSettings ExistingPanel [get]
 Explicit project PanelSettings selection, or null to request a new default asset.
bool IsCreating [get]
 Whether the form is executing the real copy operation; owner UI must block conflicting actions.
ThemeRepositoryCreateResult LastCreatedResult [get, private set]
 Last successfully validated production output; prevents duplicate creation from the same form.
bool MemoryEnabled [get]
 Developer-owned memory policy for the future copied controller, never ThemeData or player preferences.
string ParentFolder [get]
 Local project-relative parent folder; may not exist yet.
string RepositoryName [get]
 Local, user-entered repository folder name; no asset is saved by this property.
string SaveDataFileName [get]
 Requested persistent JSON filename, independent of the ThemeData asset name.
WindowFrameThemeData Source [get]
 Current copy source: the shipped default initially, or an explicitly chosen project-only override.
IReadOnlyList< WindowFrameTheme > SupportedThemes [get]
 Every source theme entry in its original order; this is not theme validation.
string ThemeDataName [get]
 ThemeData asset/display name without .asset, distinct from folder and persistent JSON names.
string ValidatedDestination [get]
 The last accepted input destination, or null when destination validation failed.

Events

Action< bool > CreationStateChanged
 Allows the Manager to block its other controls while the same-form overlay is active.
Action< ThemeRepositoryCreateResult > RepositoryCreated
 Raised only after production copying/wiring/validation succeeds; Manager uses its existing open path.

Private Member Functions

void AddEligibilityRow (string text, bool included)
 Adds a source-entry row using Unity's existing editor status icon.
void AddFieldConflict (VisualElement field, VisualElement container)
 Places a hidden conflict message directly under a form item; does not change input or source data.
void BrowseParent ()
 Opens a location picker only; cancellation preserves the current form value.
void ChooseProjectSource (WindowFrameThemeData candidate)
 Selects a still-saved project source locally and retains other user-entered setup values.
void CompleteCreation (ThemeRepositoryCreateResult result)
void FailCreation (Exception exception)
List< WindowFrameThemeData > FindAlternateSources ()
 Lists eligible project alternatives using the Manager's existing discovery provider.
void InspectSource ()
 Reads source eligibility into the source card; does not call mutating preparation/upgrade APIs.
void RefreshSourceChoices ()
 Refreshes the inline source choices; no eligible alternatives means a disabled, explained action.
void SetBusyPresentation (bool busy)
 Blocks form inputs while leaving only the in-form progress/cancel overlay interactive.
void SetFieldConflict (VisualElement field, string error)
 Highlights a conflicting item and displays its exact reason; valid input clears its own message.
void ShowCleaningUp ()
void UpdateCopyProgress (string stage, string asset, int completed, int total)
 Reports actual current-stage units in the form; never creates a separate editor progress window.

Static Private Member Functions

static VisualElement Card (VisualElement parent, string title, string description)
 Adds a numbered card with readable directions using the existing editor theme hierarchy.
static Label Note (string text, string className)
 Creates a wrapped themed label; text values are not interpreted as rich markup.

Private Attributes

readonly DropdownField _apply
readonly TextField _assetName
readonly VisualElement _cancelConfirmation
readonly Button _cancelCopy
bool _cancelRequested
readonly Button _chooseSource
bool _cleaningUp
readonly Image _cleanupSpinner
bool _confirmingCancel
readonly Button _createButton
readonly GWG.Extensions.SlideToggleControl _debug
string _destination
List< string > _excluded = new List<string>()
readonly Dictionary< VisualElement, HelpBox > _fieldConflicts = new Dictionary<VisualElement, HelpBox>()
readonly Func< IEnumerable< WindowFrameThemeData > > _findRepositories
bool _inputsValid
bool _isCreating
readonly GWG.Extensions.SlideToggleControl _memory
readonly TextField _name
IDisposable _operation
readonly string _packageRoot
readonly UnityEditor.UIElements.ObjectField _panel
readonly TextField _parent
readonly Label _progressAsset
readonly ProgressBar _progressBar
readonly VisualElement _progressOverlay
readonly Label _progressStage
readonly Label _progressTitle
readonly Label _review
readonly TextField _saveFile
WindowFrameThemeData _source
readonly Label _sourceChoiceInfo
readonly VisualElement _sourceChoices
readonly Label _sourceContext
string _sourceError
readonly UnityEditor.UIElements.ObjectField _sourceField
readonly HelpBox _sourceNotice
readonly Label _sourcePath
readonly IVisualElementScheduledItem _spinnerUpdate
List< WindowFrameTheme > _supported = new List<WindowFrameTheme>()
readonly VisualElement _themeRows
readonly Label _themeSummary
readonly GWG.Extensions.SlideToggleControl _useExistingPanel
readonly HelpBox _validation

Detailed Description

Guided setup and explicit validated repository creation inside the existing Theme Manager.

Each new form starts with the asset-controlled shipped default, not the Manager's open collection. The optional source chooser offers eligible project repositories only; Demo-folder data is never offered. Editing fields and Cancel do not write assets or preferences. Only the explicit Create action calls the production service; its successful result is handed to the Manager for opening. No scene placement or Addressables configuration is performed. The form uses existing editor theme tokens/classes for hierarchy, instructions and warnings. Its three boolean fields reuse GWG.Extensions.SlideToggleControl, preserving BaseField change notifications and local-only values; the controls do not persist settings or create assets.

Constructor & Destructor Documentation

◆ ThemeRepositorySetupView()

GWG.WindowFramework.Editor.ThemeRepositorySetupView.ThemeRepositorySetupView ( WindowFrameThemeData source,
string packageRoot,
Action cancel,
Func< IEnumerable< WindowFrameThemeData > > findRepositories = null )
inline

Builds a cancellable, local-only form using the supplied controller prefab's existing defaults.

Parameters
sourceThe canonical asset-controlled default supplied when the form opens.
packageRootInstalled package path derived by the manager, used for origin checks/template lookup.
cancelCloses the form without asset creation or scene placement.
findRepositoriesThe existing Manager asset discovery, filtered locally to eligible project-only sources.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ AddEligibilityRow()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.AddEligibilityRow ( string text,
bool included )
inlineprivate

Adds a source-entry row using Unity's existing editor status icon.

Parameters
textSource theme name/default marker, including a preserved missing entry.
includedWhether the row describes an entry retained by the planned copy.

The row describes retention, not stylesheet validity or runtime certification. Icons are built-in editor resources; no artwork is generated or copied into the repository. Text and tooltips retain the meaning without requiring colour recognition.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddFieldConflict()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.AddFieldConflict ( VisualElement field,
VisualElement container )
inlineprivate

Places a hidden conflict message directly under a form item; does not change input or source data.

Here is the caller graph for this function:

◆ BrowseParent()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.BrowseParent ( )
inlineprivate

Opens a location picker only; cancellation preserves the current form value.

Here is the caller graph for this function:

◆ CancelAndDispose()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.CancelAndDispose ( )
inline

Cancels/cleans active work if its owner window is closing, rather than leaving an orphan operation.

Here is the caller graph for this function:

◆ CaptureRequest()

ThemeRepositoryCreateRequest GWG.WindowFramework.Editor.ThemeRepositorySetupView.CaptureRequest ( )
inline

Captures every local setup choice for the same production operation used by retained tests.

Does not save sources/preferences or create assets. Validate immediately before creation.

Here is the caller graph for this function:

◆ Card()

VisualElement GWG.WindowFramework.Editor.ThemeRepositorySetupView.Card ( VisualElement parent,
string title,
string description )
inlinestaticprivate

Adds a numbered card with readable directions using the existing editor theme hierarchy.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChooseProjectSource()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.ChooseProjectSource ( WindowFrameThemeData candidate)
inlineprivate

Selects a still-saved project source locally and retains other user-entered setup values.

Rechecks source origin and saved identity at selection time, without parsing themes. This does not call SelectDataFile or save any source/preferences.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompleteCreation()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.CompleteCreation ( ThemeRepositoryCreateResult result)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateRepository()

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView.CreateRepository ( bool showProgress = true)
inline

Starts the shared staged production operation behind this form's blocking progress overlay.

Parameters
showProgressTrue schedules Editor updates so UI repaints; false drains the same stages synchronously for retained fixtures.
Returns
True when work starts (or completes synchronously), not a premature success result. RepositoryCreated signals validated success.

No separate assistant-owned progress window is opened. Unity may display internal import dialogs during individual native calls. Cancellation/rollback and source protection are shared.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FailCreation()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.FailCreation ( Exception exception)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindAlternateSources()

List< WindowFrameThemeData > GWG.WindowFramework.Editor.ThemeRepositorySetupView.FindAlternateSources ( )
inlineprivate

Lists eligible project alternatives using the Manager's existing discovery provider.

Skips the entire installed package, including its canonical default and every Demo-folder collection, before inspecting source content. Names and Unity asset labels do not affect origin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectSource()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.InspectSource ( )
inlineprivate

Reads source eligibility into the source card; does not call mutating preparation/upgrade APIs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Note()

Label GWG.WindowFramework.Editor.ThemeRepositorySetupView.Note ( string text,
string className )
inlinestaticprivate

Creates a wrapped themed label; text values are not interpreted as rich markup.

Here is the caller graph for this function:

◆ RefreshSourceChoices()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.RefreshSourceChoices ( )
inlineprivate

Refreshes the inline source choices; no eligible alternatives means a disabled, explained action.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RequestCancellation()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.RequestCancellation ( )
inline

Pauses the scheduled copy and asks for confirmation without yet requesting cancellation.

Here is the caller graph for this function:

◆ ResolveCancellation()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.ResolveCancellation ( bool confirmed)
inline

Resolves the existing inline cancellation question; No resumes unchanged, Yes starts cleanup.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBusyPresentation()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.SetBusyPresentation ( bool busy)
inlineprivate

Blocks form inputs while leaving only the in-form progress/cancel overlay interactive.

Owner notification also blocks conflicting Manager controls; no separate window is created.

Here is the caller graph for this function:

◆ SetFieldConflict()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.SetFieldConflict ( VisualElement field,
string error )
inlineprivate

Highlights a conflicting item and displays its exact reason; valid input clears its own message.

Here is the caller graph for this function:

◆ ShowCleaningUp()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.ShowCleaningUp ( )
inlineprivate
Here is the caller graph for this function:

◆ UpdateCopyProgress()

void GWG.WindowFramework.Editor.ThemeRepositorySetupView.UpdateCopyProgress ( string stage,
string asset,
int completed,
int total )
inlineprivate

Reports actual current-stage units in the form; never creates a separate editor progress window.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ValidateSetup()

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView.ValidateSetup ( )
inline

Rechecks local form input and updates the review without modifying any project/runtime state.

Returns
True when structural source and local input checks pass, not when repository creation is complete.
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _apply

readonly DropdownField GWG.WindowFramework.Editor.ThemeRepositorySetupView._apply
private

◆ _assetName

readonly TextField GWG.WindowFramework.Editor.ThemeRepositorySetupView._assetName
private

◆ _cancelConfirmation

readonly VisualElement GWG.WindowFramework.Editor.ThemeRepositorySetupView._cancelConfirmation
private

◆ _cancelCopy

readonly Button GWG.WindowFramework.Editor.ThemeRepositorySetupView._cancelCopy
private

◆ _cancelRequested

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView._cancelRequested
private

◆ _chooseSource

readonly Button GWG.WindowFramework.Editor.ThemeRepositorySetupView._chooseSource
private

◆ _cleaningUp

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView._cleaningUp
private

◆ _cleanupSpinner

readonly Image GWG.WindowFramework.Editor.ThemeRepositorySetupView._cleanupSpinner
private

◆ _confirmingCancel

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView._confirmingCancel
private

◆ _createButton

readonly Button GWG.WindowFramework.Editor.ThemeRepositorySetupView._createButton
private

◆ _debug

readonly GWG.Extensions.SlideToggleControl GWG.WindowFramework.Editor.ThemeRepositorySetupView._debug
private

◆ _destination

string GWG.WindowFramework.Editor.ThemeRepositorySetupView._destination
private

◆ _excluded

List<string> GWG.WindowFramework.Editor.ThemeRepositorySetupView._excluded = new List<string>()
private

◆ _fieldConflicts

readonly Dictionary<VisualElement, HelpBox> GWG.WindowFramework.Editor.ThemeRepositorySetupView._fieldConflicts = new Dictionary<VisualElement, HelpBox>()
private

◆ _findRepositories

readonly Func<IEnumerable<WindowFrameThemeData> > GWG.WindowFramework.Editor.ThemeRepositorySetupView._findRepositories
private

◆ _inputsValid

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView._inputsValid
private

◆ _isCreating

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView._isCreating
private

◆ _memory

readonly GWG.Extensions.SlideToggleControl GWG.WindowFramework.Editor.ThemeRepositorySetupView._memory
private

◆ _name

readonly TextField GWG.WindowFramework.Editor.ThemeRepositorySetupView._name
private

◆ _operation

IDisposable GWG.WindowFramework.Editor.ThemeRepositorySetupView._operation
private

◆ _packageRoot

readonly string GWG.WindowFramework.Editor.ThemeRepositorySetupView._packageRoot
private

◆ _panel

readonly UnityEditor.UIElements.ObjectField GWG.WindowFramework.Editor.ThemeRepositorySetupView._panel
private

◆ _parent

readonly TextField GWG.WindowFramework.Editor.ThemeRepositorySetupView._parent
private

◆ _progressAsset

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._progressAsset
private

◆ _progressBar

readonly ProgressBar GWG.WindowFramework.Editor.ThemeRepositorySetupView._progressBar
private

◆ _progressOverlay

readonly VisualElement GWG.WindowFramework.Editor.ThemeRepositorySetupView._progressOverlay
private

◆ _progressStage

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._progressStage
private

◆ _progressTitle

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._progressTitle
private

◆ _review

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._review
private

◆ _saveFile

readonly TextField GWG.WindowFramework.Editor.ThemeRepositorySetupView._saveFile
private

◆ _source

WindowFrameThemeData GWG.WindowFramework.Editor.ThemeRepositorySetupView._source
private

◆ _sourceChoiceInfo

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourceChoiceInfo
private

◆ _sourceChoices

readonly VisualElement GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourceChoices
private

◆ _sourceContext

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourceContext
private

◆ _sourceError

string GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourceError
private

◆ _sourceField

readonly UnityEditor.UIElements.ObjectField GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourceField
private

◆ _sourceNotice

readonly HelpBox GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourceNotice
private

◆ _sourcePath

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._sourcePath
private

◆ _spinnerUpdate

readonly IVisualElementScheduledItem GWG.WindowFramework.Editor.ThemeRepositorySetupView._spinnerUpdate
private

◆ _supported

List<WindowFrameTheme> GWG.WindowFramework.Editor.ThemeRepositorySetupView._supported = new List<WindowFrameTheme>()
private

◆ _themeRows

readonly VisualElement GWG.WindowFramework.Editor.ThemeRepositorySetupView._themeRows
private

◆ _themeSummary

readonly Label GWG.WindowFramework.Editor.ThemeRepositorySetupView._themeSummary
private

◆ _useExistingPanel

readonly GWG.Extensions.SlideToggleControl GWG.WindowFramework.Editor.ThemeRepositorySetupView._useExistingPanel
private

◆ _validation

readonly HelpBox GWG.WindowFramework.Editor.ThemeRepositorySetupView._validation
private

Property Documentation

◆ ApplyMethod

ThemeApplyMethods GWG.WindowFramework.Editor.ThemeRepositorySetupView.ApplyMethod
get

Requested scope to save on the future copied ThemeData.

◆ DebugTelemetryEnabled

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView.DebugTelemetryEnabled
get

Requested existing telemetry option; does not change compilation/feature defines.

◆ ExistingPanel

PanelSettings GWG.WindowFramework.Editor.ThemeRepositorySetupView.ExistingPanel
get

Explicit project PanelSettings selection, or null to request a new default asset.

◆ IsCreating

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView.IsCreating
get

Whether the form is executing the real copy operation; owner UI must block conflicting actions.

◆ LastCreatedResult

ThemeRepositoryCreateResult GWG.WindowFramework.Editor.ThemeRepositorySetupView.LastCreatedResult
getprivate set

Last successfully validated production output; prevents duplicate creation from the same form.

◆ MemoryEnabled

bool GWG.WindowFramework.Editor.ThemeRepositorySetupView.MemoryEnabled
get

Developer-owned memory policy for the future copied controller, never ThemeData or player preferences.

◆ ParentFolder

string GWG.WindowFramework.Editor.ThemeRepositorySetupView.ParentFolder
get

Local project-relative parent folder; may not exist yet.

◆ RepositoryName

string GWG.WindowFramework.Editor.ThemeRepositorySetupView.RepositoryName
get

Local, user-entered repository folder name; no asset is saved by this property.

◆ SaveDataFileName

string GWG.WindowFramework.Editor.ThemeRepositorySetupView.SaveDataFileName
get

Requested persistent JSON filename, independent of the ThemeData asset name.

◆ Source

WindowFrameThemeData GWG.WindowFramework.Editor.ThemeRepositorySetupView.Source
get

Current copy source: the shipped default initially, or an explicitly chosen project-only override.

◆ SupportedThemes

IReadOnlyList<WindowFrameTheme> GWG.WindowFramework.Editor.ThemeRepositorySetupView.SupportedThemes
get

Every source theme entry in its original order; this is not theme validation.

◆ ThemeDataName

string GWG.WindowFramework.Editor.ThemeRepositorySetupView.ThemeDataName
get

ThemeData asset/display name without .asset, distinct from folder and persistent JSON names.

◆ ValidatedDestination

string GWG.WindowFramework.Editor.ThemeRepositorySetupView.ValidatedDestination
get

The last accepted input destination, or null when destination validation failed.

Event Documentation

◆ CreationStateChanged

Action<bool> GWG.WindowFramework.Editor.ThemeRepositorySetupView.CreationStateChanged

Allows the Manager to block its other controls while the same-form overlay is active.

◆ RepositoryCreated

Action<ThemeRepositoryCreateResult> GWG.WindowFramework.Editor.ThemeRepositorySetupView.RepositoryCreated

Raised only after production copying/wiring/validation succeeds; Manager uses its existing open path.