WO2010057434A1 - 一种生成控件对象库的方法和装置 - Google Patents

一种生成控件对象库的方法和装置 Download PDF

Info

Publication number
WO2010057434A1
WO2010057434A1 PCT/CN2009/075033 CN2009075033W WO2010057434A1 WO 2010057434 A1 WO2010057434 A1 WO 2010057434A1 CN 2009075033 W CN2009075033 W CN 2009075033W WO 2010057434 A1 WO2010057434 A1 WO 2010057434A1
Authority
WO
WIPO (PCT)
Prior art keywords
control
file
interface module
module
list
Prior art date
Application number
PCT/CN2009/075033
Other languages
English (en)
French (fr)
Inventor
谭毅
方李志
赖勇辉
姜宏
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2010057434A1 publication Critical patent/WO2010057434A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Definitions

  • the present invention relates to the field of computer Internet, and in particular, to a method and apparatus for generating a library of control objects.
  • IM Ins tant Mes sag ing
  • each interface module of IM is composed of a window and various controls attached to the window.
  • Startup Panel This interface module consists of a window and an account input Edi t control, password input Edi t control, soft keyboard control, check box control, button But ton control and other controls.
  • the IM skin file includes information on the controls on the IM window, which properties of these controls, and the values corresponding to these properties described in the XML (Extensible Markup Language) file.
  • XML Extensible Markup Language
  • the size, color, location, etc. of the login button on the launch panel are described in XML.
  • an XML describes which child controls are in a window, as well as the size, name, text description, position, color, and child controls that are subordinate to these child controls.
  • IM software Similar to MFC (Microsof t Founding Clas ses, Microsoft Foundation), which has buttons but ton, edit Edi t, etc., IM software also has a GUI (Graphic User Interface) control called ⁇ skin. Controls, that is, some of the controls used to build a graphical interface, are referred to below as controls (or controls).
  • the controls in the middle are usually modified: 3 ⁇ 4 under the mouth: Wherein, the IM control that needs to be modified is identified, firstly, the control description file is opened; then, from the opened control description file, the IM control that needs to be identified is found; secondly, the found IM control that needs to be identified is added to the object. In the library file, the subsequent modification of the IM control can be implemented.
  • the method provided by the prior art is cumbersome to operate, and the developer who needs to control the IM control can easily access various IM controls with a single access method.
  • SUMMARY OF THE INVENTION In order to realize the automatic conversion of an IM control into an object library file, it is convenient for a developer who needs to control the IM control to use various IM controls.
  • the embodiment of the present invention provides a method and apparatus for generating a control object library. The technical solution is as follows:
  • an embodiment of the present invention provides a method for generating a control object library, where the method includes:
  • A reading a skin file of the interface module, configuring a file according to the hierarchical relationship of the interface module, and generating a control object list of the interface module;
  • step B determining whether the interface module has a control identifier file, if yes, importing the control identifier file of the interface module into the control object list, and performing step C; otherwise, generating a control identifier of the control of the interface module, and obtaining a control Identify the file, import the obtained control identification file into the generated control object list, and perform step C;
  • step C Output the control object list imported from the control identification file obtained in step B to the object library file.
  • an embodiment of the present invention provides an apparatus for generating a control object library, where the apparatus includes:
  • a generating module configured to read a skin file of the interface module, and generate a control object list of the interface module according to the hierarchical relationship configuration file of the interface module;
  • a first judging module configured to determine whether the interface module has a control identifier file, and a first processing module, configured to: when the result of the first judging module is yes, The control identifier file of the interface module is imported into the control object list;
  • a second processing module configured to: when the result of the first determining module is negative, generate a control identifier of the control of the interface module, obtain a control identification file, and import the obtained control identification file into the generated control object list. ;
  • an output module configured to output, to the object library file, a control object list that is obtained by the first processing module or the second processing module and that is imported into the control identifier file.
  • the IM control is automatically converted into an object library file, which facilitates the use of various IM controls by the developer who needs to control the IM control, which reduces the operational complexity of the operation and reduces the time spent on the operation.
  • FIG. 1 is a schematic flow chart of an embodiment of a method for generating a control object library according to the present invention
  • FIG. 2 is a detailed flow chart of an embodiment of a method for generating a control object library according to the present invention
  • FIG. 4 is a detailed structural diagram of an apparatus embodiment for generating a control object library according to the present invention.
  • the example provides a method for generating a control object library.
  • the method of the method shown in Figure 1 is as follows:
  • Step S1 Read the skin file of the interface module, configure a file according to the hierarchical relationship of the interface module, and generate a control object list of the interface module.
  • the skin file stores which interface modules the skin consists of and the hierarchical relationship between these interface modules. In this step, by reading the skin file, the hierarchical relationship between the list of interface modules constituting the skin and the module can be obtained.
  • Step S2 determining whether the interface module has a control identifier file, if yes, importing the control identifier file of the interface module into the control object list, and performing step S3; otherwise, generating a control identifier of the control of the interface module, and obtaining the control identification file, The control identifier file is imported into the generated control object list, and step S3 is performed;
  • the list of control objects is a list of all the controls that make up an interface module.
  • the control identification file is a file that stores the handle of the control. For each control, the identifier of the control is used as the handle, and the identifier of the control is equivalent to the alias of the control.
  • a corresponding control file can also be set, and the control has a list of the items contained in the control.
  • Step S3 Output the control object list of the control identification file obtained in step S2 to the object library file.
  • step S3 further includes: internationalizing the obtained control object list into which the control identification file is imported.
  • the above-mentioned internationalization of the obtained control object list into which the control identification file is imported includes:
  • step S1 the method further includes:
  • step S1 Reading the object classification configuration file preset in the object library, classifying the control according to the read object classification configuration file, generating a control dictionary, a window list, and a container list; accordingly, step S1 includes:
  • control name text description identifier
  • control type name control identifier
  • the corresponding text description is searched in the internationalization dictionary, and a list of control objects of the interface module is generated.
  • step S2 the method further includes:
  • the embodiment of the present invention provides a method for generating a control object library.
  • the present embodiment is an example of a method provided by an embodiment of the present invention in the field of IM, a common object-oriented explanatory computer programming language Python.
  • the method is as follows:
  • the IM control is divided into three categories according to different attributes: a control object class, a window class, and a container class;
  • control object class refers to the entity control that completes the visible function of the user who uses the IM control (usually the developer of the IM software). For example: Button Button, TabBut ton, Co ⁇ boBox, etc. all belong to the IM object of the control object class.
  • the name of the class control they are The Python object names should be stored in the Python dictionary structure to form a control dictionary.
  • window class refers to various window controls in the IM control, for example: Windows,
  • IGFFloa t ingWnd PopupWindow, etc., store the name of this type of control in the Python list structure to form a list of windows.
  • the container class refers to a list of controls arranged in the IM control for organizing the hierarchy; for example, Frame , TabCtr l , IGFToolbar , etc., the name of the control is stored in the Python list structure to form a container list.
  • the classification rule according to which can be written in a specific file defines the file written into the classification rule as the object classification configuration file. .
  • the configuration file mainly includes the following contents:
  • Hierarchical relationship A window can often be described by multiple XML files. For example, a set center window, there are multiple TabBut ton, each TabBut ton has a number of child controls, the parent-child relationship of these controls is called the control level, and each child control is described by an XML file, these child controls and descriptions
  • the mapping relationship of the XML files is called a file level.
  • custom controls Some controls on the IM software interface are not defined in the skin file, you need to define the properties of these controls and specify the hierarchical relationship; for example: for dynamically generated controls, you need to define the properties of the control and specify its hierarchical relationship .
  • Attribute mandatory setting The properties of some controls in the skin file are inconsistent with the attributes displayed by the final software. One or more attributes of the control can be reassigned by the attribute forcing technique; for example, the text on but ton is forcibly modified.
  • a Python object that associates the Python object with the controls in the IM interface module skin file. Some methods are provided in the Python object to access certain properties of the skin control.
  • a control object includes at least the following members: a child object, an object name, a text description ID, an internationalized string of the ID, a name (type), and an object ID.
  • 104A Find a list of its sub-objects through the hierarchical relationship of objects and sub-objects in the configuration file corresponding to the window (each sub-object can also have sub-objects and other various members);
  • the object name of the object is read by reading the skin file of the window, the string ID of the text description, the name (type), the object ID;
  • a Python object corresponding to each skin control can be generated, and a list of control objects of the IM interface module can be generated.
  • step 105 Determine whether the IM interface module has a control identification file, and if yes, execute step 107; otherwise, go to step 106.
  • control identification file only refers to the use of the object library for convenience, each control has a unique identifier at the same level, (or a globally unique identifier in the object library);
  • step 106 Generate a control identifier of each control of the IM interface module, and update to step 104 above. A list of control objects of the generated IM interface module; and outputting the generated control identification file, and then performing step 108.
  • the Chinese simplified object is read from the internationalization dictionary as the identifier of the control; otherwise, if there is no file description attribute, the identifier is generated based on the control name.
  • the first generated object library is modified by the object library management tool to be a short, easy-to-identify text, and then exported to generate an identification file associated with the window configuration file name, wherein the exported control identification file is called a control Identification file.
  • control identification files are placed in the same directory as the window configuration file, and then the control identification file is imported into the object library when the object library is generated. Thus, it is guaranteed that the user will not be affected even when the international resource file is constantly modified.
  • step 107 Import the control identifier file of the IM interface module in the control object list of the IM interface module generated in the above step 104, and then perform step 108.
  • step 108 Determine whether the IM interface module has a control file, if yes, execute step 109; otherwise, go to step 110.
  • step 109 Import the control file of the IM interface module into the control object list of the IM interface module, and then go to step 110.
  • Step 110 Generate an internationalization dictionary according to step 103, and internationalize the control object list of the IM interface module.
  • step 110 is to enable the method provided by the embodiment of the present invention to meet the requirements of internationalization and generalization.
  • the control object list of the IM interface module that has been subjected to the internationalization process described above is output to the object library file.
  • the method for generating a control object library implements the automatic conversion of the IM control into the object library file for the currently widely used IM software, which facilitates the use of various types of research and development personnel who need to control the IM control.
  • the IM control reduces the operational complexity of the operation and reduces the time spent on the operation.
  • the object library generated by the method has internationality and versatility, that is, the internationalization resource change is shielded by the identifier import and export technology. The impact of library usage.
  • an embodiment of the present invention provides an apparatus for generating a control object library, where the apparatus includes:
  • a generating module 301 configured to read a skin file of the interface module, generate a file according to a hierarchical relationship configuration file of the interface module, and generate a control object list of the interface module;
  • the first determining module 302 is configured to determine whether the interface module has a control identifier file.
  • the first processing module 303 is configured to: when the first determining module 302 determines that the result is yes, import the control identifier file of the interface module into the control object list;
  • the second processing module 304 is configured to: when the result of the first determining module 302 is negative, generate a control identifier of the control of the interface module, obtain a control identifier file, and import the obtained control identifier file into the generated control object list;
  • the output module 305 is configured to output the control object list obtained by the first processing module 303 or the second processing module 304 into the object library file.
  • the output module 305 in the device for generating the control object library is further configured to internationalize the control object list obtained by the first processing module 303 or the second processing module 304 and importing the control identification file.
  • FIG. 4 is a detailed schematic diagram of an apparatus for generating a control object library according to an embodiment of the present invention.
  • the apparatus further includes: a forming module 306, configured to read an internationalized resource of the interface module, and generate the internationalized resource according to the read International dictionary;
  • the output module 305 specifically includes:
  • the processing unit 3051 is configured to obtain an internationalization dictionary according to the forming module 306, and perform an internationalization process on the control object list obtained by the first processing module 303 or the second processing module 304 and importing the control identifier file;
  • the output unit 3052 is configured to output the control object list of the control identification file that is processed by the processing unit 3051 to the object library file.
  • the apparatus for generating a control object library provided by the embodiment of the present invention further includes: a classification module, configured to read a preset object classification configuration file in the object library, and classify the control according to the read object classification configuration file, Generate a control dictionary, a list of windows, and an ⁇ 1 J table;
  • the generating module 301 specifically includes:
  • the obtaining unit is configured to read the skin file of the interface module, and according to the hierarchical relationship configuration file of the interface module, obtain the correspondence between the control in the interface module and the child control of the control; and obtain the control name, text description identifier of each control, a control type name and a control identifier; a generating unit, configured to search for a corresponding text description in the international dictionary formed by the forming module according to the text description identifier of each control obtained by the obtaining unit, and generate a control object list of the interface module.
  • the device further includes:
  • a second determining module configured to determine whether the interface module has a control file
  • a fourth processing module configured to: when the determining result of the second determining module is yes, import the control file into the first processing module 303 or the second
  • the control module 304 obtains a list of control objects after the control identification file is imported.
  • the device for generating a control object library provided by the embodiment of the present invention automatically converts the IM control into an object library file for the currently widely used IM software, which facilitates the use of various types of research and development personnel who need to control the IM control.
  • the IM control reduces the operational complexity of the use and reduces the time spent on the operation; further, the object library generated by the device is international and versatile.
  • the technical solution provided by the embodiment of the present invention can be implemented by extracting the control information in the skin file according to the hierarchical relationship to generate a clear object library, and realizing the dynamic addition of the undefined control in the skin file and the control attribute through the convenient configuration file.
  • receiving in the embodiment of the present invention may be understood as actively acquiring information from other modules or receiving information sent by other modules.
  • receiving in the embodiment of the present invention may be understood as actively acquiring information from other modules or receiving information sent by other modules.
  • a person skilled in the art can understand that the drawings are only a schematic diagram of a preferred embodiment, and the modules or processes in the drawings are not necessarily required to implement the embodiments of the present invention.
  • modules in the apparatus in the embodiments may be distributed in the apparatus of the embodiment according to the embodiment, or may be correspondingly changed in one or more apparatuses different from the embodiment.
  • the modules of the above embodiments may be combined into one module, or may be further split into a plurality of sub-modules.
  • serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
  • Some of the steps in the embodiment of the present invention may be implemented by using software, and the corresponding software program may be stored in a readable storage medium, such as an optical disk or a hard disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)

