Summary of the invention
Embodiment of the invention technical matters to be solved is, a kind of method and a kind of device of realizing single document control based on many documents framework of realizing single document control based on many documents framework is provided.Solve in the prior art and do not have the spendable problem of single document framework in the Cocoa framework in the apple systems programming environment.
In order to solve the problems of the technologies described above, the embodiment of the invention provides a kind of and has realized the method that single document is controlled based on many documents framework, comprising:
The interface that preset control single document is realized calls in system before carrying out newly-built or opening the operation of engineering document, detect current engineering state;
Do not edited and to have preserved when detecting current engineering state, after then current operational processes is accomplished, carried out the said newly-built or operation of opening engineering;
When detect that current engineering state has been preserved or editor preserve, then directly close current engineering state, carry out the said newly-built or operation of opening engineering.
Wherein, the step of the current engineering state of said detection comprises:
Whether detect current engineering edits;
When testing result for not the time, detect then that current engineering state has been preserved or editor preserve;
When the test results is yes, judge then whether current engineering preserves;
When judged result when being, then carry out the said current engineering state of directly closing, carry out said newly-built or open the step of the operation of engineering; When judged result for not the time, then detect current engineering state and do not edited and preserve.
Wherein, the step of the current engineering state of said detection comprises:
Whether detect current engineering preserves;
When the test results is yes, then carry out the said current engineering state of directly closing, carry out said newly-built or open the step of the operation of engineering;
When testing result for not the time, judge then whether current engineering has edited;
When judged result for not the time, then carry out the said current engineering state of directly closing, carry out said newly-built or open the step of the operation of engineering; When judged result when being, then detect current engineering state and do not edited and preserve.
Wherein, the step of the current engineering state of said detection comprises:
Judge whether current engineering exists corresponding engineered paths;
When judged result for not the time, then detect current engineering whether to have edited;
When the test results is yes, then detect current engineering state and do not edited preservation; When testing result for not the time, then detect current engineering state and do not edit and preserve.
Wherein, saidly judge that whether current engineering exists after the step of corresponding engineered paths, also comprises:
When judged result when being, then detect current engineering and whether preserve;
When the test results is yes, then carry out the said current engineering state of directly closing, carry out said newly-built or open the step of the operation of engineering;
When testing result for not the time, check whether current engineering has edited;
When check result when being, after then carrying out said current operational processes and accomplishing, carry out said newly-built or open the step of the operation of engineering; When check result for not the time, then carry out the said current engineering state of directly closing, carry out the said newly-built or operation of opening engineering.
Correspondingly, the embodiment of the invention also discloses a kind of device, comprising based on the control of many documents framework realization single document:
Call detection module, be used for system before carrying out newly-built or opening the operation of engineering document, call the interface that preset control single document is realized, detect current engineering state;
First detects processing module, is used for not edited and preserving when detecting current engineering state, after then current operational processes is accomplished, carries out the said newly-built or operation of opening engineering;
Second detects processing module, be used for when detect that current engineering state has been preserved or editor preserve, then directly close current engineering state, carry out the said newly-built or operation of opening engineering.
Wherein, the said detection module that calls comprises:
Whether first editor's detecting unit is used to detect current engineering and edits;
First editor detects processing unit, be used for when the testing result of said first editor's detecting unit for not the time, detect then that current engineering state has been preserved or editor preserve, trigger the said second detection processing module executable operations; When the testing result of said first editor's detecting unit when being, then trigger the first preservation judging unit executable operations;
First preserves judging unit, is used to judge whether current engineering preserves;
First preserves the judgment processing unit, be used for when said first preserve judging unit judged result when being, then trigger the said second detection processing module executable operations; When said first preserve judging unit judged result for not the time, then detect current engineering state and do not edited and preserve, trigger said first and detect the processing module executable operations.
Wherein, the said detection module that calls comprises:
First preserves detecting unit, is used to judge whether current engineering preserves;
First preserve to detect processing unit, be used for when said first preserve detecting unit judged result when being, then trigger the said second detection processing module executable operations; When said first preserve detecting unit judged result for not the time, then trigger first editor's judging unit executable operations;
First editor's judging unit is used to judge whether current engineering edits;
The first editor judgment processing unit, be used for when the judged result of said first editor's judging unit for not the time, trigger the said second detection processing module executable operations; When the judged result of said first editor's judging unit when being, then detect current engineering state and do not edited and preserve, trigger the said first detection processing module executable operations.
Wherein, the said detection module that calls comprises:
The engineered paths judging unit is used to judge whether current engineering exists corresponding engineered paths;
Engineered paths judgment processing unit, be used for when the judged result of said engineered paths judging unit for not the time, then trigger second editor's detecting unit executable operations;
Whether second editor's detecting unit is used to detect current engineering and edits;
Second editor detects processing unit, be used for when the testing result of said second editor's detecting unit when being, then detect current engineering state and do not edited preservation, trigger the said first detection processing module executable operations; When the testing result of said second editor's detecting unit for not the time, then detect current engineering state and do not edit and preserve, trigger said second and detect the processing module executable operations.
Wherein, the said detection module that calls also comprises:
Second preserves judging unit, be used for when the judged result of said engineered paths judging unit when being, judge whether current engineering preserves;
Second preserves the judgment processing unit, be used for when said second preserve judging unit judged result when being, then trigger the said second detection processing module executable operations; When said second preserve judging unit judged result for not the time, then trigger said second editor's detecting unit executable operations.
Embodiment of the present invention embodiment has following beneficial effect:
Through before carrying out newly-built or opening the operation of engineering document; Call the interface that preset control single document is realized; Detect current engineering state, directly close the current engineering state of not preserving of having preserved or edited, when perhaps not preserving for editing as if current engineering state; After waiting for that current operational processes is accomplished; Carry out the said newly-built or operation of opening engineering again, having solved does not have the spendable problem of single document framework in the Cocoa framework in the apple systems programming environment in the prior art, realized the single document framework functions of the Cocoa framework in the apple systems programming environment quickly and easily; Avoided realizing that brand-new single document framework needs great amount of time, and possibly bring the instability of application and the problem of system compatibility.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The schematic flow sheet that the present invention is based on first embodiment of many documents framework realization single document control method as shown in Figure 1 comprises:
Step S101: the interface that preset control single document is realized calls in system before carrying out newly-built or opening the operation of engineering document, detect current engineering state;
Particularly, system is provided with in advance and is used to control the interface that single document is realized, is used to detect current engineering state.
Step S102: do not edited and to preserve when detecting current engineering state, after then current operational processes is accomplished, carried out the said newly-built or operation of opening engineering;
Step S103: when detect that current engineering state has been preserved or editor preserve, then directly close current engineering state, carry out the said newly-built or operation of opening engineering.
Particularly, the engineering state in the embodiment of the invention comprises following 5 kinds:
Engineering state A: do not have engineered paths (newly-built), editor does not preserve;
Engineering state B: do not have engineered paths (newly-built), edit, do not preserve;
Engineering state C: engineered paths is arranged, and editor does not preserve;
Engineering state D: engineered paths is arranged, edit, do not preserve;
Engineering state E: engineered paths is arranged, edit, preserve.
Below, to Fig. 4,3 kinds of embodiments that detect current engineering state among the performing step S101 are described respectively in conjunction with Fig. 2.
Detect the schematic flow sheet of first embodiment of current engineering state among the step S101 of the present invention as shown in Figure 2, comprising:
Step S201: detect current engineering and whether edit;
Particularly, when testing result for not the time, execution in step S202 then, otherwise execution in step S203.
Step S202: detect that current engineering state has been preserved or editor preserve execution in step S103;
Step S203: judge whether current engineering preserves;
Particularly, when judged result when being, execution in step S204 then; Otherwise execution in step S205.
Step S204: execution in step S103 promptly carries out the said current engineering state of directly closing, and carries out said newly-built or open the step of the operation of engineering;
Step S205: detect current engineering state and do not edited preservation, execution in step S102.
Detect the schematic flow sheet of second embodiment of current engineering state among the step S101 of the present invention as shown in Figure 3, comprising:
Step S301: detect current engineering and whether preserve;
Particularly, when the test results is yes, execution in step S302 then, otherwise execution in step S303.
Step S302: execution in step S103 promptly carries out the said current engineering state of directly closing, and carries out said newly-built or open the step of the operation of engineering;
Step S303: judge whether current engineering edits;
Particularly, when judged result for not the time, execution in step S304 then, otherwise execution in step S305.
Step S304: execution in step S103 promptly carries out the said current engineering state of directly closing, and carries out said newly-built or open the step of the operation of engineering;
Step S305: detect current engineering state and do not edited preservation, execution in step S102.
Detect the schematic flow sheet of the 3rd embodiment of current engineering state among the step S101 of the present invention as shown in Figure 4, comprising:
Step S401: judge whether current engineering exists corresponding engineered paths;
Particularly, when judged result for not the time, execution in step S402 then, otherwise execution in step S403.
Step S402: detect current engineering and whether edit;
Particularly, when the test results is yes, execution in step S404 then, otherwise execution in step S405.
Step S403: detect current engineering and whether preserve;
Particularly, when the test results is yes, execution in step S406 then, otherwise execution in step S407;
Step S404: detect current engineering state and do not edited preservation, execution in step S102;
Step S405: detect current engineering state and do not edit preservation, execution in step S103;
Step S406: execution in step S103 promptly carries out the said current engineering state of directly closing, and carries out said newly-built or open the step of the operation of engineering;
Step S407: check whether current engineering edits;
Particularly, when check result when being, execution in step S408 then, otherwise execution in step S409.
Step S408: execution in step S102 after promptly carrying out said current operational processes and accomplishing, carries out said newly-built or open the step of the operation of engineering;
Step S409: execution in step S103 promptly carries out the said current engineering state of directly closing, and carries out said newly-built or open the step of the operation of engineering.
Through embodiment of the present invention embodiment; Solved and do not had the spendable problem of single document framework in the prior art in the Cocoa framework in the apple systems programming environment; Realized the single document framework functions of the Cocoa framework in the apple systems programming environment quickly and easily; Avoided realizing that brand-new single document framework needs great amount of time, and possibly bring the instability of application and the problem of system compatibility.
What specified the embodiment of the invention above realizes the method that single document is controlled based on many documents framework, and below accordingly, what specify the embodiment of the invention realizes the device that single document is controlled based on many documents framework.
The embodiment of the invention as shown in Figure 5 realize the structural representation of the device of single document control based on many documents framework; The device 5 of realizing single document control based on many documents framework comprises: call detection module 51, first and detect the processing module 52 and the second detection processing module 53, wherein
Call detection module 51 and be used for system before carrying out newly-built or opening the operation of engineering document, call the interface that preset control single document is realized, detect current engineering state;
First detects processing module 52 is used for not edited and preserving when detecting current engineering state, after then current operational processes is accomplished, carries out the said newly-built or operation of opening engineering;
Second detect processing module 53 be used for when detect that current engineering state has been preserved or editor preserve, then directly close current engineering state, carry out the said newly-built or operation of opening engineering.
Particularly, the engineering state in the embodiment of the invention comprises following 5 kinds:
Engineering state A: do not have engineered paths (newly-built), editor does not preserve;
Engineering state B: do not have engineered paths (newly-built), edit, do not preserve;
Engineering state C: engineered paths is arranged, and editor does not preserve;
Engineering state D: engineered paths is arranged, edit, do not preserve;
Engineering state E: engineered paths is arranged, edit, preserve.
Below, to Fig. 8,3 kinds of structures of detection module 51 are called in explanation respectively in conjunction with Fig. 6.
The present invention as shown in Figure 6 calls the structural representation of first embodiment of detection module, comprising: first editor's detecting unit 511, first is edited and is detected processing unit 512, the first preservation judging unit 513 and first is preserved judgment processing unit 514, wherein
Whether first editor's detecting unit 511 is used to detect current engineering and edits;
First editor detect processing unit 512 be used for when the testing result of first editor's detecting unit 511 for not the time, detect then that current engineering state has been preserved or editor preserve, trigger the second detection processing module, 53 executable operations; When the testing result of first editor's detecting unit 511 when being, then trigger the first preservation judging unit, 513 executable operations;
First preserves judging unit 513 is used to judge whether current engineering preserves;
First preserve judgment processing unit 514 be used for when first preserve judging unit 513 judged result when being, then trigger the second detection processing module, 53 executable operations; When first preserve judging unit 513 judged result for not the time, then detect current engineering state and do not edited and preserve, trigger first and detect processing module 52 executable operations.
The present invention as shown in Figure 7 calls the structural representation of second embodiment of detection module, comprising: first preserves detecting unit 515, first preserves detection processing unit 516, first editor's judging unit 517 and first editor's judgment processing unit 518, wherein
First preserves detecting unit 515 is used to judge whether current engineering preserves;
First preserve to detect processing unit 516 be used for when first preserve detecting unit 515 judged result when being, then trigger the second detection processing module, 53 executable operations; When first preserve detecting unit 515 judged result for not the time, then trigger first editor's judging unit, 517 executable operations;
First editor's judging unit 517 is used to judge whether current engineering edits;
The first editor judgment processing unit 518 be used for when the judged result of first editor's judging unit 517 for not the time, trigger the second detection processing module, 53 executable operations; When the judged result of first editor's judging unit 517 when being, then detect current engineering state and do not edited and preserve, trigger the first detection processing module, 52 executable operations.
The present invention as shown in Figure 8 calls the structural representation of the 3rd embodiment of detection module; Comprise: engineered paths judging unit 519, engineered paths judgment processing unit 5110, second editor's detecting unit 5111 and second editor detect processing unit 5112, wherein
Engineered paths judging unit 519 is used to judge whether current engineering exists corresponding engineered paths;
Engineered paths judgment processing unit 5110 be used for when the judged result of engineered paths judging unit 519 for not the time, then trigger second editor's detecting unit, 5111 executable operations;
Whether second editor's detecting unit 5111 is used to detect current engineering and edits;
Second editor detect processing unit 5112 be used for when the testing result of second editor's detecting unit 5111 when being, then detect current engineering state and do not edited and preserve the triggering first detection processing module 52 executable operations; When the testing result of second editor's detecting unit 5111 for not the time, then detect current engineering state and do not edit and preserve, trigger second and detect processing module 53 executable operations.
Further, calling detection module can also comprise: second preserves judging unit 5113 and second preserves judgment processing unit 5114, wherein
Second preserve judging unit 5113 be used for when the judged result of engineered paths judging unit 519 when being, engineered paths judgment processing unit 5110 triggerings, the second preservation judging unit 5113 judges whether current engineering preserves;
Second preserve judgment processing unit 5114 be used for when second preserve judging unit 5113 judged result when being, then trigger the second detection processing module, 53 executable operations; When second preserve judging unit 5113 judged result for not the time, then trigger second editor's detecting unit, 5111 executable operations.
In sum, embodiment of the present invention embodiment is through before carrying out newly-built or opening the operation of engineering document; Call the interface that preset control single document is realized; Detect current engineering state, directly close the current engineering state of not preserving of having preserved or edited, when perhaps not preserving for editing as if current engineering state; After waiting for that current operational processes is accomplished; Carry out the said newly-built or operation of opening engineering again, having solved does not have the spendable problem of single document framework in the Cocoa framework in the apple systems programming environment in the prior art, realized the single document framework functions of the Cocoa framework in the apple systems programming environment quickly and easily; Avoided realizing that brand-new single document framework needs great amount of time, and possibly bring the instability of application and the problem of system compatibility.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method; Be to instruct relevant hardware to accomplish through computer program; Described program can be stored in the computer read/write memory medium; This program can comprise the flow process like the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
Above disclosedly be merely a kind of preferred embodiment of the present invention, can not limit the present invention's interest field certainly with this, the equivalent variations of therefore doing according to claim of the present invention still belongs to the scope that the present invention is contained.