CN110806873B - Target control determining method and device, electronic equipment and storage medium - Google Patents

Target control determining method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110806873B
CN110806873B CN201911055435.5A CN201911055435A CN110806873B CN 110806873 B CN110806873 B CN 110806873B CN 201911055435 A CN201911055435 A CN 201911055435A CN 110806873 B CN110806873 B CN 110806873B
Authority
CN
China
Prior art keywords
layout
control
target
custom
target control
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911055435.5A
Other languages
Chinese (zh)
Other versions
CN110806873A (en
Inventor
熊珊珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rajax Network Technology Co Ltd
Original Assignee
Rajax Network Technology Co Ltd
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 Rajax Network Technology Co Ltd filed Critical Rajax Network Technology Co Ltd
Priority to CN201911055435.5A priority Critical patent/CN110806873B/en
Publication of CN110806873A publication Critical patent/CN110806873A/en
Application granted granted Critical
Publication of CN110806873B publication Critical patent/CN110806873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure discloses a target control determining method, a target control determining device, electronic equipment and a storage medium. The method comprises the following steps: receiving a search request of a target control to be optimized; acquiring an identifier of a layout control in the search request; searching the subclasses of the layout control in a preset code range to obtain a custom layout combination control; obtaining a layout file of the custom layout combination control; determining the custom layout combination control as the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file; and outputting the information of the target control. According to the embodiment of the disclosure, the target control to be optimized can be automatically searched and found for the developed code, so that the code optimization efficiency is improved, the development cost is reduced, the manual dependence is reduced, and the integrity and the correctness of the result can be ensured.

Description

Target control determining method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a target control determining method, a target control determining device, electronic equipment and a storage medium.
Background
Along with the continuous iteration of the software development project, a large number of custom combination controls are used in the software development project so as to package the user interface layout of the same style, and the purposes of unification and multiplexing of the project component library are achieved. However, the inventor of the present disclosure found that, because personal programming styles are different, some developers are unaware of optimizing custom combination controls, so that many custom combination controls exist in a project with more than one layer of layout, and therefore, optimizing the custom combination controls for the whole software development project is a necessary task.
Disclosure of Invention
The embodiment of the disclosure provides a target control determining method, a target control determining device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a method for determining a target control.
Specifically, the target control determining method includes:
receiving a search request of a target control to be optimized;
acquiring an identifier of a layout control in the search request;
searching the subclasses of the layout control in a preset code range to obtain a custom layout combination control;
obtaining a layout file of the custom layout combination control;
Determining the custom layout combination control as the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file;
and outputting the information of the target control.
With reference to the first aspect, in a first implementation manner of the first aspect, before receiving a search request of a target control to be optimized, the present disclosure further includes:
responsive to detecting a right click event generated for a first layout control within the preset code range, displaying a right click menu list; wherein the right click menu list comprises target control searching options;
generating the search request in response to detecting a click event for the target control search option; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
With reference to the first aspect and/or the first implementation manner of the first aspect, in a second implementation manner of the first aspect, before receiving a search request of a target control to be optimized, the disclosure further includes:
generating a search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
With reference to the first aspect, the first implementation manner of the first aspect, and/or the second implementation manner of the first aspect, in a third implementation manner of the first aspect, the present disclosure outputs information of the target control, including:
displaying the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
With reference to the first aspect, the first implementation manner of the first aspect, the second implementation manner of the first aspect, and/or the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the disclosure further includes:
receiving a click request for the layout file in the tree structure;
and opening the layout file. In a second aspect, an embodiment of the disclosure provides a target control determining apparatus.
Specifically, the target control determining device includes:
the first receiving module is configured to receive a search request of a target control to be optimized;
the first acquisition module is configured to acquire the identification of the layout control in the search request;
The searching module is configured to search the subclasses of the layout control in a preset code range to obtain a custom layout combination control;
the second acquisition module is configured to acquire a layout file of the custom layout combination control;
the first determining module is configured to determine the custom layout combination control as the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file;
and the output module is configured to output the information of the target control.
With reference to the second aspect, in a first implementation manner of the second aspect, before the first receiving module, the present disclosure further includes:
a display module configured to display a right click menu list in response to detecting a right click event generated for a first layout control within the preset code range; wherein the right click menu list comprises target control searching options;
a first generation module configured to generate the search request in response to detecting a click event for the target control search option; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
With reference to the second aspect and/or the first implementation manner of the second aspect, in a second implementation manner of the second aspect, before the first receiving module, the present disclosure further includes:
a second generation module configured to generate the search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
With reference to the second aspect, the first implementation manner of the second aspect, and/or the second implementation manner of the second aspect, in a third implementation manner of the second aspect, the output module includes:
the display sub-module is configured to display the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
With reference to the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, and/or the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect, the disclosure further includes:
The second receiving module is configured to receive a click request of the layout file in the tree structure;
and an opening module configured to open the layout file.
The functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
In one possible design, the architecture of the target control determining apparatus includes a memory for storing one or more computer instructions for supporting the target control determining apparatus to perform the target control determining method of the first aspect, and a processor configured to execute the computer instructions stored in the memory. The target control determining apparatus may further comprise a communication interface for the target control determining apparatus to communicate with other devices or a communication network. In a third aspect, embodiments of the present disclosure provide an electronic device comprising a memory and a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement any of the methods described above.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium storing computer instructions for use by a target control determining device, comprising computer instructions for performing any of the methods described above.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
aiming at the code of a software development project, after a search request of a target control is received, the identifier of a layout space in the search request is obtained, the custom layout combination control subclass of the father class of the requested layout control is searched in a preset code range, the custom layout combination control is obtained, the layout file of the custom layout combination control is obtained, the custom layout combination control subclass is determined to be the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file, and then information of the target control is output. According to the embodiment of the disclosure, the target control to be optimized can be automatically searched and found for the developed code, so that the code optimization efficiency is improved, the development cost is reduced, the manual dependence is reduced, and the integrity and the correctness of the result can be ensured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 illustrates a flow chart of a method of targeting controls according to an embodiment of the present disclosure;
FIG. 2 shows a flow chart of generating a lookup request portion prior to step S101 according to the embodiment shown in FIG. 1;
FIG. 3 illustrates a flow diagram of an operational portion for target control information according to an embodiment of the present disclosure;
FIG. 4 illustrates a result presentation schematic of finding a target control according to an embodiment of the present disclosure;
FIG. 5 shows a block diagram of a target control determining apparatus according to an embodiment of the present disclosure;
FIG. 6 shows a block diagram of the structure of a portion of a search request generated prior to a first receiving module 501 according to the embodiment shown in FIG. 5;
FIG. 7 illustrates a block diagram of the operational portion for target control information according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram of an electronic device suitable for use in implementing a method of targeting controls in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, portions irrelevant to description of the exemplary embodiments are omitted in the drawings.
In this disclosure, it should be understood that terms such as "comprises" or "comprising," etc., are intended to indicate the presence of features, numbers, steps, acts, components, portions, or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, acts, components, portions, or combinations thereof are present or added.
In addition, it should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates a flow chart of a method of determining a target control according to an embodiment of the present disclosure. As shown in fig. 1, the target control determining method includes the following steps:
in step S101, a search request of a target control to be optimized is received;
in step S102, an identifier of a layout control in the search request is obtained;
in step S103, searching for a subclass of the layout control in a preset code range to obtain a custom layout combination control;
in step S104, a layout file of the custom layout combination control is obtained;
in step S105, in response to the preset label not being used in the root layout of the layout file, determining that the custom layout combination control is the target control to be optimized;
In step S106, information of the target control is output.
In this embodiment, the custom layout combination control is an independent control encapsulated by a software developer by extracting the same or similar layout, for example, the area of the login page where the user name input box, the password input box and the login button are displayed can be extracted separately to form a custom layout combination control. When the user-defined layout combination control is needed again, the user-defined layout combination control can be added into a layout file for multiplexing, and in this way, the development efficiency can be improved, and the development cost can be reduced. Custom layout composition controls may be sub-categories of layout controls. The layout control can be a layout control of a software development system, and can also be a layout parent control customized by a software developer of a software development project. For example, common layout controls that Android systems carry include the following four types: linear layout, relative layout, frame layout, constraint layout.
The software developer can also customize the corresponding layout file aiming at the customized layout combination control, the layout file can be an xml layout file, and the customized layout combination control can be displayed according to the content in the layout file when the page is loaded.
The user interface typically includes multiple view levels, and since the layout file of the custom layout composition control is custom by a software developer, some useless parent node views are inevitably artificially introduced into the layout file, and the parent nodes increase the layout levels, for example, the custom FrameLayout composition control, and the xml file parent node is FrameLayout, the < merge > tag can be used to replace the root node < FrameLayout >, so that when the layout is finally loaded and analyzed, the child view under the < merge > tag is directly added into the custom FrameLayout control, thereby reducing the analysis and loading of useless < FrameLayout > nodes, reducing one-layer layout and reducing the layout analysis time.
The search request of the target control to be optimized can carry the identifier of the layout control to be aimed at currently, and after the identifier of the layout control in the search request is obtained, the custom layout combination control with the parent class as the layout control can be searched in the preset code range.
A software developer may generate a layout file for a custom layout composition control. When the searched parent class is a custom combination control of the layout control carried by the search request, further judging whether the custom combination control corresponds to a layout file, if so, checking whether a preset label is used in the root layout in the layout file, and if so, not introducing a useless view level in the custom layout combination control, and not needing to be optimized; if the preset label is not used in the root layout of the layout file, it can be determined that the custom layout combination control may introduce an useless view level, so that the custom layout combination control is a target control to be optimized.
In some embodiments, the preset tab may be a merge tab for merging two layouts to reduce one view level when one layout contains the other layout. In the Android system, the preset label may be a merge label.
Therefore, by using the embodiment of the disclosure, the target control to be optimized, namely the target control with useless view level, can be found from the code of the software development project. The preset code range may be all codes corresponding to the whole software development project, or may be part of codes corresponding to the software development project, which may be specific according to actual situations, and is not limited herein. The embodiment of the disclosure searches for a custom layout combination control (because the custom combination control of a developer is usually used for introducing a useless view level) aiming at part or all codes in a software development project, and determines whether the custom layout combination control is a target control to be optimized or not according to a layout file of the custom layout combination control, namely, determines whether the useless view level exists in the layout of the custom layout combination control.
If a developer defines a layout file for a custom layout composition control and introduces a useless view level in the layout file, the custom layout composition control may be determined to be the target control to be optimized.
After the target control to be optimized is found, information of the target control can be output. The information of the target controls includes, but is not limited to, the number of target controls to be optimized, the names of the target controls, layout files corresponding to the target controls, and/or prompt information how to perform optimization, etc. The prompt information of how to perform the optimization can be, for example, prompt the related personnel to use preset labels in the layout file of the target control. Aiming at the code of a software development project, after a search request of a target control is received, the identifier of a layout space in the search request is obtained, the custom layout combination control subclass of the father class of the requested layout control is searched in a preset code range, the custom layout combination control is obtained, the layout file of the custom layout combination control is obtained, the custom layout combination control subclass is determined to be the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file, and then information of the target control is output. According to the embodiment of the disclosure, the target control to be optimized can be automatically searched and found for the developed code, so that the code optimization efficiency is improved, the development cost is reduced, the manual dependence is reduced, and the integrity and the correctness of the result can be ensured.
In an alternative implementation manner of this embodiment, as shown in fig. 2, before the step S101, that is, the step of receiving the search request of the target control to be optimized, the method further includes the following steps:
in step S201, in response to detecting a right click event generated for a first layout control within the preset code range, a right click menu list is presented; wherein the right click menu list comprises target control searching options;
in step S202, in response to detecting a click event for the target control find option, generating the find request; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
In the optional implementation manner, when the software development project needs to be subjected to layout optimization, the custom layout combination control with the parent class as the layout control can be searched in the range of the preset code, because the custom layout combination control is usually a layout control carried by a system or a subclass of the custom layout parent control, the custom layout combination control can be searched for one or more layout controls in the range of the preset code, and all the custom layout combination controls with the parent class as the layout control can be found.
The related personnel can directly click the first layout control in the code within the preset code range by right-clicking, so as to click the target control searching option in the displayed right-clicking menu list; when the system detects a right click event on a first layout control in codes in a preset code range, a right click menu list comprising target control searching options can be displayed, and further after detecting the click event aiming at the target control searching options, a searching request of the target control to be optimized can be generated, wherein the searching request can comprise an identification of the first layout control so as to trigger a flow of automatically searching a custom layout combination control with a parent class being the first layout control in the preset code range. In this way, a target control whose subclass is a custom layout combination control can be found for one of the layout controls.
In an optional implementation manner of this embodiment, before the step S101, that is, the step of receiving a search request of a target control to be optimized, the method further includes the following steps:
generating a search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
In the optional implementation manner, a target control searching option can be set in a window menu bar for displaying the software development project code, and after clicking the target control searching option in the window menu bar, related personnel can automatically trigger a process of searching at least one second layout control customized by a parent class for a user or at least one customized layout combination control of a third layout control defaulted by a system. The second layout control may be one or more layout controls customized by related personnel, the third layout control may be one or more layout controls default by the system, for example, after clicking on a target control to search an option, related personnel may automatically pop up a window for configuring the second layout control to be searched, selectable options of layout controls carried by all systems may be displayed in the window, and the window may further include an option capable of inputting a custom layout parent control by themselves. After the related personnel configures the second layout control to be searched through the pop-up window, the process of automatically searching the custom layout combination control with the parent class as the second layout control can be triggered by clicking a button such as 'ok'. And if the user does not configure the second layout control, a search may be made for a third layout control that is default to the system. In this way, target controls whose subclasses are custom layout combination controls can be found for one or more of the layout controls.
In an optional implementation manner of this embodiment, the step of outputting information of the target control includes:
displaying the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
In this alternative implementation, the information of the target control may be presented in a tree structure. The root node of the tree structure may include the number of target controls to be optimized, the leaf node may include a layout file of the target controls to be optimized, the intermediate node may include information such as the target controls and parent classes of the target controls, the target controls and parent classes of the target controls are displayed in a hierarchical structure in the tree structure, that is, the parent class is a node of a previous layer of the target controls, and the target controls are nodes of a next layer of the parent classes.
In an alternative implementation of this embodiment, as shown in fig. 3, the method further includes the following steps:
in step S301, a click request for the layout file in the tree structure is received;
In step S302, the layout file is opened.
In the alternative implementation manner, related personnel can open the layout file of the target control to be optimized by clicking the layout file displayed in the tree structure, and further directly modify the layout file so as to optimize the layout of the software development project.
FIG. 4 illustrates a result presentation schematic of finding a target control according to an embodiment of the present disclosure. As shown in fig. 4, after the related personnel performs right click on the parent class layout control of the Ralativelayout in the code, a right click menu list is displayed on the interface, a target control searching option (Find UI optimization) is included below the menu list, and after the target control searching option is clicked, a tree structure including target control information is displayed below the interface. The uppermost layer of the tree structure shows the aimed parent layout control Ralativelayout, and also shows that the data of the searched target control to be optimized is 3, the 3 target controls are OpenshoptipOverLayView, naposActionBar and SettingerpView respectively, and the corresponding layout files are shown below the three target controls; wherein, the OpenshoptipOverLayView and SettingTopView upper layers also show their parent classes.
The following are device embodiments of the present disclosure that may be used to perform method embodiments of the present disclosure.
Fig. 5 shows a block diagram of a target control determining apparatus according to an embodiment of the present disclosure, which may be implemented as part or all of an electronic device by software, hardware, or a combination of both. As shown in fig. 5, the target control determining apparatus includes:
a first receiving module 501 configured to receive a search request of a target control to be optimized;
a first obtaining module 502 configured to obtain an identifier of a layout control in the search request;
the searching module 503 is configured to search the subclasses of the layout control in a preset code range to obtain a custom layout combination control;
a second obtaining module 504, configured to obtain a layout file of the custom layout combination control;
a determining module 505, configured to determine, in response to a preset label not being used in the root layout of the layout file, the custom layout combination control as the target control to be optimized;
and an output module 506 configured to output information of the target control.
In this embodiment, the custom layout combination control is an independent control encapsulated by a software developer by extracting the same or similar layout, for example, the area of the login page where the user name input box, the password input box and the login button are displayed can be extracted separately to form a custom layout combination control. When the user-defined layout combination control is needed again, the user-defined layout combination control can be added into a layout file for multiplexing, and in this way, the development efficiency can be improved, and the development cost can be reduced. Custom layout composition controls may be sub-categories of layout controls. The layout control can be a layout control of a software development system, and can also be a layout parent control customized by a software developer of a software development project. For example, common layout controls that Android systems carry include the following four types: linear layout, relative layout, frame layout, constraint layout.
The software developer can also customize the corresponding layout file aiming at the customized layout combination control, the layout file can be an xml layout file, and the customized layout combination control can be displayed according to the content in the layout file when the page is loaded.
The user interface typically includes multiple view levels, and since the layout file of the custom layout composition control is custom by a software developer, some useless parent node views are inevitably artificially introduced into the layout file, and the parent nodes increase the layout levels, for example, the custom FrameLayout composition control, and the xml file parent node is FrameLayout, the < merge > tag can be used to replace the root node < FrameLayout >, so that when the layout is finally loaded and analyzed, the child view under the < merge > tag is directly added into the custom FrameLayout control, thereby reducing the analysis and loading of useless < FrameLayout > nodes, reducing one-layer layout and reducing the layout analysis time.
The search request of the target control to be optimized can carry the identifier of the layout control to be aimed at currently, and after the identifier of the layout control in the search request is obtained, the custom layout combination control with the parent class as the layout control can be searched in the preset code range.
A software developer may generate a layout file for a custom layout composition control. When the searched parent class is a custom combination control of the layout control carried by the search request, further judging whether the custom combination control corresponds to a layout file, if so, checking whether a preset label is used in the root layout in the layout file, and if so, not introducing a useless view level in the custom layout combination control, and not needing to be optimized; if the preset label is not used in the root layout of the layout file, it can be determined that the custom layout combination control may introduce an useless view level, so that the custom layout combination control is a target control to be optimized.
In some embodiments, the preset tab may be a merge tab for merging two layouts to reduce one view level when one layout contains the other layout. In the Android system, the preset label may be a merge label.
Therefore, by using the embodiment of the disclosure, the target control to be optimized, namely the target control with useless view level, can be found from the code of the software development project. The preset code range may be all codes corresponding to the whole software development project, or may be part of codes corresponding to the software development project, which may be specific according to actual situations, and is not limited herein. The embodiment of the disclosure searches for a custom layout combination control (because the custom combination control of a developer is usually used for introducing a useless view level) aiming at part or all codes in a software development project, and determines whether the custom layout combination control is a target control to be optimized or not according to a layout file of the custom layout combination control, namely, determines whether the useless view level exists in the layout of the custom layout combination control.
If a developer defines a layout file for a custom layout composition control and introduces a useless view level in the layout file, the custom layout composition control may be determined to be the target control to be optimized.
After the target control to be optimized is found, information of the target control can be output. The information of the target controls includes, but is not limited to, the number of target controls to be optimized, the names of the target controls, layout files corresponding to the target controls, and/or prompt information how to perform optimization, etc. The prompt information of how to perform the optimization can be, for example, prompt the related personnel to use preset labels in the layout file of the target control. Aiming at the code of a software development project, after a search request of a target control is received, the identifier of a layout space in the search request is obtained, the custom layout combination control subclass of the father class of the requested layout control is searched in a preset code range, the custom layout combination control is obtained, the layout file of the custom layout combination control is obtained, the custom layout combination control subclass is determined to be the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file, and then information of the target control is output. According to the embodiment of the disclosure, the target control to be optimized can be automatically searched and found for the developed code, so that the code optimization efficiency is improved, the development cost is reduced, the manual dependence is reduced, and the integrity and the correctness of the result can be ensured.
In an alternative implementation manner of this embodiment, as shown in fig. 6, before the first receiving module 501, the method further includes:
a presentation module 601 configured to present a right click menu list in response to detecting a right click event generated for a first layout control within the preset code range; wherein the right click menu list comprises target control searching options;
a first generation module 602 configured to generate the search request in response to detecting a click event for the target control search option; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
In the optional implementation manner, when the software development project needs to be subjected to layout optimization, the custom layout combination control with the parent class as the layout control can be searched in the range of the preset code, because the custom layout combination control is usually a layout control carried by a system or a subclass of the custom layout parent control, the custom layout combination control can be searched for one or more layout controls in the range of the preset code, and all the custom layout combination controls with the parent class as the layout control can be found.
The related personnel can directly click the first layout control in the code within the preset code range by right-clicking, so as to click the target control searching option in the displayed right-clicking menu list; when the system detects a right click event on a first layout control in codes in a preset code range, a right click menu list comprising target control searching options can be displayed, and further after detecting the click event aiming at the target control searching options, a searching request of the target control to be optimized can be generated, wherein the searching request can comprise an identification of the first layout control so as to trigger a flow of automatically searching a custom layout combination control with a parent class being the first layout control in the preset code range. In this way, a target control whose subclass is a custom layout combination control can be found for one of the layout controls.
In an optional implementation manner of this embodiment, before the first receiving module 501, the method further includes:
a second generation module configured to generate the search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
In the optional implementation manner, a target control searching option can be set in a window menu bar for displaying the software development project code, and after clicking the target control searching option in the window menu bar, related personnel can automatically trigger a process of searching at least one second layout control customized by a parent class for a user or at least one customized layout combination control of a third layout control defaulted by a system. The second layout control may be one or more layout controls customized by related personnel, the third layout control may be one or more layout controls default by the system, for example, after clicking on a target control to search an option, related personnel may automatically pop up a window for configuring the second layout control to be searched, selectable options of layout controls carried by all systems may be displayed in the window, and the window may further include an option capable of inputting a custom layout parent control by themselves. After the related personnel configures the second layout control to be searched through the pop-up window, the process of automatically searching the custom layout combination control with the parent class as the second layout control can be triggered by clicking a button such as 'ok'. And if the user does not configure the second layout control, a search may be made for a third layout control that is default to the system. In this way, target controls whose subclasses are custom layout combination controls can be found for one or more of the layout controls.
In an alternative implementation of this embodiment, the output module 506 includes:
the display sub-module is configured to display the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
In this alternative implementation, the information of the target control may be presented in a tree structure. The root node of the tree structure may include the number of target controls to be optimized, the leaf node may include a layout file of the target controls to be optimized, the intermediate node may include information such as the target controls and parent classes of the target controls, the target controls and parent classes of the target controls are displayed in a hierarchical structure in the tree structure, that is, the parent class is a node of a previous layer of the target controls, and the target controls are nodes of a next layer of the parent classes.
In an alternative implementation of this embodiment, as shown in fig. 7, the apparatus further includes:
a second receiving module 701 configured to receive a click request for the layout file in the tree structure;
An opening module 702 is configured to open the layout file.
In the alternative implementation manner, related personnel can open the layout file of the target control to be optimized by clicking the layout file displayed in the tree structure, and further directly modify the layout file so as to optimize the layout of the software development project.
The disclosed embodiments also provide an electronic device, as shown in fig. 8, comprising at least one processor 801; and a memory 802 communicatively coupled to the at least one processor 801; wherein the memory 802 stores instructions executable by the at least one processor 801, the instructions being executable by the at least one processor 801 to implement:
receiving a search request of a target control to be optimized;
acquiring an identifier of a layout control in the search request;
searching the subclasses of the layout control in a preset code range to obtain a custom layout combination control;
obtaining a layout file of the custom layout combination control;
determining the custom layout combination control as the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file;
and outputting the information of the target control.
Before receiving the search request of the target control to be optimized, the method further comprises the following steps:
responsive to detecting a right click event generated for a first layout control within the preset code range, displaying a right click menu list; wherein the right click menu list comprises target control searching options;
generating the search request in response to detecting a click event for the target control search option; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
Before receiving the search request of the target control to be optimized, the method further comprises the following steps:
generating a search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
The outputting the information of the target control comprises the following steps:
displaying the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
Wherein, still include:
receiving a click request for the layout file in the tree structure;
and opening the layout file.
In particular, the processor 801, the memory 802 may be connected by a bus or otherwise, for example in fig. 8. Memory 802, as a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor 801 performs various functional applications of the device and data processing, i.e., implements the above-described methods in the embodiments of the present disclosure by running non-volatile software programs, instructions, and modules stored in the memory 802.
Memory 802 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store historical data of shipping network shipments, and the like. In addition, memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some implementations, the electronic device optionally includes a communication component 803, and the memory 802 optionally includes memory located remotely from the processor 801, which may be connected to an external device through the communication component 803. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 802 that, when executed by the one or more processors 801, perform the above-described methods in embodiments of the present disclosure.
The above product may perform the method provided by the embodiment of the present disclosure, and have corresponding functional modules and beneficial effects of the performing method, and technical details not described in detail in the embodiment of the present disclosure may be referred to the method provided by the embodiment of the present disclosure.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware. The units or modules described may also be provided in a processor, the names of which in some cases do not constitute a limitation of the unit or module itself.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a device. The computer-readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention referred to in this disclosure is not limited to the specific combination of features described above, but encompasses other embodiments in which any combination of features described above or their equivalents is contemplated without departing from the inventive concepts described. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).

