### OnKeyboard Class API Reference Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/OnKeyboard.md Comprehensive API documentation for the `OnKeyboard` Java class, detailing its structure, properties, constructors, and methods. This class serves as a configuration DTO for keyboard event listeners, supporting fluent API for easy setup and integration into event handling systems. ```APIDOC Class: OnKeyboard Inherits: ListenerDto Description: Defines the configuration and data structure for keyboard event listeners. It includes key combinations to monitor and actual triggered keyboard event data, supporting chainable configuration for its execution behavior. Properties: serialVersionUID: private static final long Description: Serialization UID, ensuring class compatibility across different versions. keyboardDto: KeyboardDto Description: Current triggered keyboard event combination filled by the frontend. This property is read-only, used to represent actual keyboard event data. monitoredKeyCombinations: List Description: List of keyboard event combinations specified by the backend to be monitored. If this list is empty or not specified, all keyboard events are monitored by default. Constructors: OnKeyboard() Description: Default constructor. OnKeyboard(Class service, String command, boolean synchronize) Description: Constructor, initializes the listener's backend service class, command, and synchronization flag, delegating to the parent constructor. OnKeyboard(Class service, String command, boolean synchronize, Object data) Description: Constructor, adds a data parameter to the above, delegating to the parent constructor. Methods: getKeyboardDto(): KeyboardDto Description: Retrieves the current triggered keyboard event combination filled by the frontend. getMonitoredKeyCombinations(): List Description: Retrieves the list of keyboard event combinations specified by the backend to be monitored. setMonitoredKeyCombinations(List monitoredKeyCombinations): OnKeyboard Description: Sets the list of keyboard event combinations to be monitored. Returns the current OnKeyboard instance, supporting method chaining. setMonitoredKeyCombinations(KeyboardDto ...monitoredKeyCombinations): OnKeyboard Description: Sets the keyboard event combinations to be monitored using variable arguments, internally converting them to a List. Returns the current OnKeyboard instance, supporting method chaining. setExecutor(ListenerExecutorDto executor): OnKeyboard Description: Overrides parent method, sets the listener's executor. Returns the current OnKeyboard instance, supporting method chaining. setServerExecutor(Class service, String command): OnKeyboard Description: Overrides parent method, sets the server-side execution service class and command. Returns the current OnKeyboard instance, supporting method chaining. setEventExecutor(EventDto event): OnKeyboard Description: Overrides parent method, sets the event executor. Returns the current OnKeyboard instance, supporting method chaining. setSynchronize(boolean synchronize): OnKeyboard Description: Overrides parent method, sets whether to execute synchronously. Returns the current OnKeyboard instance, supporting method chaining. setData(Object data): OnKeyboard Description: Overrides parent method, sets additional data associated with the listener. Returns the current OnKeyboard instance, supporting method chaining. setSelfBinaryData(): OnKeyboard Description: Overrides parent method, sets itself as binary data. Returns the current OnKeyboard instance, supporting method chaining. ``` -------------------------------- ### IBackupService API Reference: Data Backup, Export, and Import Methods Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/IBackupService.md Comprehensive API documentation for the `IBackupService` interface, detailing methods for data package handling, form and user data export/import to Excel, PDF instance management, and export of various system entities like categories and function libraries. ```APIDOC public static IBackupService get() - Returns: IBackupService instance - Description: Static factory method to obtain an IBackupService implementation instance via the Cells framework. public IJson getIJson() - Returns: IJson instance - Description: Retrieves a utility instance for JSON data conversion, allowing object-to-JSON string and JSON string-to-object transformations. public ExportSetting buildPDFExportSetting(String pdfUuid) - Parameters: - pdfUuid: The UUID of the PDF. - Returns: ExportSetting - Description: Constructs or retrieves an export setting object based on the PDF's UUID, used to configure PDF-related data export. public ExportSetting buildRefAction ``` -------------------------------- ### Example Usage of ExcelColumn Annotation in Java Class Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/ExcelColumn.md Illustrates how the `@ExcelColumn` annotation is applied to fields within a Java POJO (Plain Old Java Object) to declare their corresponding Excel column names and whether they are required. This example shows mapping 'id' to '用户ID' (required) and 'name' to '用户姓名'. ```Java public class User { @ExcelColumn(value = "用户ID", require = true) private Long id; @ExcelColumn("用户姓名") private String name; // ... } ``` -------------------------------- ### Java TabDto.empty() Static Factory Method Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/TabDto.md Describes the `empty()` static factory method of `TabDto`, which creates a pre-configured `TabDto` instance with example tab pages and a default theme, useful for quick prototyping and demonstrating component composition. ```APIDOC empty(): TabDto - Description: Static factory method. Creates a pre-configured TabDto instance with two example scrollable tab pages ("tab1", "tab2") and sets the theme to TabTheme.underLine. This method demonstrates basic TabDto usage and how to combine other UI components (e.g., BoxDto) as tab page content, useful for rapid prototyping or generating default component states. - Parameters: None - Returns: TabDto ``` -------------------------------- ### IApplicationService Java Interface API Reference Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/IApplicationService.md Comprehensive API documentation for the `IApplicationService` interface, detailing its methods for application lifecycle management, configuration, menu and user privilege management, WeChat mini-program integration, application import/export, internationalization, and caching. ```APIDOC IApplicationService.java Interface get(): static IApplicationService - Description: Static method to obtain an instance of IApplicationService through the Cells framework, providing a convenient entry point to access this service. - Returns: An instance of IApplicationService. queryApplicationSetting(String appUuid): ApplicationSetting - Description: Queries application setting information based on the provided application UUID. - Parameters: - appUuid: The UUID of the application. - Returns: ApplicationSetting object containing the settings. queryApplicationSettingByCode(IDao dao, String code): ApplicationSetting - Description: Queries application setting information based on the application code, typically used for transactional access via a DAO. - Parameters: - dao: The IDao instance for database access. - code: The code of the application. - Returns: ApplicationSetting object containing the settings. deployApp(Form form): void - Description: Deploys the application. - Parameters: - form: The Form object containing deployment details. - Returns: void. queryAppMenuUuidPathMap(ApplicationSetting appSetting): Map - Description: Queries the mapping relationship between menu UUIDs and menu paths for the specified application. - Parameters: - appSetting: The ApplicationSetting object for the application. - Returns: A Map where keys are menu UUIDs and values are menu paths. queryAppMenus(ApplicationSetting appSetting, String user, Context context, AppPrivilegeDto appPrivilege): List> - Description: Queries the menu list for the specified application, returning a tree structure (PreloadTreeNode), typically used for preloading or building UI menus. - Parameters: - appSetting: The ApplicationSetting object for the application. - user: The user identifier. - context: The Context object. - appPrivilege: The AppPrivilegeDto containing application privileges. - Returns: A List of PreloadTreeNode
representing the menu tree. queryAppMenuNodes(ApplicationSetting appSetting, String user, Context context, AppPrivilegeDto appPrivilege): List - Description: Queries the menu node list for the specified application, returning a flattened list of MenuNodeDto. - Parameters: - appSetting: The ApplicationSetting object for the application. - user: The user identifier. - context: The Context object. - appPrivilege: The AppPrivilegeDto containing application privileges. - Returns: A List of MenuNodeDto representing the menu nodes. queryAppMenuNode(String menuUuid): MenuNodeDto - Description: Queries information for a single menu node based on its UUID. - Parameters: - menuUuid: The UUID of the menu. - Returns: A MenuNodeDto object for the specified menu. queryMenuPrivileges(ApplicationSetting appSetting, String user, Context context): AppPrivilegeDto - Description: Queries the current user's menu privileges in the specified application. - Parameters: - appSetting: The ApplicationSetting object for the application. - user: The user identifier. - context: The Context object. - Returns: An AppPrivilegeDto object containing the menu privileges. isSupportWeChatAccountAuthentication(String userModelId): boolean - Description: Checks if the specified user model supports WeChat account authentication. - Parameters: - userModelId: The ID of the user model. - Returns: boolean, true if supported, false otherwise. isBoundWeChatAccount(User user, String appId, String openId): boolean - Description: Checks if the given user has bound the specified WeChat mini-program account. - Parameters: - user: The User object. - appId: The APPID of the WeChat mini-program. - openId: The OpenID of the WeChat mini-program user. - Returns: boolean, true if bound, false otherwise. queryWeChatMiniProgramBindingUser(String userModelId, String appId, String openId): User - Description: Queries the user bound to a WeChat mini-program based on user model ID, mini-program APPID, and OpenID. - Parameters: - userModelId: The ID of the user model. - appId: The APPID of the WeChat mini-program. - openId: The OpenID of the WeChat mini-program user. - Returns: The User object bound to the mini-program. bindingWeChatMiniProgramAccountToUser(String userModelId, String userCode, String appId, String openId): void - Description: Binds the specified WeChat mini-program account to the user. - Parameters: - userModelId: The ID of the user model. - userCode: The code of the user. - appId: The APPID of the WeChat mini-program. - openId: The OpenID of the WeChat mini-program user. - Returns: void. unbindWeChatMiniProgramAccountToUser(String userModelId, String userCode, String appId, String openId): void - Description: Unbinds the specified WeChat mini-program account from the user. - Parameters: - userModelId: The ID of the user model. - userCode: The code of the user. - appId: The APPID of the WeChat mini-program. - openId: The OpenID of the WeChat mini-program user. - Returns: void. exportApplication(String appCode): Pair - Description: Exports the specified application, returning the file name and the byte array of the file content. - Parameters: - appCode: The code of the application to export. - Returns: A Pair object where the first element is the file name (String) and the second is the file content (byte[]). importApplication(Pair file, String userModelId, String orgModelId): void - Description: Imports an application, typically used for application migration or deployment. - Parameters: - file: A Pair object containing the file name (String) and file content (byte[]). - userModelId: The ID of the user model. - orgModelId: The ID of the organization model. - Returns: void. buildAppRouter(String title, String viewModeId, String viewCode, String modelId, String uuid): AppRouter - Description: Builds an application router object for navigation. - Parameters: - title: The title for the router. - viewModeId: The view mode ID. - viewCode: The view code. - modelId: The model ID. - uuid: The UUID. - Returns: An AppRouter object. preloadAppCache(Progress prog, List appCodes): void - Description: Preloads the cache for specified applications, including model and action instances, to optimize performance. - Parameters: - prog: The Progress object for tracking progress. - appCodes: A List of application codes to preload. - Returns: void. buildExportSetting(Progress prog, String appUuid): ExportSetting - Description: Parses the application and its dependent actions to build the configuration for an export project package. - Parameters: - prog: The Progress object for tracking progress. - appUuid: The UUID of the application. - Returns: An ExportSetting object. buildExportSetting(Progress prog, String appUuid, VisitedContext visitedContext): ExportSetting - Description: Overloaded method, considering the visited context when building export settings. - Parameters: - prog: The Progress object for tracking progress. - appUuid: The UUID of the application. - visitedContext: The VisitedContext object. - Returns: An ExportSetting object. buildExportSetting(Progress prog, IDao dao, String actionModelId, String actionCode, Set visitedActions, Set visitedPdfs, Set roleCodes, ExportSetting exportSetting, boolean onlyView): ExportSetting - Description: Parses dependent actions to build the project package configuration, supporting fine-grained control. - Parameters: - prog: The Progress object for tracking progress. - dao: The IDao instance for database access. - actionModelId: The action model ID. - actionCode: The action code. - visitedActions: A Set of visited action codes. - visitedPdfs: A Set of visited PDF UUIDs. - roleCodes: A Set of role codes. - exportSetting: The existing ExportSetting object. - onlyView: A boolean indicating if only view-related settings should be built. - Returns: An ExportSetting object. buildExportSettingByPDF(Progress prog, IDao dao, String pdfUuid, Set visitedPdfs, ExportSetting exportSetting): ExportSetting - Description: Parses PDF dependent actions to build the project package configuration. - Parameters: - prog: The Progress object for tracking progress. - dao: The IDao instance ``` -------------------------------- ### Flutter Dart InsetDto Equality Operator Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/InsetDto.md Example of the `operator ==` implementation for the `InsetDto` equivalent in Flutter Dart, ensuring consistent equality checks across platforms. This snippet is provided as a hint within the Java `@FlutterCode` annotation. ```Dart @override bool operator ==(Object other){return other is InsetDto && other.left == left && other.right == right && other.top == top && other.bottom == bottom;} ``` -------------------------------- ### BasicAbility Base Class for Framework Capabilities Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/DownloadFile.md Details `fe.cmn.data.BasicAbility`, the foundational abstract class from which `DownloadFile` inherits. It defines the common execution mechanism and context management for abilities, including the `execute(ctx)` method that triggers client actions. ```APIDOC fe.cmn.data.BasicAbility: - Parent class for framework capabilities. - Provides a common execution mechanism and context management. execute(PanelContext ctx) - Triggers the client action for the ability. - Parameters: - ctx: A PanelContext object containing environment information. ``` -------------------------------- ### Define IGpfDCBasicFeService Java Interface Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/IGpfDCBasicFeService.md This snippet defines the `IGpfDCBasicFeService` interface, which serves as a core service contract in the application. It extends `ServiceIntf` and provides a static `get()` method as the sole entry point for obtaining its implementation instance, typically managed by an IOC container like `Cells`. ```Java package ku.m.jdf.codebase; import bap.cells.Cells; import fe.util.intf.ServiceIntf; public interface IGpfDCBasicFeService extends ServiceIntf { /** * Static factory method to get the instance of IGpfDCBasicFeService. * Uses Cells.get() for service lookup. */ public static IGpfDCBasicFeService get() { return Cells.get(IGpfDCBasicFeService.class); } // The following methods are commented out in the original file // but represent significant design aspects. /* Object onListener(ListenerDto listener, PanelContext panelContext, WidgetDto source); void handlerCommandCallback(PanelContext panelContext, String command, Object result); */ } ``` -------------------------------- ### FeStyleSetting Class: Mobile UI Component Style Initialization and Management Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/FeStyleSetting.md Documents the primary methods of the `FeStyleSetting` class for initializing and managing mobile UI component styles. This includes a comprehensive list of `initXxxStyle` methods, generic getter/setter methods, and core functions for building the style tree and handling popups. ```APIDOC FeStyleSetting Class Methods: initMobileBottomTabStyle(AppStyleDto appStyle) - Initializes the style of mobile bottom tab buttons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileBottomTabIconStyle(AppStyleDto appStyle) - Initializes the style of mobile bottom tab button icons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileBottomTabTextStyle(AppStyleDto appStyle) - Initializes the style of mobile bottom tab button text. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileWorkbrenchCollapseStyle(AppStyleDto appStyle) - Initializes the style of mobile workbench collapsible panels. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobilePanelBackGroundStyle(AppStyleDto appStyle) - Initializes the style of mobile panel backgrounds. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileWorkBrenchAppBoxStyle(AppStyleDto appStyle) - Initializes the style of mobile application boxes (e.g., application entry points on the workbench). - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileListViewStyle(AppStyleDto appStyle) - Initializes the style of mobile list views. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileListViewTitleStyle(AppStyleDto appStyle) - Initializes the style of mobile list view titles. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileListViewSubTitleStyle(AppStyleDto appStyle) - Initializes the style of mobile list view subtitles. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileListViewAsideStyle(AppStyleDto appStyle) - Initializes the style of mobile list view sidebars (auxiliary information). - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileListSwipeButtonStyle(AppStyleDto appStyle) - Initializes the style of mobile list swipe action buttons, including danger styles. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormSubmitButtonStyle(AppStyleDto appStyle) - Initializes the style of mobile form submission buttons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormCancelButtonStyle(AppStyleDto appStyle) - Initializes the style of mobile form cancellation buttons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormFieldBoxStyle(AppStyleDto appStyle) - Initializes the style of mobile form field containers, including bordered and borderless types. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileEmbedFormFieldBoxStyle(AppStyleDto appStyle) - Initializes the style of mobile embedded (sub) form field containers. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormFieldLabelBoxStyle(AppStyleDto appStyle) - Initializes the style of mobile form field label containers. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormTopBarStyle(AppStyleDto appStyle) - Initializes the style of mobile form top bars. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormTopBarButtonStyle(AppStyleDto appStyle) - Initializes the style of mobile form top bar buttons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormBottonBarStyle(AppStyleDto appStyle) - Initializes the style of mobile form bottom bars. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobilePopupConfirmButtonStyle(AppStyleDto appStyle) - Initializes the style of mobile popup confirmation buttons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobilePopupCancelButtonStyle(AppStyleDto appStyle) - Initializes the style of mobile popup cancellation buttons. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobileFormBoxStyle(AppStyleDto appStyle) - Initializes the style of mobile form boxes (form areas within a page). - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initMobilePartFormBoxStyle(AppStyleDto appStyle) - Initializes the style of mobile partial form boxes (partial form areas within a page). - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initEditorAlignLeftStyle(AppStyleDto appStyle) - Initializes the style for left-aligned editor content. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initEditorAlignCenterStyle(AppStyleDto appStyle) - Initializes the style for center-aligned editor content. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void initEditorAlignRightStyle(AppStyleDto appStyle) - Initializes the style for right-aligned editor content. - Parameters: - appStyle: (AppStyleDto) Application style data transfer object. - Returns: void getStyleTree() - Builds and returns the complete style configuration tree. - Parameters: None. - Returns: AppStyleDto (or similar root style DTO). popupFirstPanel(FormEditPanelIntf panel, ...) - Displays a first-level popup panel using PopDialog and PopDrawer. - Parameters: - panel: (FormEditPanelIntf) The panel to display. - ...: Additional parameters for popup configuration (e.g., title, size). - Returns: void popupInnerPanel(FormEditPanelIntf panel, ...) - Displays an inner popup panel using PopDialog and PopDrawer. - Parameters: - panel: (FormEditPanelIntf) The panel to display. - ...: Additional parameters for popup configuration (e.g., title, size). - Returns: void Various getXxx() / setXxx() - Provides access and modification interfaces for private or public style properties defined within the class. - Parameters: Varies based on property (e.g., for setXxx, the value to set). - Returns: Corresponding type for getXxx(), void for setXxx(). ``` -------------------------------- ### Frontend UI Setting Items Loading from JSON Resources Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/GpfDCBasicUtil.md A collection of methods to load predefined UI component settings (for tables, applications, trees, cards, and forms) from specific JSON resource files. Each method deserializes the content into a list of `SettingItemDto` objects. ```APIDOC getTableSettingItems() - Returns: List - Description: Reads content from `resource/TableSetting.json` and deserializes it into a `List` for general table settings. getAppViewSettingItems() - Returns: List - Description: Reads content from `resource/ApplicationSetting.json` and deserializes it into a `List` for general application view settings. getTreeSettingItems() - Returns: List - Description: Reads content from `resource/TreeSetting.json` and deserializes it into a `List` for general tree component settings. getCardSettingItems() - Returns: List - Description: Reads content from `resource/CardSetting.json` and deserializes it into a `List` for general card component settings. getFormSettingItems() - Returns: List - Description: Reads content from `resource/FormSetting.json` and deserializes it into a `List` for general form component settings. ``` -------------------------------- ### PopupPanel Class Definition and Core Responsibilities Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/PopupPanel.md This entry details the `PopupPanel` class, its inheritance, and its primary role as a generic popup panel component. It outlines how the class provides core logic for building and managing both drawer and dialog type popups, including content setup, button operations, callback handling, and data passing. It serves as both an abstract UI component and a container for static utility methods. ```APIDOC public class PopupPanel Inherits/Implements: AbsComponent, ListenerInterface, PanelAblity Description: As a generic popup panel component, it is used to display popup interfaces. It provides the core logic for building and managing drawer and dialog type popups, including content settings, button operations, callback processing, and data transfer. This class is both an abstraction of UI components and contains a series of static utility methods for convenient creation and display of popups. ``` -------------------------------- ### GpfDCBasicFeUtil Java Utility Methods Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/GpfDCBasicFeUtil.md Comprehensive documentation for the static utility methods provided by the `GpfDCBasicFeUtil` class, covering UI component operations, color conversions, event handling, and UI structure traversal and modification. ```APIDOC GpfDCBasicFeUtil Static Methods: public static CColor hex2CColor(String hexString) - Returns: CColor - Description: Converts a hexadecimal string like `#AARRGGBB` to a `CColor` object, where AA is alpha, and RR, GG, BB are RGB components. public static String CColor2Hex(CColor color) - Returns: String - Description: Converts a `CColor` object to a hexadecimal string representation like `#AARRGGBB`. public static String paddingHex(String hexStr) - Returns: String - Description: Helper method to pad a single-digit hexadecimal string to two digits (e.g., "A" becomes "0A"). public static void setOnClickListenerFeedback(FeStyleSetting setting, OnClickListener onClickListener) - Returns: void - Description: Sets click listener feedback effects based on `FeStyleSetting`, such as border feedback. public static void setBorder(WidgetDto widget) - Returns: void - Description: Sets a default gray border and padding for a `WidgetDto`. public static LabelDecorationDto getLabelDecorationDto(double fontSize, boolean isFontWeight, Color color) - Returns: LabelDecorationDto - Description: Retrieves a `LabelDecorationDto` for setting label font size, weight, and color, with default center alignment. public static LabelDecorationDto getLabelDecorationDto(double fontSize, boolean isFontWeight, CLabelAlign align, Color color) - Returns: LabelDecorationDto - Description: Retrieves a `LabelDecorationDto` for setting label font size, weight, alignment, and color. public static CTextStyle getTextStyle(double fontSize, boolean isFontWeight) - Returns: CTextStyle - Description: Retrieves a `CTextStyle` object for setting text font size and weight (defaults to white color). public static CTextStyle getTextStyle(double fontSize, boolean isFontWeight, Color color, double height) - Returns: CTextStyle - Description: Retrieves a `CTextStyle` object for setting text font size, weight, color, and line height. public static ImageDto createImage(String src, double scale) - Returns: ImageDto - Description: Creates an `ImageDto` for displaying images, setting its scale, filter quality, and mouse cursor type. public static BoxDto getCenterBox(WidgetDto widgetDto) - Returns: BoxDto - Description: Creates a `BoxDto` that horizontally and vertically centers its internal `widgetDto`. public static BoxDto createRectangle(double wide, double high, CColor color) - Returns: BoxDto - Description: Creates a rectangular box with specified width, height, and background color. public static BoxDto createcircular(double diameter, CColor color) - Returns: BoxDto - Description: Creates a circular box with specified diameter and background color. public static Component newComponentInstance(String compomentClass, WidgetParam widgetParam) - Returns: Component - Description: Creates a `Component` instance by reflection based on the component's class name and sets its `WidgetParam`. public static void searchWidget(Object obj, Function accepter, List matchWidgets) - Returns: void - Description: Recursively traverses the given object and its fields (including arrays, Maps, Iterables) to find all `WidgetDto`s matching specified conditions, adding them to `matchWidgets`. public static Object replaceWidget(Object obj, Function accepter) - Returns: Object - Description: Recursively traverses the given object and its fields, finds `WidgetDto` type sub-components, and replaces them with the non-null return value of the `accepter` function. public static void collectWidget(Object obj, Function accepter, Map collectMap) - Returns: void - Description: Recursively traverses the given object and its fields to find all `WidgetDto`s matching specified conditions, collecting them into `collectMap` using their `widgetId` as keys. public static ListenerDefine getListenerDefineByKeyboard(List listenerDefines, KeyboardDto keyboard) - Returns: ListenerDefine - Description: Searches a list of listener definitions for a listener definition matching the given `KeyboardDto` keyboard event. public static ButtonDefine getButtonDefineByName(List buttonDefines, String btnName) - Returns: ButtonDefine - Description: Searches a list of button definitions for a button definition matching the given name. public static List getViewInitListenerDefines(List listenerDefines, ListenerApplyLocation location) - Returns: List - Description: Filters a list of listener definitions to find those of type `ViewInit` and matching the specified application location. public static List getViewInitedListenerDefines(List listenerDefines, ListenerApplyLocation location) - Returns: List - Description: Filters a list of listener definitions to find those of type `ViewInited` and matching the specified application location. public static List getAfterQueryTableRowListenerDefines(List listenerDefines, ListenerApplyLocation location) - Returns: List - Description: Filters a list of listener definitions to find those of type `AfterQueryTableRow` and matching the specified application location. public static double caculateLabelFontCnt(String label) - Returns: double - Description: Calculates the "character count" of a label string, where Chinese characters count as 1 and English characters as 0.5. ``` -------------------------------- ### JITFormOpObserver Class API Reference Source: https://github.com/ku-m/jdf-codebase/blob/main/snippets/JITFormOpObserver.md Detailed API documentation for the `JITFormOpObserver` class, including its fields, constructor, and methods for managing form lifecycle events such as code generation, timestamping, and workspace associations. ```APIDOC Class: JITFormOpObserver Description: This class acts as an observer for form operations (create, update, delete) within a JIT (Just-In-Time) module, handling tasks like setting form codes, timestamps, and managing workspace-related links. Fields: serialVersionUID: long - Serialization ID. orgModelId: String - Organization model ID, used to distinguish data ownership or business context. user: User - Current operating user. workSpace: WorkSpace - Current operating workspace. jitSetting: JitSettingDto (transient) - JIT module configuration, lazy-loaded. nameModelIds: List (static final) - List of form model IDs that require numbering based on name. timeStampModelIds: List (static final) - List of form model IDs that require timestamp setting. Constructor: JITFormOpObserver(User user, String orgModelId, WorkSpace workSpace) Description: Initializes the observer instance with user, organization model ID, and workspace. Parameters: user: User - The current operating user. orgModelId: String - The organization model ID. workSpace: WorkSpace - The current operating workspace. Methods: getOrgModelId(): String Description: Retrieves the organization model ID. setOrgModelId(String orgModelId): JITFormOpObserver Description: Sets the organization model ID and returns the current instance for chaining. Parameters: orgModelId: String - The organization model ID to set. getUser(): User Description: Retrieves the user. setUser(User user): JITFormOpObserver Description: Sets the user and returns the current instance. Parameters: user: User - The user to set. getWorkSpace(): WorkSpace Description: Retrieves the workspace. setWorkSpace(WorkSpace workSpace): JITFormOpObserver Description: Sets the workspace and returns the current instance. Parameters: workSpace: WorkSpace - The workspace to set. getJitSetting(): JitSettingDto Description: Retrieves JIT configuration; queries and caches from the database if not loaded. getActionInstanceImportObserver(): ActionInstanceImportObserver Description: Dynamically loads and retrieves ActionInstanceImportObserver instance based on JIT configuration. getCodePrefix(): String Description: Retrieves the numbering prefix based on the current workspace tag. buildFormCode(String name): String Description: Constructs a complete form code with a workspace prefix based on the given name. Parameters: name: String - The base name for the form code. getViewName(String name): String Description: Converts a name with a workspace prefix to an underlying view model name (removes prefix). Parameters: name: String - The name with a workspace prefix. getViewCode(String name): String Description: Converts an underlying view name ($workspace_ prefix) to a numbered code with a workspace prefix. Parameters: name: String - The underlying view name. getNameByFormCode(String code): String Description: Retrieves the name from a form code (removes workspace prefix). Parameters: code: String - The form code. getCodePrefix(WorkSpace workspace): String (static) Description: Static method to retrieve the numbering prefix for a specified workspace. Parameters: workspace: WorkSpace - The workspace for which to get the prefix. onBeforeCreate(Progress prog, ObserverContext context): void Description: Executes before form creation, primarily for setting form codes and timestamps. Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. setTimeStamp(Form form): void Description: Sets the creation and update timestamps for a form. Parameters: form: Form - The form to set timestamps for. getNameByCode(AssociationData assocData): String Description: Retrieves the corresponding name based on AssociationData, handling different model types. Parameters: assocData: AssociationData - The association data. getCodeByName(IDao dao, String formModelId, String name): String Description: Retrieves the corresponding code based on name and form model ID; may trigger database queries and business validation. Parameters: dao: IDao - Data access object. formModelId: String - The form model ID. name: String - The name to look up. setFormCode(Form form): void Description: Sets the Code property of a form based on its model ID and name. Parameters: form: Form - The form to set the code for. onAfterCreate(Progress prog, ObserverContext context): void Description: Executes after form creation, primarily for saving workspace-related links. Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. saveWorkspaceLink(IDao dao, Object data): void Description: Saves the association link between the workspace and specified data (PDCForm, Form, Role). Parameters: dao: IDao - Data access object. data: Object - The data object (PDCForm, Form, or Role). onBeforeUpdate(Progress prog, ObserverContext context): void Description: Executes before form update, primarily for updating form codes and timestamps. Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. onAfterUpdate(Progress prog, ObserverContext context): void Description: Executes after form update, primarily for saving workspace-related links. Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. onBeforeDelete(Progress prog, ObserverContext context): void Description: Executes before form deletion (currently empty implementation). Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. onAfterDelete(Progress prog, ObserverContext context): void Description: Executes after form deletion (currently empty implementation). Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. onBeforeBatchDelete(Progress prog, ObserverContext context): void Description: Executes before batch deletion (currently empty implementation). Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. onAfterBatchDelete(Progress prog, ObserverContext context): void Description: Executes after batch deletion (currently empty implementation). Parameters: prog: Progress - Progress indicator. context: ObserverContext - Context for the observer. onBeforeBatchCreate(Progress prog, ObserverContext observerContext): void Description: Executes before batch creation (currently empty implementation). Parameters: prog: Progress - Progress indicator. observerContext: ObserverContext - Context for the observer. ```