Description

一种生成控件对象库的方法和装置
技术领域 本发明涉及计算机互联网领域, 特别涉及一种生成控件对象库的方 法和装置。 发明背景 随着通信技术的发展, IM ( Ins tant Mes sag ing,即时通讯)技术已 经成为目前互联网上一个主流应用的方向, 它使人与人之间的交流更加 容易、快捷,用户再也不用为信件延时以及长途电话昂贵的话费而担心。
其中, IM的每一个界面模块都是由一个窗口以及附着在该窗口上面 的各种各样的控件组成的。 例如: 启动面板这个界面模块是由一个窗口 以及帐号输入 Edi t控件, 密码输入 Edi t控件, 软键盘控件, 复选框控 件、 按钮 But ton控件等多个控件组成的。
IM皮肤文件中包括 IM窗口上有哪些控件、 这些控件的有哪些属性 以及通过 XML (Extens ible Markup Language, 可扩展置标语言)文件描 述的这些属性对应的值等信息。 例如: 启动面板上的登录按钮的大小、 颜色、 位置等属性是通过 XML描述出来。 换而言之, 通过一个 XML描述 了一个窗口有哪些子控件, 以及这些子控件的大小、 名字、 文字描述、 位置、 颜色以及从属于这些子控件的子控件等等。
与 MFC (Microsof t Founda t ion Clas ses , 微软基础类)拥有按钮 but ton、编辑 Edi t等控件类似, IM软件也拥有一套 GUI ( Graphica l User Interface , 图形用户接口)控件, 称为 ΙΜ皮肤控件, 即是指 ΙΜ软件 实现的一些用于构建图形界面的控件, 以下称为 ΙΜ控件(或控件)。
随着 ΙΜ软件所面向的消费用户的需求的不断变化、 ΙΜ软件的不断 升级, 作为控制 ΙΜ控件的研发人员需要对 ΙΜ软件中的控件进行修改, 以满足用户的需求, 其中, 在对 ΙΜ软件中的控件进行修改时通常釆用 :¾口下方式: 其中, 对需要进行修改的 IM控件进行标识, 首先打开控件描述文 件; 然后, 从打开的控件描述文件中, 查找到需要标识的 IM控件; 其 次, 将查找到的需要标识的 IM控件添加到对象库文件中, 后续可以实 现对该 IM控件的修改操作。
发明人在实现本发明时经过分析和研究后, 发现上述现有技术至少 存在以下的缺点和不足:
现有技术提供的方法操作烦瑣、无法实现需要控制 IM控件的研发人 员方便地访问各种 IM控件, 且访问方式单一。 发明内容 为了实现自动将 IM控件转化为对象库文件, 方便需要控制 IM控件 的研发人员使用各种 IM控件, 本发明实施例提供了一种生成控件对象 库的方法和装置。 所述技术方案如下:
一方面, 本发明实施例提供一种生成控件对象库的方法, 所述方法 包括:
A:读取界面模块的皮肤文件, 根据所述界面模块的层次关系配置文 件, 生成所述界面模块的控件对象列表;
B:判断界面模块是否存在控件标识文件, 如果是, 则将所述界面模 块的控件标识文件导入所述控件对象列表, 执行步骤 C; 否则, 生成所 述界面模块的控件的控件标识, 得到控件标识文件, 将得到的控件标识 文件导入到生成的控件对象列表, 执行步骤 C;
C:将步骤 B得到的导入了控件标识文件的控件对象列表, 输出到对 象库文件。
另一方面, 本发明实施例提供了一种生成控件对象库的装置, 所述 装置包括:
生成模块, 用于读取界面模块的皮肤文件, 根据所述界面模块的层 次关系配置文件, 生成所述界面模块的控件对象列表;
第一判断模块: 用于判断所述界面模块是否存在控件标识文件; 第一处理模块, 用于当所述第一判断模块判断的结果为是, 则将所 述界面模块的控件标识文件导入所述控件对象列表;
第二处理模块, 用于当所述第一判断模块判断的结果为否, 则生成 所述界面模块的控件的控件标识, 得到控件标识文件, 将得到的控件标 识文件导入到生成的控件对象列表;
输出模块, 用于将所述第一处理模块或所述第二处理模块得到的导 入了控件标识文件的控件对象列表, 输出到对象库文件。
本发明实施例提供的技术方案的有益效果是:
针对目前广泛应用的 IM软件, 实现了自动将 IM控件转化为对象库 文件, 方便了需要控制 IM控件的研发人员使用各种 IM控件, 降低了使 用的操作复杂度, 减少了操作耗费的时间。 附图简要说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将 对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见 地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技 术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获 得其他的附图。
图 1是本发明生成控件对象库的方法实施例的流程示意图; 图 2是本发明生成控件对象库的方法实施例的详细流程示意图; 图 3是本发明生成控件对象库的装置实施例的结构示意图; 图 4是本发明生成控件对象库的装置实施例的详细结构示意图。 实施本发明的方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案 进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实 施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术 人员在没有作出创造性劳动前提下所获得的所有其他实施例, 都属于本 发明保护的范围。 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对 本发明实施方式作进一步地详细描述。
针对目前广泛应用的 IM软件, 为了实现自动将 IM控件转化为对象 库文件, 方便需要控制 IM控件的研发人员使用各种 IM控件, 降低使用 的操作复杂度, 减少操作耗费的时间, 本发明实施例提供了生成控件对 象库的方法, 参加图 1该方法内容如下:
步骤 S1:读取界面模块的皮肤文件, 根据界面模块的层次关系配置 文件, 生成界面模块的控件对象列表。
其中的皮肤文件存储了皮肤由哪些界面模块组成以及这些界面模 块之间的层次关系。 本步骤通过读取皮肤文件, 可以获取构成皮肤的界 面模块的列表和模块之间的层次关系。
步骤 S2:判断界面模块是否存在控件标识文件, 如果是, 则将界面 模块的控件标识文件导入控件对象列表, 执行步骤 S3; 否则, 生成界面 模块的控件的控件标识, 得到控件标识文件, 将得到的控件标识文件导 入到生成的控件对象列表, 执行步骤 S3;
其中的控件对象列表是构成一个界面模块的所有控件的列表。 其中的控件标识文件是存储控件的句柄的文件, 对于每个控件, 釆 用该控件的标识作为句柄, 其中控件的标识即相当于为该控件取的别 名。
另夕卜, 对于包含子项的控件, 还可以设置相应的控件 i tem文件, 该控件 i tem中存储有该控件包含的子项的列表。
步骤 S3:将步骤 S2得到的导入了控件标识文件的控件对象列表,输 出到对象库文件。
进一步地, 步骤 S3还包括: 对得到的导入了控件标识文件的控件 对象列表进行国际化处理。
其中, 上述对得到的导入了控件标识文件的控件对象列表进行国际 化处理, 包括:
读取界面模块的国际化资源, 根据读取的国际化资源, 生成国际化 字典; 才艮据生成的国际化字典, 对得到的导入了控件标识文件的控件对象 列表进行国际化处理。
进一步地, 步骤 S1之前, 还包括:
读取对象库中预设的对象分类配置文件, 根据读取的对象分类配置 文件, 对控件进行分类, 生成控件字典、 窗口列表以及容器列表; 相应地, 步骤 S1包括:
读取界面模块的皮肤文件, 根据界面模块的层次关系配置文件, 获 取界面模块中的控件和控件的子控件的对应关系;
并获取每个控件的控件名称、 文字描述标识、 控件类型名称和控件 标识;
根据每个控件的文字描述标识, 在国际化字典中查找对应的文字描 述, 生成界面模块的控件对象列表。
进一步地, 步骤 S2之后, 还包括:
判断界面模块是否存在控件 I tem文件, 如果是, 将控件 I tem文件 导入上述导入了控件标识文件的控件对象列表。
实施例 1
本发明实施例提供了一种生成控件对象库的方法, 为了便于说明, 本实施例以在 IM领域, 常用的面向对象的解释性的计算机程序设计语 言 Python实现本发明实施例提供的方法为例进行说明, 参见图 2 , 该方 法内容如下:
101: 读取对象库中预先设定的对象分类配置文件, 根据读取的对 象分类配置文件, 生成控件字典、 窗口列表以及容器列表。
为了实现本发明实施例所提供的方法, 将 IM控件按照其属性的不 同, 划分为三类: 控件对象类、 窗口类以及容器类; 其中,
所谓控件对象类, 是指完成使用 IM控件的用户 (通常为 IM软件的 研发人员)可见功能的实体控件, 例如 : 按钮 But ton, TabBut ton、 Co匪 boBox等都属于控件对象类的 IM控件。 将该类控件的名称、他们对 应的 Python对象名称存储在 Python的字典结构中,形成控件字典。 所谓窗口类, 是指 IM 控件中各类窗口控件, 例如: Windows ,
IGFFloa t ingWnd, PopupWindow等, 将该类控件的名称存储在 Python的 列表结构中, 形成窗口列表。
所谓容器类, 是指在 IM控件中, 用于组织层次结构, 排布的控件 列表; 例如 Frame , TabCtr l , IGFToolbar 等, 将该类控件的名称存储 在 Python 的列表结构中, 形成容器列表。
相应地, 对 IM控件进行上述三类划分时, 所依据的分类法则, 可 以被写在某个特定的文件中, 为了便于描述, 将该被写入了分类法则的 文件定义为对象分类配置文件。
102: 预先生成 IM界面模块的层次关系配置文件、 条目 I tem文件。 其中, 为了更方便、 灵活地生成对象库中的对象, 发明人对这些对 象进行了一系列的配置, 其中, 配置文件主要包括以下内容:
1、 层级关系: 一个窗口往往有可能有多个 XML 文件描述而成。 例 如一个设置中心窗口, 有多个 TabBut ton, 每个 TabBut ton有艮多子控 件,这些控件的父子关系称之为控件层级,而每个子控件又对应一个 XML 文件进行描述, 这些子控件和描述它们的 XML文件的映射关系称之为文 件层级, 这些层级关系在本发明实施例是以配置文件形式体现,可称为 层次关系配置文件。
2、 自定义控件: IM软件界面上有些控件在皮肤文件中没有定义, 需要定义这些控件的属性并指定层级关系;例如:针对动态生成的控件, 就需要定义该控件的属性并指定其层级关系。
3、 属性强制设置: 皮肤文件中有些控件的属性与最终软件展现的 属性并不一致, 可以通过属性强制设置技术将控件的一个或多个属性重 新指定; 例如, 强制修改 but ton上的文字。
103: 读取 IM界面模块的国际化资源, 根据读取的国际化资源, 生 成国际化字典。
其中, IM的皮肤文件中很多 IM控件都有自身的文字描述, 由于国 际化、 通用化的需求, 在不同的语言环境下需要对应不同语言版本的文 字描述。 例如: 简体中文版本中, 登录按钮上所显示的 "登录" 二字, 在英文版中则显示是 "Log in" , 而在繁体中文版中则显示是 "登入"。 这些国际化资源是以 XML文件进行描述的, 为了访问这些国际化信息, 读取这些信息, 并生成 Python的字典格式, 从而形成国际化字典。
104: 读取 IM界面模块的皮肤文件, 并根据 IM界面模块的层次关 系配置文件, 生成该 IM界面模块的控件对象列表。
由于 Python语言具有多维数组等独特的数据结构, 因此用 Python 语言生成控件对象比较方便, 当然, 也可以用其他脚本语言生成控件对 其中, 本实施例以釆用 Python语言生成控件对象为例进行说明: 构建一个 Python对象, 令该 Python对象和 IM界面模块皮肤文件 中的控件对应起来, 在 Python对象中提供一些方法, 用于访问皮肤控 件的某些属性。 其中, 一个控件对象至少包括以下成员: 子对象, 对象 名称, 文字描述 ID, 该 ID的国际化字符串, 名称 (类型), 对象 ID。
其中, 对象成员的生成方法:
104A:通过窗口对应的配置文件中对象和子对象的层级关系找出它 的子对象列表(每个子对象也可以有子对象以及其他各种成员);
104B:通过读取窗口的皮肤文件读取对象的对象名称, 文字描述的 字符串 ID, 名称(类型), 对象 ID;
104C:根据文字描述的字符串 I D在国际化字典中找出对应的文字描 述。
到此一个皮肤控件对应的 Python对象生成完毕。
同理可得, 可以生成各皮肤控件对应的 Python对象, 进而可以生 成 IM界面模块的控件对象列表。
105 : 判断 IM界面模块是否存在控件标识文件, 如果是, 则执行步 骤 107; 否则, 执行步骤 106。
其中, 所谓控件标识文件, 只指为了方便对象库的使用, 每个控件 都有一个在同一层级唯一的标识, (或在该对象库全局唯一的标识);
106 : 生成 IM界面模块的各控件的控件标识, 更新到上述步骤 104 生成的 IM界面模块的控件对象列表; 并输出生成的控件标识文件, 然 后执行步骤 108。
其中, 优选地, 对象库在第一次生成时如果控件有文字描述属性则 从国际化字典中读取中文简体作为该控件的标识, 否则, 如果没有文件 描述属性则以控件名称为基础生成标识; 第一次生成的对象库通过对象 库管理工具将标识修改成简短的便于标识的文本, 然后导出这些标识生 成与窗口配置文件名关联的标识文件, 其中, 该导出的控件标识文件称 为控件标识文件。
然后, 会将这些控件标识文件放到窗口配置文件同一个目录下, 后 续, 在对象库生成的时候会将该控件标识文件导入对象库。 从而, 保证 即使在国际化资源文件不断修改的情况下用户使用对象库时也不受影 响。
107 : 在上述步骤 104生成的 IM界面模块的控件对象列表中导入该 IM界面模块的控件标识文件, 然后执行步骤 108。
108 : 判断 IM界面模块是否存在控件 I tem文件, 如果是, 则执行 步骤 109; 否则, 执行步骤 110。
109 : 将 IM界面模块的控件 I tem文件导入 IM界面模块的控件对象 列表, 然后执行步骤 110。
110: 根据步骤 103生成国际化字典, 将 IM界面模块的控件对象列 表进行国际化处理。
其中, 执行该步骤 110的目的在于, 使得本发明实施例提供的方法 可以满足国际化、 通用化的需求。
111: 将上述执行了国际化处理后的 IM界面模块的控件对象列表, 输出到对象库文件。
综上所述, 本发明实施例提供的生成控件对象库的方法, 针对目前 广泛应用的 IM软件, 实现了自动将 IM控件转化为对象库文件, 方便了 需要控制 IM控件的研发人员使用各种 IM控件, 降低了使用的操作复杂 度, 减少了操作耗费的时间, 进一步地, 利用该方法生成的对象库具有 国际性、 通用性, 即通过标识导入导出技术屏蔽国际化资源变化对对象 库使用的影响。 实施例 2
参见图 3 , 本发明实施例提供了一种生成控件对象库的装置, 该所 述装置包括:
生成模块 301 , 用于读取界面模块的皮肤文件, 根据界面模块的层 次关系配置文件, 生成界面模块的控件对象列表;
第一判断模块 302: 用于判断界面模块是否存在控件标识文件; 第一处理模块 303 , 用于当第一判断模块 302判断的结果为是, 则 将界面模块的控件标识文件导入控件对象列表;
第二处理模块 304 , 用于当第一判断模块 302判断的结果为否, 则 生成界面模块的控件的控件标识, 得到控件标识文件, 将得到的控件标 识文件导入到生成的控件对象列表;
输出模块 305 , 用于将第一处理模块 303或第二处理模块 304得到 的导入了控件标识文件的控件对象列表, 输出到对象库文件。
进一步地, 为了实现该装置生成的对象库具有使用的国际性、 通用 性的目的, 保证即使在国际化资源文件不断修改的情况下用户使用对象 库时也不受影响, 本发明实施例提供的生成控件对象库的装置中的输出 模块 305还用于对第一处理模块 303或第二处理模块 304得到的导入了 控件标识文件的控件对象列表进行国际化处理。 参加图 4 , 为本发明实 施例提供的生成控件对象库的装置的详细示意图, 该装置还包括: 形成模块 306 , 用于读取界面模块的国际化资源, 根据读取的国际 化资源, 生成国际化字典;
相应地, 上述输出模块 305具体包括:
处理单元 3051 , 用于根据形成模块 306得到国际化字典, 对第一处 理模块 303或第二处理模块 304得到的导入了控件标识文件的控件对象 列表, 进行国际化处理;
输出单元 3052 , 用于将处理单元 3051进行了国际化处理的导入了 控件标识文件的控件对象列表, 输出到对象库文件。 进一步地, 本发明实施例提供的生成控件对象库的装置还包括; 分类模块, 用于读取对象库中预设的对象分类配置文件, 根据读取 的对象分类配置文件, 对控件进行分类, 生成控件字典、 窗口列表以及 答器歹1 J表;
相应地, 生成模块 301具体包括:
获取单元, 用于读取界面模块的皮肤文件, 根据界面模块的层次关 系配置文件, 获取界面模块中的控件和控件的子控件的对应关系; 并获 取每个控件的控件名称、 文字描述标识、 控件类型名称和控件标识; 生成单元, 用于根据获取单元获取的每个控件的文字描述标识, 在 形成模块形成的国际化字典中查找对应的文字描述, 生成界面模块的控 件对象列表。
进一步地, 装置还包括:
第二判断模块, 用于判断界面模块是否存在控件 I tem文件; 第四处理模块, 用于当第二判断模块的判断结果为是, 则将控件 I tern文件导入第一处理模块 303或第二处理模块 304得到的导入了控件 标识文件后的控件对象列表。
综上所述, 本发明实施例提供的生成控件对象库的装置, 针对目前 广泛应用的 IM软件, 实现了自动将 IM控件转化为对象库文件, 方便了 需要控制 IM控件的研发人员使用各种 IM控件, 降低了使用的操作复杂 度, 减少了操作耗费的时间; 进一步地, 利用该装置生成的对象库具有 国际性、 通用性。
本发明实施例提供的技术方案, 可以实现通过将皮肤文件中的控件 信息按照层级关系提取出来生成结构清晰的对象库、 通过方便的配置文 件实现皮肤文件中未定义控件的动态加入和控件属性的修改、 以及通过 标识导入导出技术屏蔽国际化资源变化对对象库使用的影响的功能, 并 且可以自动将 IM皮肤文件转化为对象库文件, 方便各类需要控制 IM界 面的用户。
本发明实施例中的 "接收" 一词可以理解为主动从其他模块获取也 可以是接收其他模块发送来的信息。 本领域技术人员可以理解附图只是一个优选实施例的示意图, 附图 中的模块或流程并不一定是实施本发明实施例所必须的。
本领域技术人员可以理解实施例中的装置中的模块可以按照实施 例描述分布于实施例的装置中, 也可以进行相应变化位于不同于本实施 例的一个或多个装置中。 上述实施例的模块可以合并为一个模块, 也可 以进一步拆分成多个子模块。
上述本发明实施例序号仅仅为了描述, 不代表实施例的优劣。 本发明实施例中的部分步骤, 可以利用软件实现, 相应的软件程序 可以存储在可读取的存储介质中, 如光盘或硬盘等。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本 发明的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包 含在本发明的保护范围之内。