Claims (12)

1. A method for determining a target control, comprising:
receiving a search request of a target control to be optimized;
acquiring an identifier of a layout control in the search request;
searching the subclasses of the layout control in a preset code range to obtain a custom layout combination control;
obtaining a layout file of the custom layout combination control;
determining that the custom layout combination control is the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file, wherein the preset label is used for indicating that no useless view level is introduced in the custom layout combination control;
and outputting the information of the target control.
2. The method of claim 1, further comprising, prior to receiving the search request for the target control to be optimized:
responsive to detecting a right click event generated for a first layout control within the preset code range, displaying a right click menu list; wherein the right click menu list comprises target control searching options;
generating the search request in response to detecting a click event for the target control search option; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
3. The method of claim 1, further comprising, prior to receiving the search request for the target control to be optimized:
generating a search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
4. A method according to any of claims 1-3, wherein outputting information of the target control comprises:
displaying the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
5. The method as recited in claim 4, further comprising:
receiving a click request for the layout file in the tree structure;
and opening the layout file.
6. A target control determining apparatus, comprising:
The first receiving module is configured to receive a search request of a target control to be optimized;
the first acquisition module is configured to acquire the identification of the layout control in the search request;
the searching module is configured to search the subclasses of the layout control in a preset code range to obtain a custom layout combination control;
the second acquisition module is configured to acquire a layout file of the custom layout combination control;
the first determining module is configured to determine that the custom layout combination control is the target control to be optimized in response to the fact that a preset label is not used in the root layout of the layout file, wherein the preset label is used for indicating that no useless view level is introduced in the custom layout combination control;
and the output module is configured to output the information of the target control.
7. The apparatus of claim 6, wherein prior to the first receiving module, further comprising:
a display module configured to display a right click menu list in response to detecting a right click event generated for a first layout control within the preset code range; wherein the right click menu list comprises target control searching options;
A first generation module configured to generate the search request in response to detecting a click event for the target control search option; the search request is used for requesting to search the custom combined layout control with the parent class as the first layout control.
8. The apparatus of claim 6, wherein prior to the first receiving module, further comprising:
a second generation module configured to generate the search request in response to detecting a click operation for a target control search option in a window menu bar; the search request is used for requesting to search the custom combined layout control of at least one second layout control or at least one default third layout control of which the parent class is custom by a user.
9. The apparatus of any of claims 6-8, wherein the output module comprises:
the display sub-module is configured to display the information of the target control in a tree structure; the root node of the tree structure comprises the number of the target controls to be optimized, the leaf node comprises the layout file of the target controls to be optimized, and the intermediate node comprises the target controls and parent classes of the target controls.
10. The apparatus as recited in claim 9, further comprising:
the second receiving module is configured to receive a click request of the layout file in the tree structure;
and an opening module configured to open the layout file.
11. An electronic device comprising a memory and at least one processor; wherein,,
the memory is for storing one or more computer instructions, wherein the one or more computer instructions are executable by the at least one processor to implement the method of any of claims 1-5.
12. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the method of any of claims 1-5.
CN201911055435.5A 2019-10-31 2019-10-31 Target control determining method and device, electronic equipment and storage medium Active CN110806873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911055435.5A CN110806873B (en) 2019-10-31 2019-10-31 Target control determining method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911055435.5A CN110806873B (en) 2019-10-31 2019-10-31 Target control determining method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110806873A CN110806873A (en) 2020-02-18
CN110806873B true CN110806873B (en) 2023-07-21

