Class LrWebViewFactory

This class specializes the view factory for use with web-engine plug-ins. An instance is provided to a web engine's views() function. You cannot create an instance in any other context.

The LrWebViewFactory object is only available in web engines.

Summary

Creates a row containing a check box, a label, and a color well, within a section in a Web-module panel.
Creates a row containing a label and a checkbox, within a column container in a section in a Web-module panel.
Creates a container for color swatches within a section in a Web-module panel.
Creates a general-purpose container within a section in a Web-module panel.
Creates a generic column-layout container within a section in a Web-module panel.
Creates a generic row-layout container within a header section in a Web-module panel.
Creates a label with an appropriate color, font, size and margins to be used as a section header.
Creates an identity plate control.
Creates a row containing a label and a color well, within a color_content_column in a section in a Web-module panel.
Creates a row containing a label and an edit text, with optional most-recently-used (MRU) menu.
Creates a row containing a pop-up menu with metadata mode choices, within a section in a Web-module panel.
Creates a top-level Web-module panel.
Creates a row container for popup_menu controls.
Creates a generic row-layout container within a section in a Web-module panel, with correct spacing and horizontal fill.
Creates a control for selecting the number of rows and columns in a grid.
Creates a container for slider_row views within a section in a Web-module panel.
Creates a row containing a label, a slider, and an edit text, within a slider_content_column in a section in a Web-module panel.
Creates a section within a Web-module panel created by panel_content().
Creates a small symbol that appears to warn the user about a specific property value.

Functions

webViewFactory:checkbox_and_color_row( args )
Creates a row containing a check box, a label, and a color well, within a section in a Web-module panel.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.
  • color (LrColor) The color for the well. Use LrView.bind() to tie this to your data model.
  • enabled (Boolean) When true, the checkbox is checked and the color well is enabled. Use LrView.bind() to tie this to your data model.

Return value

(LrView) The checkbox-and-color row view.
webViewFactory:checkbox_row( args )
Creates a row containing a label and a checkbox, within a column container in a section in a Web-module panel.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.
  • value (special). Use LrView.bind() to tie the checkbox to a Boolean value in your data model.

Return value

(LrView) The checkbox-row view.
webViewFactory:color_content_column( args )
Creates a container for color swatches within a section in a Web-module panel. Has a column layout(that is, place='vertical') and appropriate spacing and margins for properly positioning label_and_color_row elements.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The color-content column view.
webViewFactory:content_column( args )
Creates a general-purpose container within a section in a Web-module panel. Has a column layout and appropriate spacing and margins for properly positioning labels, checkboxes, and so on.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The content column view.
webViewFactory:content_section( args )
Creates a generic column-layout container within a section in a Web-module panel. This can contain checkboxes or other labels that do not require any additional indentation.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The content-section view.
webViewFactory:header_section( args )
Creates a generic row-layout container within a header section in a Web-module panel. This can contain checkboxes or other labels that do not require any additional indentation, used as the first element of a section.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The header-section view.
webViewFactory:header_section_label( args )
Creates a label with an appropriate color, font, size and margins to be used as a section header. Must be the immediate child of a subdivided_sections view.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.

Return value

(LrView) The header-section-label view.
webViewFactory:identity_plate( args )
Creates an identity plate control. Must be the immediate child of a subdivided_sections container within a Web-module panel.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.
  • value (special). Use LrView.bind() to tie the value of the control to a value in your data model.
  • enabled (Boolean) Use LrView.bind() to tie the enabled state of the control to a Boolean value in your data model.

Return value

(LrView) The identity-plate view.
webViewFactory:label_and_color_row( args )
Creates a row containing a label and a color well, within a color_content_column in a section in a Web-module panel.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.
  • color (special) Use LrView.bind() to tie this to a color value your data model.

Return value

