Adobe 65007312 Programming Guide - Page 122
Using web view factories
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 122 highlights
CHAPTER 6: Writing a Web-engine Plug-in Defining the data model 122 Here is an example of the format of the views function for your web engine: return { ... views = function( controller, f ) local LrView = import "LrView" local bind = LrView.bind local multibind = viewFactory.multibind return { labels = f:panel_content { -- returned item identifies panel bind_to_object = controller, -- bound table is passed controller f:subdivided_sections { f:labeled_text_input { -- create controls in the sections title = "Site Title", value = bind "metadata.siteTitle.value", -- bind to model data }, ...additional content... }, colorPalette = f:panel_content { bind_to_object = controller, ...define content... }, appearanceConfiguration = f:panel_content { bind_to_object = controller, ...define content... }, outputSettings = f:panel_content { bind_to_object = controller, ...define content... }, }, } end, ... } Using web view factories Notice that the view factory passed to views function is an extension of the standard view factory described in Chapter 5, "Creating a User Interface for Your Plug-in." It is an object of type LrWebViewFactory, and it defines these additional functions for creating UI content suitable to the Web module (see the Lightroom SDK API documentation for details): panel_content subdivided_sections header_section_label Creates a top-level panel in the Web module, which contains sections divided by heavy black lines. Creates a section within a panel in the Web module. Within the section, control rows and columns are separated by light gray lines. Creates a text label for a section within a panel, with suitable formatting.