Family

ID=69489915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911055435.5A Active CN110806873B (en) 2019-10-31 2019-10-31 Target control determining method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110806873B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538486B (en) * 2020-04-01 2024-02-13 北京小米松果电子有限公司 Layout file nesting layer number screening method and device and electronic equipment
CN111580873B (en) * 2020-04-01 2023-11-07 北京小米松果电子有限公司 Page updating method and device, terminal and storage medium
CN112528594B (en) * 2020-12-16 2024-04-12 上海尚往网络科技有限公司 Control identification method and equipment
CN114997120B (en) * 2021-03-01 2023-09-26 北京字跳网络技术有限公司 Method, device, terminal and storage medium for generating document tag
CN115509665B (en) * 2022-09-29 2023-07-07 上海弘玑信息技术有限公司 Method, device, medium and equipment for recording control in window

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0105658D0 (en) * 2001-03-08 2001-04-25 Ibm Method computer program and system for style sheet generation
CN103399979A (en) * 2013-07-04 2013-11-20 电子科技大学 Board level circuit testing model automatic generation method
WO2017173914A1 (en) * 2016-04-07 2017-10-12 北京橙鑫数据科技有限公司 Method and device for changing information display interface
CN107566502A (en) * 2017-09-14 2018-01-09 奇酷互联网络科技(深圳)有限公司 Recover method, equipment, mobile terminal and the computer-readable storage medium of desktop
CN110134895A (en) * 2019-05-10 2019-08-16 拉扎斯网络科技(上海)有限公司 Page display method, device, electronic equipment and computer readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7428725B2 (en) * 2001-11-20 2008-09-23 Microsoft Corporation Inserting devices specific content
US10430180B2 (en) * 2010-05-26 2019-10-01 Automation Anywhere, Inc. System and method for resilient automation upgrade
US9015608B2 (en) * 2012-07-16 2015-04-21 Sap Se Regenerating a user interface area

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0105658D0 (en) * 2001-03-08 2001-04-25 Ibm Method computer program and system for style sheet generation
CN103399979A (en) * 2013-07-04 2013-11-20 电子科技大学 Board level circuit testing model automatic generation method
WO2017173914A1 (en) * 2016-04-07 2017-10-12 北京橙鑫数据科技有限公司 Method and device for changing information display interface
CN107566502A (en) * 2017-09-14 2018-01-09 奇酷互联网络科技(深圳)有限公司 Recover method, equipment, mobile terminal and the computer-readable storage medium of desktop
CN110134895A (en) * 2019-05-10 2019-08-16 拉扎斯网络科技(上海)有限公司 Page display method, device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Ajax的Web通用报表生成工具的设计;陈媛;徐传运;孙曙光;;重庆工学院学报(自然科学版)(第04期);全文 *