Claims

权利要求书
1、 一种生成控件对象库的方法, 其特征在于, 所述方法包括:
A:读取界面模块的皮肤文件, 根据所述皮肤文件中的界面模块层次 关系配置文件, 生成所述界面模块的控件对象列表;
B:判断界面模块是否存在控件标识文件, 如果是, 则将所述界面模 块的控件标识文件导入所述控件对象列表, 执行步骤 C; 否则, 生成所 述界面模块的控件的控件标识, 得到控件标识文件, 将得到的控件标识 文件导入到生成的控件对象列表, 执行步骤 C;
C:将步骤 B得到的导入了控件标识文件的控件对象列表, 输出到对 象库文件。
2、 如权利要求 1所述的方法, 其特征在于, 所述步骤 C还包括: 对得到的导入了控件标识文件的控件对象列表进行国际化处理。
3、 如权利要求 2 所述的方法, 其特征在于, 所述对得到的导入了 控件标识文件的控件对象列表进行国际化处理, 包括:
读取界面模块的国际化资源, 根据读取的国际化资源, 生成国际化 字典;
才艮据生成的国际化字典, 对得到的导入了控件标识文件的控件对象 列表进行国际化处理。
4、 如权利要求 3所述的方法, 其特征在于, 所述步骤 A之前, 还 包括:
读取对象库中预设的对象分类配置文件, 根据读取的对象分类配置 文件, 对控件进行分类, 生成控件字典、 窗口列表以及容器列表; 相应地, 所述步骤 A包括:
读取界面模块的皮肤文件, 根据所述界面模块的层次关系配置文 件, 获取所述界面模块中的控件和所述控件的子控件的对应关系; 并获取每个控件的控件名称、 文字描述标识、 控件类型名称和控件 标识;
根据每个控件的文字描述标识, 在所述国际化字典中查找对应的文 字描述, 生成所述界面模块的控件对象列表。
5、 如权利要求 1所述的方法, 其特征在于, 所述步骤 B还包括: 判断所述界面模块是否存在控件 I tem文件, 如果是, 将所述控件
I tem文件导入所述导入了控件标识文件的控件对象列表;
所述控件 I tem文件中存储有相应控件包含的子项的列表。
6、 一种生成控件对象库的装置, 其特征在于, 所述装置包括: 生成模块, 用于读取界面模块的皮肤文件, 根据所述界面模块的层 次关系配置文件, 生成所述界面模块的控件对象列表;
第一判断模块: 用于判断所述界面模块是否存在控件标识文件; 第一处理模块, 用于当所述第一判断模块判断的结果为是, 则将所 述界面模块的控件标识文件导入所述控件对象列表;
第二处理模块, 用于当所述第一判断模块判断的结果为否, 则生成 所述界面模块的控件的控件标识, 得到控件标识文件, 将得到的控件标 识文件导入到生成的控件对象列表;
输出模块, 用于将所述第一处理模块或所述第二处理模块得到的导 入了控件标识文件的控件对象列表, 输出到对象库文件。
7、 如权利要求 6所述的装置, 其特征在于,
所述输出模块, 还用于对所述第一处理模块或所述第二处理模块得 到的导入了控件标识文件的控件对象列表进行国际化处理。
8、 如权利要求 7所述的装置, 其特征在于, 所述装置还包括: 形成模块, 用于读取界面模块的国际化资源, 根据读取的国际化资 源, 生成国际化字典;
相应地, 所述输出模块, 具体包括:
处理单元, 用于根据所述形成模块得到的国际化字典, 对所述第一 处理模块或所述第二处理模块得到的导入了控件标识文件的控件对象 列表, 进行国际化处理;
输出单元, 用于将所述处理单元进行了国际化处理的导入了控件标 识文件的控件对象列表, 输出到对象库文件。
9、 如权利要求 7所述的装置, 其特征在于, 所述装置还包括; 分类模块, 用于读取对象库中预设的对象分类配置文件, 根据读取 的对象分类配置文件, 对控件进行分类, 生成控件字典、 窗口列表以及 答器歹1 J表;
相应地, 所述生成模块具体包括:
获取单元, 用于读取界面模块的皮肤文件, 根据所述界面模块的层 次关系配置文件, 获取所述界面模块中的控件和所述控件的子控件的对 应关系; 并获取每个控件的控件名称、 文字描述标识、 控件类型名称和 控件标识;
生成单元, 用于根据所述获取单元获取的每个控件的文字描述的标 识, 在所述形成模块形成的国际化字典中查找对应的文字描述, 生成所 述界面模块的控件对象列表。
10、 如权利要求 6所述的装置, 其特征在于, 所述装置还包括: 第二判断模块, 用于判断所述界面模块是否存在控件 I tem文件; 第四处理模块, 用于当所述第二判断模块的判断结果为是时, 则将 所述控件 I tem文件导入所述第一处理模块或所述第二处理模块得到的 导入了控件标识文件的控件对象列表。
PCT/CN2009/075033 2008-11-20 2009-11-19 一种生成控件对象库的方法和装置 WO2010057434A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2008103056569A CN101436133B (zh) 2008-11-20 2008-11-20 一种生成控件对象库的方法和装置
CN200810305656.9 2008-11-20