(LrView) The label-and-color row view.
webViewFactory:labeled_text_input( args )
Creates a row containing a label and an edit text, with optional most-recently-used (MRU) menu.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.
  • wraps (Boolean) When true, wrap long text to the next line.
  • value (string) The value of the edit text. Use LrView.bind() to tie this to your data model.
  • tracking (string) The tracking value of the edit text. Use LrView.bind() to tie this to your data model.
  • preference_key (string, optional) The name of the preference key in which to store the list of most recently used (MRU) items. If omitted, a prefence key is generated based on the key used in the value binding.
  • include_mru (Boolean, optional) When true, include the most-recently-used (MRU) menu. Default is true.

Return value

(LrView) The labeled text-input view.
webViewFactory:metadataModeControl( args )
Creates a row containing a pop-up menu with metadata mode choices, within a section in a Web-module panel.

Parameters

1. args
(table) A table with fields for any:
  • value (mode) The metadata mode. Use LrView.bind() to tie this to your data model.
  • title (string) The localizable label text for the row.

Return value

(LrView) The metadata-mode view.
webViewFactory:panel_content( args )
Creates a top-level Web-module panel. Use only at the top level of containment; immediate children are created with subdivided_sections(). Each child section within this container is separated by a heavy black divider line.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The panel view.
webViewFactory:popup_row( args )
Creates a row container for popup_menu controls.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The popup row view.
webViewFactory:row( args )
Creates a generic row-layout container within a section in a Web-module panel, with correct spacing and horizontal fill.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The row view.
webViewFactory:row_column_picker( args )
Creates a control for selecting the number of rows and columns in a grid.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • rows (number) The number of rows that are selected
  • columns (number) The number of columns that are selected
  • max_rows (number) The maximum number of rows.
  • max_columns (number) The maximum number of columns.
  • min_rows (number) The minimum number of rows.
  • min_columns (number) The minimum number of columns.

Return value

(LrView) The row & column control view.
webViewFactory:slider_content_column( args )
Creates a container for slider_row views within a section in a Web-module panel. Has a column layout(that is, place='vertical') and appropriate spacing and margins for properly positioning slider_row controls.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The slider-content column view.
webViewFactory:slider_row( args )
Creates a row containing a label, a slider, and an edit text, within a slider_content_column in a section in a Web-module panel.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:
  • title (string) The localizable display text.
  • value (number) The current displayed value for the slider. Use LrView.bind() to tie this to your data model.
  • tracking (value) The current value, updated while tracking, or nil if not tracking. Use LrView.bind() to tie this to your data model.
  • tracking_value (value) When the mouse is actively dragging the slider, the value echoed to tracking.
  • unit (string) The label to put after the edit text, as a unit.
  • min (number) The minimum slider value.
  • max (number) The maximum slider value.
  • width_in_digits (number) The amount of room in digits to leave for the edit field.
  • precision (number) The number of decimal places of precision for the slider value.

Return value

(LrView) The slider row view.
webViewFactory:subdivided_sections( args )
Creates a section within a Web-module panel created by panel_content(). Each child view within this container is separated by a light gray divider line. This container sets appropriate margins for aligning headers and checkboxes. Its children are row, column, and heading containers.

First supported in version 2.0 of the Lightroom SDK.

Parameters

1. args
(table) A table with fields for any:

Return value

(LrView) The sections view.
webViewFactory:warning_icon( args )
Creates a small symbol that appears to warn the user about a specific property value.

Parameters

1. args
(table) A table with fields for any:
  • visibility (table) A table describing what property controls the visibility of the icon, and also a method for transforming the property.
    • key (string) The bound property.
    • whenNotEqual (string, optional) The icon becomes visible when the bound property is not equal to this value. Provide this or whenEqual, not both.
    • whenEqual (string, optional) The icon becomes visible when the bound property is equal to this value. Provide this or whenNotEqual, not both.
  • tooltip (string) A message displayed when the cursor hovers over the control.

Return value

(LrView) The warning-icon view.