Also Published As

Publication number Publication date
CN110806873A (en) 2020-02-18

Similar Documents

Publication Publication Date Title
CN110806873B (en) Target control determining method and device, electronic equipment and storage medium
US11868231B2 (en) System and method for evaluating code by a hybrid of local and cloud-based computers
US9772929B2 (en) System and method for automated testing of software applications with dynamic user interfaces spanning multiple technologies
US20120137227A1 (en) Multi-environment widget assembly, generation, and operation
CN108347358A (en) The automatic test of cloud connection
US11667033B2 (en) Systems and methods for robotic process automation
US8352913B2 (en) Generating and resolving component names in an integrated development environment
US20080147675A1 (en) Application server with automatic and autonomic application configuration validation
US10031729B1 (en) Method and system for implementing custom UI actions in a web application using hidden containers
US20110246913A1 (en) Automated User Interface Generator
CN111563220A (en) Business website project construction method and device, computer equipment and storage medium
US20110022943A1 (en) Document object model (dom) application framework
US20180321831A1 (en) Smart controls for user interface design and implementation
US11741002B2 (en) Test automation systems and methods using logical identifiers
KR20180080535A (en) Apparatus and method for scrapping web data
US20210117313A1 (en) Language agnostic automation scripting tool
US9501298B2 (en) Remotely executing operations of an application using a schema that provides for executable scripts in a nodal hierarchy
US9678856B2 (en) Annotated test interfaces
CN115599386A (en) Code generation method, device, equipment and storage medium
US20240020350A1 (en) Method and system for navigation control
US10606569B2 (en) Declarative configuration elements
US11093220B2 (en) Generating interfaces from data and service definitions for developing applications
CN107077484B (en) Generating a web browser view of an application
US11977878B2 (en) System and method for managing software services in building customized software
AU2018313995B2 (en) Systems and methods for providing globalization features in a service management application interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant