Skip to main content

LensStudio:Ui.ProjectSettings.Warning

Class

Represents a project settings validation warning with a human-readable description.

Index

Properties

Example

// ProjectSettings.Warning is passed to ProjectSettingsPlugin.setIssues()
// to display a non-blocking warning next to the settings entry.
// Use alongside ProjectSettings.Error and ProjectSettings.NoIssue.
export class WarningExampleSettings extends ProjectSettingsPlugin {
createWidget(parent: Widget): Widget {
const root = new Widget(parent);
const layout = new BoxLayout();
layout.setDirection(Direction.TopToBottom);
root.layout = layout;

// Validate project configuration and report issues to the Project Settings UI.
const issues: (ProjectSettings.Error | ProjectSettings.Warning | ProjectSettings.NoIssue)[] = [];
if (targetVersionMismatch) {
issues.push(new ProjectSettings.Warning('Lens target version mismatch detected.'));
}
if (missingRequiredAsset) {
issues.push(new ProjectSettings.Error('Missing required asset reference.'));
}
if (issues.length === 0) {
issues.push(new ProjectSettings.NoIssue());
}
this.setIssues(issues);

return root;
}
}

Constructors

Constructor

new Warning(description): Warning

Constructs a Warning project settings validation result with the given description.

Parameters

ParameterType
descriptionstring

Returns

Warning

Properties

description

description: string

The warning message text.