Publications (1)

Publication Number Publication Date
WO2010057434A1 true WO2010057434A1 (zh) 2010-05-27

Family

ID=40710582

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/075033 WO2010057434A1 (zh) 2008-11-20 2009-11-19 一种生成控件对象库的方法和装置

Country Status (2)

Country Link
CN (1) CN101436133B (zh)
WO (1) WO2010057434A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162735A (zh) * 2020-10-28 2021-01-01 北京三快在线科技有限公司 控件标识生成方法、装置、计算机设备及存储介质
WO2023103917A1 (zh) * 2021-12-09 2023-06-15 杭州逗酷软件科技有限公司 语音控制方法、装置、电子设备及存储介质

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436133B (zh) * 2008-11-20 2012-11-21 腾讯科技(深圳)有限公司 一种生成控件对象库的方法和装置
CN102004633B (zh) * 2009-09-03 2013-04-24 阿里巴巴集团控股有限公司 一种处理控件属性的方法及装置
CN102103491B (zh) * 2009-12-18 2013-11-06 Tcl集团股份有限公司 一种界面生成系统以及方法
CN101894018A (zh) * 2010-05-31 2010-11-24 浪潮(北京)电子信息产业有限公司 一种维护控件状态信息的方法及装置
CN101887389A (zh) * 2010-06-03 2010-11-17 南京班墨自动化技术有限公司 一种基于二元结构的脚本生成方法
CN103176802B (zh) * 2013-03-29 2016-05-11 厦门亿联网络技术股份有限公司 通过控件池实现系统的用户界面ui与控件库分离的方法
CN104462137A (zh) * 2013-09-22 2015-03-25 北大方正集团有限公司 互动对象的创建方法及装置
CN103823682B (zh) * 2014-02-26 2017-08-08 广州视源电子科技股份有限公司 一种动态ui控件生成方法以及装置
CN105578284B (zh) * 2015-12-24 2019-01-08 四川迪佳通电子有限公司 一种机顶盒接口管理方法及系统
CN108984237A (zh) * 2017-05-31 2018-12-11 武汉斗鱼网络科技有限公司 一种控件呈现方法、存储介质、设备及系统
CN108563477B (zh) * 2018-03-02 2022-04-26 北京奇艺世纪科技有限公司 一种页面事件响应方法和装置
CN110888573A (zh) * 2019-11-08 2020-03-17 爱钱进(北京)信息科技有限公司 对控件进行标识的方法、装置以及存储介质
CN110990010B (zh) * 2019-12-03 2023-08-25 锐捷网络股份有限公司 一种软件界面代码的生成方法及装置
CN111209000B (zh) * 2020-01-08 2024-01-26 网易(杭州)网络有限公司 自定义控件的处理方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577263A (zh) * 2003-06-26 2005-02-09 华为技术有限公司 支持多语言的用户界面实现方法及其装置
CN101192143A (zh) * 2006-12-01 2008-06-04 上海亚伦科技有限公司 一种软件界面的构造方法
CN101436133A (zh) * 2008-11-20 2009-05-20 腾讯科技(深圳)有限公司 一种生成控件对象库的方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5761510A (en) * 1995-11-07 1998-06-02 Microsoft Corporation Method for error identification in a program interface
CN1304945C (zh) * 2004-06-02 2007-03-14 中兴通讯股份有限公司 一种电信设备配置界面自动生成方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577263A (zh) * 2003-06-26 2005-02-09 华为技术有限公司 支持多语言的用户界面实现方法及其装置
CN101192143A (zh) * 2006-12-01 2008-06-04 上海亚伦科技有限公司 一种软件界面的构造方法
CN101436133A (zh) * 2008-11-20 2009-05-20 腾讯科技(深圳)有限公司 一种生成控件对象库的方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162735A (zh) * 2020-10-28 2021-01-01 北京三快在线科技有限公司 控件标识生成方法、装置、计算机设备及存储介质
WO2023103917A1 (zh) * 2021-12-09 2023-06-15 杭州逗酷软件科技有限公司 语音控制方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN101436133A (zh) 2009-05-20
CN101436133B (zh) 2012-11-21

