CN103019715B - The apparatus and method of label are closed in browser - Google Patents

The apparatus and method of label are closed in browser Download PDF

Info

Publication number
CN103019715B
CN103019715B CN201210535434.2A CN201210535434A CN103019715B CN 103019715 B CN103019715 B CN 103019715B CN 201210535434 A CN201210535434 A CN 201210535434A CN 103019715 B CN103019715 B CN 103019715B
Authority
CN
China
Prior art keywords
label
father
browser
closing
subtab
Prior art date
Application number
CN201210535434.2A
Other languages
Chinese (zh)
Other versions
CN103019715A (en
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 北京奇虎科技有限公司
Priority to CN201210535434.2A priority Critical patent/CN103019715B/en
Publication of CN103019715A publication Critical patent/CN103019715A/en
Application granted granted Critical
Publication of CN103019715B publication Critical patent/CN103019715B/en

Links

Abstract

The present invention relates to network data communication technical field, it discloses in browser the apparatus and method of closing label, the device of closing label comprises: father's label judge module, is suitable for, when receiving the instruction of closing label, judging whether label to be closed has father's label; Subtab judge module, is suitable for when having father's label wait the label of closing, and judges whether this father's label has multiple subtab; Label closing module, is suitable for when father's label has multiple subtab, completes label and closes, and the current label presented is switched to a subtab of the father's label found; At father's label only with when the label of closing is for subtab, complete label and close, and the current label presented is switched to this father's label.Lack the technical matters of relevance between the label that the present invention presents after can solving and closing label and buttoned-up label, achieve and can automatically present and the beneficial effect of closing the label that label is associated.

Description

The apparatus and method of label are closed in browser
Technical field
The present invention relates to network data communication technical field, be specifically related to the apparatus and method of closing label in a kind of browser.
Background technology
In prior art, when after closedown label, an adjacent label of this buttoned-up label can be switched to, and present this adjacent label.But label that should be adjacent with buttoned-up label, not necessarily has with buttoned-up label and associates with regard to web page contents in label.Thus, lack relevance between the label presented after causing closedown label and buttoned-up label, automatically cannot present the problem of the correlation tag of closing label.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of the overcoming apparatus and method of closing label in the problems referred to above or the browser that solves the problem at least in part.
According to one aspect of the present invention, provide the device of closing label in a kind of browser, described device comprises:
Father's label judge module, is suitable for, when receiving the instruction of closing label, judging whether label to be closed has father's label, judged result being informed to subtab judge module;
Subtab judge module, being suitable in judged result is when having father's label wait the label of closing, and judges whether this father's label has multiple subtab, and this judged result is informed to label closing module;
Label closing module, is suitable for when the judged result of the subtab judge module received has multiple subtab for father's label, completes label and closes, and the current label presented is switched to a subtab of the father's label found; The judged result of the subtab judge module received be father's label only with when the label of closing is for subtab, complete label and close, and the current label presented is switched to this father's label;
Described subtab is the label by clicking the webpage for loading this link that link generates in described father's label.
Alternatively, described device also comprises: position judging module,
Described father's label judge module, is also suitable for judged result to inform to described position judging module;
Described position judging module, being suitable in judged result is when not having father's label wait the label of closing, and judges whether label to be closed is positioned at browser last, this judged result is informed to label closing module;
Described label closing module, be also suitable for the judged result of described position judging module be wait the label of closing be positioned at browser last time, complete label and close, and the current label presented is switched to the upper label before the label of closedown; The judged result of position judging module be wait the label of closing be not be positioned at browser last time, complete label and close, and the current label presented is switched to the next label after the label of closedown.
Alternatively, described device also comprises: number of labels judge module,
Described father's label judge module, specifically be suitable for after receiving the instruction of closing label, indicating label quantity judge module carries out the judgement whether only comprising label to be closed in browser, be be not when only comprising the label wait closing in browser in the judged result of number of labels judge module, judge whether label to be closed has father's label, judged result is informed to subtab judge module, when the judged result of number of labels judge module is the label only comprised in browser wait closing, end operation, do not carry out the judgement whether label to be closed has father's label,
Described number of labels judge module is also suitable for judged result being informed to described label closing module;
Described label closing module is also suitable for, and when the judged result of the described number of labels judge module received being the label only comprised in browser wait closing, completing after label is closed and generating new label, and presenting this new label.
Alternatively, described label closing module is further adapted for, and after completing label closedown, makes the label be switched to obtain browser focus, to present the label be switched in the display interface of browser.
According to a further aspect in the invention, provide a kind of method of closing label in browser, described method comprises:
When receiving the instruction of closing label, judging whether label to be closed has father's label, if having father's label, then judging whether this father's label has multiple subtab further;
If this father's label has multiple subtab, then complete label and close, the current label presented is switched to a subtab of this father's label found;
If this father's label only with this label to be closed for subtab, then complete label close, the current label presented is switched to this father's label;
Described subtab is the label by clicking the webpage for loading this link that link generates in described father's label.
Alternatively, described method also comprises:
When not there is father's label wait the label of closing, judge whether label to be closed is positioned at browser last;
If it is last to be positioned at browser, then completes label and close, the current label presented is switched to the upper label before the label of closedown;
Last if not being positioned at browser, then complete label and close, the current label presented is switched to the next label after the label of closedown.
Alternatively, judging also to comprise before whether label to be closed has father's label:
Judge whether only comprise label to be closed in browser, if so, then complete after label is closed and generate new label, and present this new label.
Alternatively, the described subtab of this father's label found that switched to by the current label presented comprises further:
The subtab be switched to is made to obtain browser focus, to present this subtab in the display interface of browser;
Describedly this father's label is switched to comprise further on the current label presented:
The father's label be switched to is made to obtain browser focus, to present this father's label in the display interface of browser.
According to technical scheme of the present invention, when closing label, can judge whether label to be closed has father's label, if having father's label, then judging whether this father's label has multiple subtab further.If this father's label has multiple subtab, then complete label and close, the current label presented is switched to a subtab of this father's label found; If this father's label only with this label to be closed for subtab, then complete label close, the current label presented is switched to this father's label.Thus, when making to close label, after completing label closedown, preferentially be switched to and the buttoned-up label related label of tool in terms of content, this label and buttoned-up label have identical father's label or both are set membership, and then lacks the problem of relevance between the label presented after solving closedown label and buttoned-up label; Achieve and can automatically present and the beneficial effect of closing the label that label is associated.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the structural drawing adding tagged device in browser according to an embodiment of the invention;
Fig. 2 shows the tag sorting according to adding in one embodiment of the invention after label in browser;
Fig. 3 shows the structural drawing of closing the device of label in browser according to an embodiment of the invention;
Fig. 4 shows the structural drawing of closing the device of label in browser according to an embodiment of the invention;
Fig. 5 shows the structural drawing of closing the device of label in browser according to an embodiment of the invention;
Fig. 6 shows the process flow diagram adding tagged method in browser according to an embodiment of the invention;
Fig. 7 shows the process flow diagram of closing the method for label in browser according to an embodiment of the invention; And
Fig. 8 shows the process flow diagram of closing the method for label in browser according to an embodiment of the invention.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
See Fig. 1, show the structural drawing adding label apparatus according to an embodiment of the invention.This interpolation label apparatus 100 comprises: generation module 110, judge module 120 and interpolation module 130.
Generation module 110, be suitable for receiving the instruction generating new label, the instruction according to receiving generates new label.
Judge module 120, is suitable for the new label judging whether only to comprise this generation in browser, and judged result is informed to interpolation module 130.
Add module 130, be suitable for, when judged result is the new label only comprising this generation in browser, in the display interface of browser, adds this new label and presenting; Be, when not being the new label only comprising this generation in browser, in the next position in the display interface of browser after the current label presented, insert this new label in judged result, and present this new label.
In the present embodiment, browser can be mobile phone browser, PC browser or PAD browser, is not particularly limited at this.
Wherein, interpolation module 130 is further adapted for and makes new label obtain browser focus, to present this new label in the display interface of browser.
Wherein, after generation module 110 is further adapted for the instruction receiving and click and link in the current label presented, generate the new label of the webpage loading this link.
Wherein, after generation module 110 is further adapted for the instruction receiving label interpolation button in click browser, generate the new label of blank or that loading is default webpage.
Such as, label A, label A 1, label A 2, label B, label B 1, label B 2, label C, label D, label D1 and label D2 to be added in a browser.Wherein, label A 1 and label A 2 are the subtab of label A; Label B 1 and label B 2 are the subtab of label B; Label D1 and label D2 is the subtab of label D.Namely label A 1 and label A 2 add by clicking link in label A, and label B 1 and label B 2 add by clicking link in label B, and label D1 and label D2 adds by clicking link in label D.
Adding procedure in this citing is as follows.Sequence label after interpolation as shown in Figure 2.
First, newly-built label A.Generation module 110 receives the instruction of generating labels A, according to the instruction generating labels A received.Judge module 120 is judged only to comprise label A in browser, judged result is informed to and adds module 130.Add module 130 and add label A in the display interface of browser, make label A obtain browser focus, to present label A.
Click in label A and link, add label A 1.Generation module 110 receives the instruction clicked and link in label A, generates the label A 1 loading webpage in this link.Judge module 120 judges it is not only comprise label A 1 in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label A presented and insert label A 1, make label A 1 obtain browser focus, to present label A 1.Namely, after label A 1 is added label A, webpage in label A 1 is presented.
Newly-built label B, adds label B.Generation module 110 receives label in click browser and adds the instruction of button, generating labels B.Label B can be blank tag, after label has added, by input network address, loads the webpage of this network address.Or, in the label B of generation, load default webpage.Judge module 120 judges it is not only comprise label B in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label A 1 presented and insert label B, make label B obtain browser focus, to present label B.Namely, after label B is added label A 1, content in label B is presented.
Click in label B and link, add label B 1.Generation module 110 receives the instruction clicked and link in label B, generates the label B 1 loading webpage in this link.Judge module 120 judges it is not only comprise label B 1 in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label B presented and insert label B 1, make label B 1 obtain browser focus, to present label B 1.Namely, after label B 1 is added label B, webpage in label B 1 is presented.
Click label A, make label A obtain focus, present label A.Click another link in label A, add label A 2.Generation module 110 receives the instruction clicking another link in label A, generates the label A 2 loading webpage in this link.Judge module 120 judges it is not only comprise label A 2 in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label A presented and insert label A 2, make label A 2 obtain browser focus, to present label A 2.Namely label A 2 is being added between label A and label A 1, presenting webpage in label A 2.
Newly-built label C, adds label C.Generation module 110 receives label in click browser and adds the instruction of button, generating labels C.Label C can be blank tag, after label has added, by input network address, loads the webpage of this network address.Or, in the label C of generation, load default webpage.Judge module 120 judges it is not only comprise label C in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label A 2 presented and insert label C, make label C obtain browser focus, to present label C.Namely, after label C is added label A 2, content in label C is presented.
Click label B, make label B obtain focus, present label B.Click another link in label B, add label B 2.Generation module 110 receives the instruction clicking another link in label B, generates the label B 2 loading webpage in this link.Judge module 120 judges it is not only comprise label B 2 in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label B presented and insert label B 2, make label B 2 obtain browser focus, to present label B 2.Namely, after label B 2 is added label B, webpage in label B 2 is presented.
Click label B 1, make label B 1 obtain focus, present label B 1.Newly-built label D, adds label D.Generation module 110 receives label in click browser and adds the instruction of button, generating labels D.Label D can be blank tag, after label has added, by input network address, loads the webpage of this network address.Or, in the label D of generation, load default webpage.Judge module 120 judges it is not only comprise label D in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label B 1 presented and insert label D, make label D obtain browser focus, to present label D.Namely, after label D is added label B 1, content in label D is presented.
In label D, one click first links and the second link, adds label D1 and label D2.Such as, by after pinning ctrl key in label D, click the mode of the first link and the second link, realize one click first in label D and link and second to link.Generation module 110 receives the instruction clicking the first link in label D, generates the label D1 loading webpage in this link; Receive the instruction clicking the second link in label D, generate the label D2 loading webpage in this link.Judge module 120 judges it is not only comprise label D1 in browser, is not only comprise label D2 in browser, and judged result is informed to interpolation module 130.Add in the next position of module 130 in the display interface of browser after the current label D presented and insert label D1, between the label D1 of the current label D that presents and interpolation in the display interface of browser, add label D2.Label D2 obtains browser focus, presents label D2.
In the present embodiment, when adding label, the position of new label all after the current label presented, and then the problem that the label browsed before solving interpolation is far away with the label spacing of newly adding; The label browsed before making interpolation is adjacent with the label newly added, and achieves while presenting the new label added, the beneficial effect of the label browsed before being easy to find out interpolation.
In one embodiment, after generation module 110 is further adapted for the instruction receiving and click and link in the current label presented, generate the new label of the webpage loading this link.The current label presented is father's label of new label, and new label is the subtab of the current label presented.
It is when not being the new label only comprising described generation in browser that interpolation module 130 is further adapted in judged result, determine that in the display interface of browser, the current label presented is father's label of new label, added in the next position of interface in display interface after the current label presented by the subtab of father's label and insert this new label and present.
In another embodiment, after generation module 110 is further adapted for the instruction receiving label interpolation button in click browser, generate the new label of blank or that loading is default webpage.
It is when not being the new label only comprising described generation in browser that interpolation module 130 is further adapted in judged result, obtain the sorting position of the current label presented in browser display interface, added in the next position of interface after this position by the label of label container and insert this new label;
Label container is used for depositing each label in browser.
For example, in interpolation module 130, labels class Tab and label container class TabContainer is set.
The object of labels class is label, and labels class Tab comprises interface:
VoidsetParentTab (Tabparent), arranges interface for the father's label arranging father's label;
TabgetParent (), obtains interface for the father's label obtaining father's label;
VoidaddChildTab (Tabchild), adds interface for the subtab adding subtab.
Labels class comprises parameter:
ArrayList<Tab>mTabContainer, for depositing the label container of each label in browser,
HashMap<intkey, TabmTab>mTabMap, for the Hash table of map tags, carry out tag storage by key assignments (key, value), can be mapped to corresponding label by key.
IntmCurrentTabKey, for recording the current label key of the key of current label, when not having label in a browser, this parameter initial value is-1.
Labels class comprises interface,
VoidaddTab(TabmTab), the initial labels for adding initial labels in a browser adds interface;
VoidaddTab(intindex, TabmTab), add interface for the label of the label after adding initial labels.
Judge module 120 judges by mCurrentTabKey the new label whether only comprising this generation in browser, as mCurrentTabKey=-1, only comprises the new label of this generation in browser, otherwise, not the new label only comprising this generation in browser.
Add module 130 when mCurrentTabKey=-1, add interface by the initial labels of label container and in the display interface of browser, add this new label and present.Such as: by Tabtab=newtab, by newly-built label assignment to variable tab.Pass through addTab(tab) in the display interface of browser, add this new label and present.In addition, by intkey=tab.hashcode (), calculate the key of new label, hashcode () is the interface for calculating key.By mTabMap.put (key, tab), by new label stored in Hash table.By mCurrentTabkey=key, upgrade parameter mCurrentTabKey.
Add module 130 in mCurrentTabKey ≠-1, and new label has father's label, when namely receiving the instruction clicking in the current label presented and link and generate new label, added in the next position of interface in display interface after the current label presented by the subtab of father's label and insert this new label and present.Such as: by Tabtab=newtab, by newly-built label assignment to variable tab.By TabparrentTab=mTabmap.get (mCurrentTabkey), take out the current label presented from Hash table, this label is father's label of new label to be added.By inserting this new label in the next position of parentTab.addchildTab (tab) in display interface after the current label presented and presenting, insert this new label in the next position namely in display interface after father's label and present.In addition, by intkey=tab.hashcode (), the key of new label is calculated.By mTabMap.put (key, tab), by new label stored in Hash table.By mCurrentTabkey=key, upgrade parameter mCurrentTabKey.
Add module 130 in mCurrentTabKey ≠-1, and new label does not have father's label, when namely receiving the instruction of label interpolation button in click browser and generate new label, obtain the sorting position of the current label presented in browser display interface, added in the next position of interface after this position by the label of label container and insert this new label.Such as: by Tabtab=newtab, by newly-built label assignment to variable tab.By addTab(index, tab) in the display interface of browser, add this new label and present.Index is that the label of acquisition browser focus is at the sorting position of label in browser display interface.In addition, by intkey=tab.hashcode (), the key of new label is calculated.By mTabMap.put (key, tab), by new label stored in Hash table.By mCurrentTabkey=key, upgrade parameter mCurrentTabKey.
Above-mentioned citing is only a kind of embodiment of the embodiment of the present invention, the present invention is not limited thereto, and can implement in several ways.
See Fig. 3, show the structural drawing of closing the device of label in browser according to an embodiment of the invention.The device 200 of closing label comprises: father's label judge module 210, subtab judge module 220 and label closing module 230.
Father's label judge module 210, is suitable for, when receiving the instruction of closing label, judging whether label to be closed has father's label, judged result being informed to subtab judge module 220.
Subtab judge module 220, being suitable in judged result is when having father's label wait the label of closing, and judges whether this father's label has multiple subtab, and this judged result is informed to label closing module 230.
Label closing module 230, is suitable for when the judged result of the subtab judge module 220 received has multiple subtab for father's label, completes label and closes, and the current label presented is switched to a subtab of the father's label found; The judged result of the subtab judge module 220 received be father's label only with when the label of closing is for subtab, complete label and close, and the current label presented is switched to this father's label.
Wherein, subtab is by clicking the label linking the webpage for loading this link generated in father's label.
Further, label closing module 230, is suitable for after completing label closedown, makes the label be switched to obtain browser focus, to present the label be switched in the display interface of browser.
For example, in the browser label in fig. 2, when receiving the instruction of closing label A 1, father's label judge module 210 judges that label A 1 has father's label, label A, and judged result is notified this subtab judge module 220.Subtab judge module 220 judges that label A has multiple subtab, and judged result is informed to label closing module 230.Label closing module 230, after being closed by label A 1, makes another subtab of label A, label A 2, obtains browser focus, presents label A 2.
Subsequently, when receiving the instruction of closing label A 2, father's label judge module 210 judges that label A 2 has father's label, label A, and judged result is notified this subtab judge module 220.Subtab judge module 220 judge label A only with label A 2 for subtab, and judged result is informed to label closing module 230.Label closing module 230, after being closed by label A 2, makes label A obtain browser focus, presents label A.
Adopt the present embodiment, when closing label, after completing label closedown, preferentially be switched to and the buttoned-up label related label of tool in terms of content, this label and buttoned-up label have identical father's label or both are set membership, and then lacks the problem of relevance between the label presented after solving closedown label and buttoned-up label; Achieve and can automatically present and the beneficial effect of closing the label that label is associated.
See Fig. 4, show the structural drawing of closing the device of label in browser according to an embodiment of the invention.Device comprises: father's label judge module 210, subtab judge module 220, label closing module 230 and position judging module 240.
Father's label judge module 210, is suitable for, when receiving the instruction of closing label, judging whether label to be closed has father's label, judged result being informed to subtab judge module 220 and position judging module 240.
Subtab judge module 220, being suitable in judged result is when having father's label wait the label of closing, and judges whether this father's label has multiple subtab, and this judged result is informed to label closing module 230.
Label closing module 230, is suitable for when the judged result of the subtab judge module 220 received has multiple subtab for father's label, completes label and closes, and the current label presented is switched to a subtab of the father's label found; The judged result of the subtab judge module 220 received be father's label only with when the label of closing is for subtab, complete label and close, and the current label presented is switched to this father's label.
Position judging module 240, being suitable in judged result is when not having father's label wait the label of closing, and judges whether label to be closed is positioned at browser last, this judged result is informed to label closing module 230.
Label closing module 230, be also suitable for the judged result of position judging module 240 be wait the label of closing be positioned at browser last time, complete label and close, and the current label presented is switched to the upper label before the label of closedown; The judged result of position judging module 240 be wait the label of closing be not be positioned at browser last time, complete label and close, and the current label presented is switched to the next label after the label of closedown.
The present embodiment is only a kind of embodiment of the present invention, the present invention is not limited thereto.Such as, the present invention also can not comprise position judging module 240.Judged result is also informed to label closing module 230 by father's label judge module 210.Label closing module 230 is when not having father's label wait the label of closing in judged result, completes label and closes, and the current label presented is switched to first label, or last label, or arbitrary father's label with subtab.Because when not there is father's label wait the label of closing, the correlation tag of label not closed in the label comprised in browser is described, so in such cases, the present invention is not particularly limited for the label presented after closing.
See Fig. 5, show the structural drawing of closing the device of label in browser according to an embodiment of the invention.Device comprises: number of labels judge module 250, father's label judge module 210, subtab judge module 220, label closing module 230 and position judging module 240.
Father's label judge module 210, be suitable for when receiving the instruction of closing label, indicating label quantity judge module 250 judges.
Number of labels judge module 250, is suitable for judging whether only comprise label to be closed in browser, and judged result is informed to described label closing module 230,
Father's label judge module 210 is after indicating label quantity judge module 250 judges, wait for the judged result of number of labels judge module 250, be be not when only comprising the label wait closing in browser in judged result, judge whether label to be closed has father's label, judged result is informed to subtab judge module 220 and position judging module 240, when judged result is the label only comprised in browser wait closing, end operation, does not carry out the judgement whether label to be closed has father's label.By which, father's label judge module 210 can be avoided to carry out unnecessary judgement, to save system resource.
Label closing module 230, is suitable for when the judged result of the number of labels judge module 250 received is the label only comprised in browser wait closing, and completes after label is closed and generates new label, and present this new label.
Subtab judge module 220, being suitable in the judged result of father's label judge module 210 is when having father's label wait the label of closing, and judges whether this father's label has multiple subtab, and this judged result is informed to label closing module 230.When the judged result of father's label judge module 210 is, when not having father's label wait the label of closing, do not carry out judgement operation.
Label closing module 230, is also suitable for when the judged result of the subtab judge module 220 received has multiple subtab for father's label, completes label and closes, and the current label presented is switched to a subtab of the father's label found; The judged result of the subtab judge module 220 received be father's label only with when the label of closing is for subtab, complete label and close, and the current label presented is switched to this father's label.
Position judging module 240, being suitable in the judged result of father's label judge module 210 is when not having father's label wait the label of closing, and judges whether label to be closed is positioned at browser last, this judged result is informed to label closing module 230.When the judged result of father's label judge module 210 is, when having father's label wait the label of closing, do not carry out judgement operation.
Label closing module 230, be also suitable for the judged result of position judging module 240 be wait the label of closing be positioned at browser last time, complete label and close, and the current label presented is switched to the upper label before the label of closedown; The judged result of position judging module 240 be wait the label of closing be not be positioned at browser last time, complete label and close, and the current label presented is switched to the next label after the label of closedown.
Above-described embodiment is only the exemplary illustration of the specific embodiment of the present invention, the present invention is not limited thereto, and can implement to realize the present invention by other concrete mode multiple.
See Fig. 6, show the process flow diagram adding tagged method in browser according to an embodiment of the invention.The method comprises the steps.
Step S610, receives the instruction generating new label, generates new label according to instruction.
Step S620, judges whether only comprise this new label in browser, if so, then performs step S630, otherwise, perform step S640.
Step S630, adds this new label in the display interface of browser, and presents this new label.
Step S640, inserts this new label in the next position in the display interface of browser after the current label presented, and presents this new label.
Wherein, present this new label in step S630 and step S640 and comprise further: make new label obtain browser focus, to present this new label in the display interface of browser.
Wherein, step S610 comprises further: after receiving the instruction clicked and link in the current label presented, and generates the new label of the webpage loading this link.
Wherein, step S610 comprises further: after receiving the instruction of label interpolation button in click browser, generates the new label of blank or that loading is default webpage.
Such as, label A, label A 1, label A 2, label B, label B 1, label B 2, label C, label D, label D1 and label D2 to be added in a browser.Wherein, label A 1 and label A 2 are the subtab of label A; Label B 1 and label B 2 are the subtab of label B; Label D1 and label D2 is the subtab of label D.Namely label A 1 and label A 2 add by clicking link in label A, and label B 1 and label B 2 add by clicking link in label B, and label D1 and label D2 adds by clicking link in label D.
Adding procedure in this citing is as follows.Sequence label after interpolation as shown in Figure 2.
First, newly-built label A.Receive the instruction of generating labels A, according to the instruction generating labels A received.Judge only to comprise label A in browser, in the display interface of browser, add label A, make label A obtain browser focus, to present label A.
Click in label A and link, add label A 1.Receive the instruction clicked and link in label A, generate the label A 1 loading webpage in this link.Judge it is not only comprise label A 1 in browser, in the next position in the display interface of browser after the current label A presented, insert label A 1, make label A 1 obtain browser focus, to present label A 1.Namely, after label A 1 is added label A, webpage in label A 1 is presented.
Newly-built label B, adds label B.Receive label in click browser and add the instruction of button, generating labels B.Label B can be blank tag, after label has added, by input network address, loads the webpage of this network address.Or, in the label B of generation, load default webpage.Judge it is not only comprise label B in browser, in the next position in the display interface of browser after the current label A 1 presented, insert label B, make label B obtain browser focus, to present label B.Namely, after label B is added label A 1, content in label B is presented.
Click in label B and link, add label B 1.Receive the instruction clicked and link in label B, generate the label B 1 loading webpage in this link.Judge it is not only comprise label B 1 in browser, in the next position in the display interface of browser after the current label B presented, insert label B 1, make label B 1 obtain browser focus, to present label B 1.Namely, after label B 1 is added label B, webpage in label B 1 is presented.
Click label A, make label A obtain focus, present label A.Click another link in label A, add label A 2.Receive the instruction clicking another link in label A, generate the label A 2 loading webpage in this link.Judge it is not only comprise label A 2 in browser, in the next position in the display interface of browser after the current label A presented, insert label A 2, make label A 2 obtain browser focus, to present label A 2.Namely label A 2 is being added between label A and label A 1, presenting webpage in label A 2.
Newly-built label C, adds label C.Receive label in click browser and add the instruction of button, generating labels C.Label C can be blank tag, after label has added, by input network address, loads the webpage of this network address.Or, in the label C of generation, load default webpage.Judge it is not only comprise label C in browser, in the next position in the display interface of browser after the current label A 2 presented, insert label C, make label C obtain browser focus, to present label C.Namely, after label C is added label A 2, content in label C is presented.
Click label B, make label B obtain focus, present label B.Click another link in label B, add label B 2.Receive the instruction clicking another link in label B, generate the label B 2 loading webpage in this link.Judge it is not only comprise label B 2 in browser, in the next position in the display interface of browser after the current label B presented, insert label B 2, make label B 2 obtain browser focus, to present label B 2.Namely, after label B 2 is added label B, webpage in label B 2 is presented.
Click label B 1, make label B 1 obtain focus, present label B 1.Newly-built label D, adds label D.Receive label in click browser and add the instruction of button, generating labels D.Label D can be blank tag, after label has added, by input network address, loads the webpage of this network address.Or, in the label D of generation, load default webpage.Judge it is not only comprise label D in browser, in the next position in the display interface of browser after the current label B 1 presented, insert label D, make label D obtain browser focus, to present label D.Namely, after label D is added label B 1, content in label D is presented.
In label D, one click first links and the second link, adds label D1 and label D2.Such as, by after pinning ctrl key in label D, click the mode of the first link and the second link, realize one click first in label D and link and second to link.Receive the instruction clicking the first link in label D, generate the label D1 loading webpage in this link; Receive the instruction clicking the second link in label D, generate the label D2 loading webpage in this link.Judge it is not only comprise label D1 in browser, not only comprise label D2 in browser, insert label D1 in next position in the display interface of browser after the current label D presented, between the label D1 of the current label D that presents and interpolation in the display interface of browser, add label D2.Label D2 obtains browser focus, presents label D2.
In the present embodiment, when adding label, the position of new label all after the current label presented, and then the problem that the label browsed before solving interpolation is far away with the label spacing of newly adding; The label browsed before making interpolation is adjacent with the label newly added, and achieves while presenting the new label added, the beneficial effect of the label browsed before being easy to find out interpolation.
In one embodiment, step S610 comprises further: after receiving the instruction clicked and link in the current label presented, and generates the new label of the webpage loading this link.The current label presented is father's label of new label, and new label is the subtab of the current label presented.
Step S640 comprises further: be when not being the new label only comprising described generation in browser in judged result, determine that in the display interface of browser, the current label presented is father's label of new label, added in the next position of interface in display interface after the current label presented by the subtab of father's label and insert this new label and present.
In another embodiment, step S610 comprises further: after receiving the instruction of label interpolation button in click browser, generates the new label of blank or that loading is default webpage.
Step S640 comprises further: be when not being the new label only comprising described generation in browser in judged result, obtain the sorting position of the current label presented in browser display interface, added in the next position of interface after this position by the label of label container and insert this new label;
Label container is used for depositing each label in browser.
For example, labels class Tab and label container class TabContainer is set.
The object of labels class is label, and labels class Tab comprises interface:
VoidsetParentTab (Tabparent), arranges interface for the father's label arranging father's label;
TabgetParent (), obtains interface for the father's label obtaining father's label;
VoidaddChildTab (Tabchild), adds interface for the subtab adding subtab.
Labels class comprises parameter:
ArrayList<Tab>mTabContainer, for depositing the label container of each label in browser,
HashMap<intkey, TabmTab>mTabMap, for the Hash table of map tags, carry out tag storage by key assignments (key, value), can be mapped to corresponding label by key.
IntmCurrentTabKey, for recording the current label key of the key of current label, when not having label in a browser, this parameter initial value is-1.
Labels class comprises interface,
VoidaddTab(TabmTab), the initial labels for adding initial labels in a browser adds interface;
VoidaddTab(intindex, TabmTab), add interface for the label of the label after adding initial labels.
In step S620, judge by mCurrentTabKey the new label whether only comprising this generation in browser, as mCurrentTabKey=-1, in browser, only comprise the new label of this generation, otherwise, not the new label only comprising this generation in browser.
In step S630, when mCurrentTabKey=-1, add interface by the initial labels of label container and in the display interface of browser, add this new label and present.Such as: by Tabtab=newtab, by newly-built label assignment to variable tab.Pass through addTab(tab) in the display interface of browser, add this new label and present.In addition, by intkey=tab.hashcode (), calculate the key of new label, hashcode () is the interface for calculating key.By mTabMap.put (key, tab), by new label stored in Hash table.By mCurrentTabkey=key, upgrade parameter mCurrentTabKey.
In step S640, in mCurrentTabKey ≠-1, and new label has father's label, when namely receiving the instruction clicking in the current label presented and link and generate new label, added in the next position of interface in display interface after the current label presented by the subtab of father's label and insert this new label and present.Such as: by Tabtab=newtab, by newly-built label assignment to variable tab.By TabparrentTab=mTabmap.get (mCurrentTabkey), take out the current label presented from Hash table, this label is father's label of new label to be added.By inserting this new label in the next position of parentTab.addchildTab (tab) in display interface after the current label presented and presenting, insert this new label in the next position namely in display interface after father's label and present.In addition, by intkey=tab.hashcode (), the key of new label is calculated.By mTabMap.put (key, tab), by new label stored in Hash table.By mCurrentTabkey=key, upgrade parameter mCurrentTabKey.
In step S640, in mCurrentTabKey ≠-1, and new label does not have father's label, when namely receiving the instruction of label interpolation button in click browser and generate new label, obtain the sorting position of the current label presented in browser display interface, added in the next position of interface after this position by the label of label container and insert this new label.Such as: by Tabtab=newtab, by newly-built label assignment to variable tab.By addTab(index, tab) in the display interface of browser, add this new label and present.Index is that the label of acquisition browser focus is at the sorting position of label in browser display interface.In addition, by intkey=tab.hashcode (), the key of new label is calculated.By mTabMap.put (key, tab), by new label stored in Hash table.By mCurrentTabkey=key, upgrade parameter mCurrentTabKey.
Above-mentioned citing is only a kind of embodiment of the embodiment of the present invention, the present invention is not limited thereto, and can implement in several ways.
See Fig. 7, show the process flow diagram of closing the method for label in browser according to an embodiment of the invention.
Step S710, receives the instruction of closing label.
Step S720, judges whether label to be closed has father's label, if having father's label, then performs step S730, otherwise, perform step S760.
Wherein, subtab is by clicking the label linking the webpage for loading this link generated in father's label.If label is for generating by clicking link in another label, then this label has father's label.
Step S730, judges whether this father's label has multiple subtab, if had, then performs step S740, otherwise, perform step S750.
Step S740, completes label and closes, the current label presented is switched to a subtab of this father's label found.
Further, the subtab be switched to is made to obtain browser focus, to present this subtab in the display interface of browser.
Step S750, completes label and closes, the current label presented is switched to this father's label.
Further, the father's label be switched to is made to obtain browser focus, to present this father's label in the display interface of browser.
Step S760, completes label and closes.
Further, can judge in step S760 whether label to be closed is positioned at browser last, if it is last to be positioned at browser, then completes label and close, the current label presented is switched to the upper label before the label of closedown; Last if not being positioned at browser, then complete label and close, the current label presented is switched to the next label after the label of closedown.
Herein, be only a kind of embodiment of step S760, the present invention is not limited thereto.Such as, can be also when not there is father's label wait the label of closing in judged result, complete label and close, and the current label presented is switched to first label, or last label, or arbitrary father's label with subtab.Because when not there is father's label wait the label of closing, the correlation tag of label not closed in the label comprised in browser is described, so in such cases, the present invention is not particularly limited for the label presented after closing.
Below the present embodiment being illustrated, in the browser label in fig. 2, when receiving the instruction of closing label A 1, judging that label A 1 has father's label, label A.Then, judge that label A has multiple subtab, after being closed by label A 1, make another subtab of label A, label A 2, obtain browser focus, present label A 2.
Subsequently, when receiving the instruction of closing label A 2, judge that label A 2 has father's label, label A.Then, judge label A only with label A 2 for subtab, after label A 2 is closed, make label A obtain browser focus, present label A.
Adopt the present embodiment, when closing label, after completing label closedown, preferentially be switched to and the buttoned-up label related label of tool in terms of content, this label and buttoned-up label have identical father's label or both are set membership, and then lacks the problem of relevance between the label presented after solving closedown label and buttoned-up label; Achieve and can automatically present and the beneficial effect of closing the label that label is associated.
See Fig. 8, show the process flow diagram of closing the method for label in browser according to an embodiment of the invention.
Step S8010, receives the instruction of closing label.
Step S8020, judges whether only comprise label to be closed in browser, if so, then performs step S8030, otherwise, perform step S8040.
Step S8030, completes after label is closed and generates new label, and present this new label.
Step S8040, judges whether label to be closed has father's label, if having father's label, then performs step S8050, otherwise, perform step S8080.
Wherein, subtab is by clicking the label linking the webpage for loading this link generated in father's label.If namely label is for generating by clicking link in another label, then this label has father's label.
Step S8050, judges whether this father's label has multiple subtab, if had, then performs step S8060, otherwise, perform step S8070.
Step S8060, completes label and closes, the current label presented is switched to a subtab of this father's label found.
Further, the subtab be switched to is made to obtain browser focus, to present this subtab in the display interface of browser.
Step S8070, completes label and closes, the current label presented is switched to this father's label.
Further, the father's label be switched to is made to obtain browser focus, to present this father's label in the display interface of browser.
Step S8080, judges whether label to be closed is positioned at browser last, if so, then performs step S8090, otherwise, perform step S8100.
Step S8090, completes label and closes, the current label presented is switched to the upper label before the label of closedown.
Step S8100, completes label and closes, the current label presented is switched to the next label after the label of closedown.
Above-described embodiment is only the exemplary illustration of the specific embodiment of the present invention, the present invention is not limited thereto, and can implement to realize the present invention by other concrete mode multiple.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.

Claims (6)

1. close a device for label in browser, described device comprises:
Father's label judge module, is suitable for, when receiving the instruction of closing label, judging whether label to be closed has father's label, judged result being informed to subtab judge module;
Subtab judge module, being suitable in judged result is when having father's label wait the label of closing, and judges whether this father's label has multiple subtab, and this judged result is informed to label closing module;
Label closing module, is suitable for when the judged result of the subtab judge module received has multiple subtab for father's label, completes label and closes, and the current label presented is switched to a subtab of the father's label found; The judged result of the subtab judge module received be father's label only with when the label of closing is for subtab, complete label and close, and the current label presented is switched to this father's label;
Described subtab is the label by clicking the webpage for loading this link that link generates in described father's label;
Wherein, described device also comprises: position judging module,
Described father's label judge module, is also suitable for judged result to inform to described position judging module;
Described position judging module, being suitable in judged result is when not having father's label wait the label of closing, and judges whether label to be closed is positioned at browser last, this judged result is informed to label closing module;
Described label closing module, be also suitable for the judged result of described position judging module be wait the label of closing be positioned at browser last time, complete label and close, and the current label presented is switched to the upper label before the label of closedown; The judged result of position judging module be wait the label of closing be not be positioned at browser last time, complete label and close, and the current label presented is switched to the next label after the label of closedown.
2. device according to claim 1, wherein,
Described device also comprises: number of labels judge module,
Described father's label judge module, be further adapted for after receiving the instruction of closing label, indicating label quantity judge module carries out the judgement whether only comprising label to be closed in browser, be be not when only comprising the label wait closing in browser in the judged result of number of labels judge module, judge whether label to be closed has father's label, judged result is informed to subtab judge module, when the judged result of number of labels judge module is the label only comprised in browser wait closing, end operation, do not carry out the judgement whether label to be closed has father's label,
Described number of labels judge module, is also suitable for judged result being informed to described label closing module;
Described label closing module, is also suitable for when the judged result of the described number of labels judge module received is the label only comprised in browser wait closing, and completes after label is closed and generates new label, and present this new label.
3. device according to claim 1, wherein,
Described label closing module, is further adapted for after completing label closedown, makes the label be switched to obtain browser focus, to present the label be switched in the display interface of browser.
4. close a method for label in browser, described method comprises:
When receiving the instruction of closing label, judging whether label to be closed has father's label, if having father's label, then judging whether this father's label has multiple subtab further;
If this father's label has multiple subtab, then complete label and close, the current label presented is switched to a subtab of this father's label found;
If this father's label only with this label to be closed for subtab, then complete label close, the current label presented is switched to this father's label;
Described subtab is the label by clicking the webpage for loading this link that link generates in described father's label;
Wherein, described method also comprises:
When not there is father's label wait the label of closing, judge whether label to be closed is positioned at browser last;
If it is last to be positioned at browser, then completes label and close, the current label presented is switched to the upper label before the label of closedown;
Last if not being positioned at browser, then complete label and close, the current label presented is switched to the next label after the label of closedown.
5. method according to claim 4, wherein,
Judging also to comprise before whether label to be closed has father's label:
Judge whether only comprise label to be closed in browser, if so, then complete after label is closed and generate new label, and present this new label.
6. method according to claim 4, wherein,
The described subtab of this father's label found that switched to by the current label presented comprises further:
The subtab be switched to is made to obtain browser focus, to present this subtab in the display interface of browser;
Describedly this father's label is switched to comprise further on the current label presented:
The father's label be switched to is made to obtain browser focus, to present this father's label in the display interface of browser.
CN201210535434.2A 2012-12-12 2012-12-12 The apparatus and method of label are closed in browser CN103019715B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210535434.2A CN103019715B (en) 2012-12-12 2012-12-12 The apparatus and method of label are closed in browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210535434.2A CN103019715B (en) 2012-12-12 2012-12-12 The apparatus and method of label are closed in browser

Publications (2)

Publication Number Publication Date
CN103019715A CN103019715A (en) 2013-04-03
CN103019715B true CN103019715B (en) 2015-11-25

Family

ID=47968353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210535434.2A CN103019715B (en) 2012-12-12 2012-12-12 The apparatus and method of label are closed in browser

Country Status (1)

Country Link
CN (1) CN103019715B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412873B (en) * 2013-07-09 2017-03-01 百度在线网络技术(北京)有限公司 A kind of method and apparatus for amplifying Web page module

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101539912A (en) * 2008-03-18 2009-09-23 林福来 Method for browsing webpages by tree browser
CN102033943A (en) * 2010-12-21 2011-04-27 广州市动景计算机科技有限公司 Multiwindow browse method and system based on mobile communication equipment terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040030719A1 (en) * 2002-02-13 2004-02-12 Jie Wei Web page based dynamic book for document presentation and operation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101539912A (en) * 2008-03-18 2009-09-23 林福来 Method for browsing webpages by tree browser
CN102033943A (en) * 2010-12-21 2011-04-27 广州市动景计算机科技有限公司 Multiwindow browse method and system based on mobile communication equipment terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
值得一用Firefox2_0秘籍一箩筐;小老虎;《电脑爱好者》;20070831(第8期);40 *

Also Published As

Publication number Publication date
CN103019715A (en) 2013-04-03

Similar Documents

Publication Publication Date Title
Buels et al. JBrowse: a dynamic web platform for genome visualization and analysis
CN102917023B (en) A kind of method based on Quick Response Code accessed web page and mobile terminal
Brambilla et al. Extending the interaction flow modeling language (IFML) for model driven development of mobile applications front end
CN103501340B (en) Information push method, device and client
CN102597993B (en) Managing application state information by means of uniform resource identifier (URI)
JP5216845B2 (en) Technology for sharing information between application programs
ES2791689T3 (en) Menu and augmented search settings for computer applications
US8433996B2 (en) Hierarchical model for web browser navigation
CN103955364B (en) A kind of front end assemblies method suitable for mobile phone
CN105550356A (en) Preloading method of browsed contents, and terminal
CN101651576B (en) Alarm information processing method and system
CN101770339B (en) System and method for tracking and recording according to user behavior
CN1849584B (en) Methods and apparatus for dynamic optimal match compilation of mixed mode instructions
WO2014179819A2 (en) Software design pattern for adapting a graph database visualization software
US20110302516A1 (en) Mobile design patterns
CN104572043A (en) Method and device for embedding points for controls of client application in real time
TWI591496B (en) Generate, update the the pages of methods and equipment
CN102541529B (en) A kind of query page generating device and method
CN101930400B (en) SDK (Software Development Kit) automatic test system and method
CN102929997B (en) The display packing of browser label and device
CN104572968B (en) A kind of method for updating pages and device
CN104461898A (en) Application testing method, center control server, test terminal and system
US20070067726A1 (en) Content sharing user interface for mobile devices
EP2107475A1 (en) Electronic resource anotation
CN105138312B (en) A kind of table generation method and device

Legal Events

Date Code Title Description
PB01 Publication
C06 Publication
SE01 Entry into force of request for substantive examination
C10 Entry into substantive examination
GR01 Patent grant
C14 Grant of patent or utility model