Adobe 65007312 Programming Guide - Page 32
Adding custom s to the Plug-in Manager, sForTopOfDialog
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 32 highlights
CHAPTER 2: Writing a Lightroom Plug-in Customizing plug-in load behavior 32 selected in the Export dialog, never from the Plug-in Manager dialog. See "Initialization and termination functions for services" on page 38. The propertyTable parameter for both functions is an empty, observable table which you can use to keep private data for your plug-in. (See "Binding UI values to data values" on page 94.) This table is discarded when your plug-in is deselected in the Plug-in Manager or when the Plug-in Manager dialog is closed. It is not preserved across sessions. You can use LrPreferences if you want to save information across invocations. These are blocking calls. If you need to start a long-running task (such as network access), create a task using the LrTasks namespace. See "Defining function contexts and tasks" on page 20. Adding custom sections to the Plug-in Manager Your plug-in can define one or more sections to be displayed in the Plug-in Manager dialog (when defined in an LrPluginInfoProvider entry) or in the Export or Publishing Manager dialog (when defined in an LrExportServiceProvider entry). The custom sections can be shown above or below the Lightroom standard sections for the dialog. To customize the dialog, define a function that returns a table of sections, defined using LrView objects. The function is the value of one of these service entries: sectionsForTopOfDialog = function( viewFactory, propertyTable ) ... end, sectionsForBottomOfDialog = function( viewFactory, propertyTable ) ... end, NOTE: Similar functions can be defined in an Export Service Provider, to customize the Export dialog when the export destination is selected or the Publishing Manager dialog for a publish service, and also in an Export Filter Provider, to add a section to the dialog when a post-process action is selected. See "Customizing the Export and Publishing Manager dialogs" on page 52 and "Adding an export post-process action" on page 41. Lightroom passes your function a factory object which allows you to create the LrView objects that define the elements of your sections; that is, UI controls, such as buttons and text, and containers that group the controls and determine the layout. For additional details of the dialog elements you can create with LrView, see "Adding custom dialog views" on page 82." The function that you define here returns a table of tables, where each table defines one dialog section: sectionsForTopOfDialog = function( viewFactory, propertyTable ) return { { ...section entry section entry end A section entry table defines the contents of an implicit container, which Lightroom creates to hold your view hierarchy. X Each section entry sets a title and synopsis for the section; the section is identified by the title text on the left, and is collapsible. When in the collapsed state, the synopsis text is shown on the right. X The rest of the table entry creates the UI elements that are shown when the section is expanded. To create the UI elements, use the LrView factory passed to your top-level sectionsFor... function. This process is explained in more detail in "Adding custom dialog views" on page 82.