Similar Documents

Publication Publication Date Title
WO2010057434A1 (zh) 一种生成控件对象库的方法和装置
US10540383B2 (en) Automatic ontology generation
US8972872B2 (en) Building computing applications based upon metadata
CN101373431B (zh) 增强型小组件合成平台
US10606957B1 (en) Method and system for translating natural language policy to logical access control policy
US20120131556A1 (en) Xpath-based selection assistance of gui elements during manual test script authoring for xml-based applications
CN106104518A (zh) 用于按照示例的数据提取的框架
JP2007531157A (ja) 基幹業務アプリケーション統合のためのアダプタフレームワーク
EP3296866B1 (en) Method implemented by a computer that presents software-type applications based on design specifications
US20070168379A1 (en) Method and apparatus for cataloging screen shots of a program
CN110825364B (zh) 一种基于树形结构的应用模板配置方法
US11256743B2 (en) Intermixing literal text and formulas in workflow steps
CN110297636A (zh) 一种基于页面配置文件的页面自动生成和参数管理方法、系统和装置
CN108345691B (zh) 数据源通用处理框架构建方法、数据源处理方法及装置
CN117057318A (zh) 领域模型生成方法、装置、设备以及存储介质
US10275462B2 (en) Automatic translation of string collections
CN112582073B (zh) 医疗信息获取方法、装置、电子设备和介质
US9082104B2 (en) Method and apparatus for managing system specifications
JP2006244283A (ja) データベース管理装置およびデータベース管理方法
CN114153547B (zh) 管理页面显示方法及装置
WO2019144852A1 (zh) 一种新型计算机编程语言
CN112631585B (zh) 基于xml的快速参数界面配置方法
CN114391151A (zh) 增强自然语言生成平台
CN111104118A (zh) 一种基于aiml的自然语言指令执行方法及系统
Ratiu et al. Towards a repository of common programming technologies knowledge

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09827183

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 3430/CHENP/2011

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.10.11)

122 Ep: pct application non-entry in european phase

Ref document number: 09827183

Country of ref document: EP

Kind code of ref document: A1