OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 /** | 534 /** |
535 * @param {!Workspace.UISourceCode.Message.Level} level | 535 * @param {!Workspace.UISourceCode.Message.Level} level |
536 * @param {string} text | 536 * @param {string} text |
537 * @param {number} lineNumber | 537 * @param {number} lineNumber |
538 * @param {number=} columnNumber | 538 * @param {number=} columnNumber |
539 * @return {!Workspace.UISourceCode.Message} message | 539 * @return {!Workspace.UISourceCode.Message} message |
540 */ | 540 */ |
541 addLineMessage(level, text, lineNumber, columnNumber) { | 541 addLineMessage(level, text, lineNumber, columnNumber) { |
542 return this.addMessage( | 542 return this.addMessage( |
543 level, text, new Common.TextRange(lineNumber, columnNumber || 0, lineNum
ber, columnNumber || 0)); | 543 level, text, new TextUtils.TextRange(lineNumber, columnNumber || 0, line
Number, columnNumber || 0)); |
544 } | 544 } |
545 | 545 |
546 /** | 546 /** |
547 * @param {!Workspace.UISourceCode.Message.Level} level | 547 * @param {!Workspace.UISourceCode.Message.Level} level |
548 * @param {string} text | 548 * @param {string} text |
549 * @param {!Common.TextRange} range | 549 * @param {!TextUtils.TextRange} range |
550 * @return {!Workspace.UISourceCode.Message} message | 550 * @return {!Workspace.UISourceCode.Message} message |
551 */ | 551 */ |
552 addMessage(level, text, range) { | 552 addMessage(level, text, range) { |
553 var message = new Workspace.UISourceCode.Message(this, level, text, range); | 553 var message = new Workspace.UISourceCode.Message(this, level, text, range); |
554 if (!this._messages) | 554 if (!this._messages) |
555 this._messages = new Set(); | 555 this._messages = new Set(); |
556 this._messages.add(message); | 556 this._messages.add(message); |
557 this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageAdded, me
ssage); | 557 this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageAdded, me
ssage); |
558 return message; | 558 return message; |
559 } | 559 } |
(...skipping 13 matching lines...) Expand all Loading... |
573 this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageRemoved
, message); | 573 this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageRemoved
, message); |
574 this._messages = null; | 574 this._messages = null; |
575 } | 575 } |
576 | 576 |
577 /** | 577 /** |
578 * @param {number} lineNumber | 578 * @param {number} lineNumber |
579 * @param {string} type | 579 * @param {string} type |
580 * @param {?} data | 580 * @param {?} data |
581 */ | 581 */ |
582 addLineDecoration(lineNumber, type, data) { | 582 addLineDecoration(lineNumber, type, data) { |
583 this.addDecoration(Common.TextRange.createFromLocation(lineNumber, 0), type,
data); | 583 this.addDecoration(TextUtils.TextRange.createFromLocation(lineNumber, 0), ty
pe, data); |
584 } | 584 } |
585 | 585 |
586 /** | 586 /** |
587 * @param {!Common.TextRange} range | 587 * @param {!TextUtils.TextRange} range |
588 * @param {string} type | 588 * @param {string} type |
589 * @param {?} data | 589 * @param {?} data |
590 */ | 590 */ |
591 addDecoration(range, type, data) { | 591 addDecoration(range, type, data) { |
592 var marker = new Workspace.UISourceCode.LineMarker(range, type, data); | 592 var marker = new Workspace.UISourceCode.LineMarker(range, type, data); |
593 if (!this._decorations) | 593 if (!this._decorations) |
594 this._decorations = new Multimap(); | 594 this._decorations = new Multimap(); |
595 this._decorations.set(type, marker); | 595 this._decorations.set(type, marker); |
596 this.dispatchEventToListeners(Workspace.UISourceCode.Events.LineDecorationAd
ded, marker); | 596 this.dispatchEventToListeners(Workspace.UISourceCode.Events.LineDecorationAd
ded, marker); |
597 } | 597 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 }; | 797 }; |
798 | 798 |
799 /** | 799 /** |
800 * @unrestricted | 800 * @unrestricted |
801 */ | 801 */ |
802 Workspace.UISourceCode.Message = class { | 802 Workspace.UISourceCode.Message = class { |
803 /** | 803 /** |
804 * @param {!Workspace.UISourceCode} uiSourceCode | 804 * @param {!Workspace.UISourceCode} uiSourceCode |
805 * @param {!Workspace.UISourceCode.Message.Level} level | 805 * @param {!Workspace.UISourceCode.Message.Level} level |
806 * @param {string} text | 806 * @param {string} text |
807 * @param {!Common.TextRange} range | 807 * @param {!TextUtils.TextRange} range |
808 */ | 808 */ |
809 constructor(uiSourceCode, level, text, range) { | 809 constructor(uiSourceCode, level, text, range) { |
810 this._uiSourceCode = uiSourceCode; | 810 this._uiSourceCode = uiSourceCode; |
811 this._level = level; | 811 this._level = level; |
812 this._text = text; | 812 this._text = text; |
813 this._range = range; | 813 this._range = range; |
814 } | 814 } |
815 | 815 |
816 /** | 816 /** |
817 * @return {!Workspace.UISourceCode} | 817 * @return {!Workspace.UISourceCode} |
(...skipping 10 matching lines...) Expand all Loading... |
828 } | 828 } |
829 | 829 |
830 /** | 830 /** |
831 * @return {string} | 831 * @return {string} |
832 */ | 832 */ |
833 text() { | 833 text() { |
834 return this._text; | 834 return this._text; |
835 } | 835 } |
836 | 836 |
837 /** | 837 /** |
838 * @return {!Common.TextRange} | 838 * @return {!TextUtils.TextRange} |
839 */ | 839 */ |
840 range() { | 840 range() { |
841 return this._range; | 841 return this._range; |
842 } | 842 } |
843 | 843 |
844 /** | 844 /** |
845 * @return {number} | 845 * @return {number} |
846 */ | 846 */ |
847 lineNumber() { | 847 lineNumber() { |
848 return this._range.startLine; | 848 return this._range.startLine; |
(...skipping 26 matching lines...) Expand all Loading... |
875 Workspace.UISourceCode.Message.Level = { | 875 Workspace.UISourceCode.Message.Level = { |
876 Error: 'Error', | 876 Error: 'Error', |
877 Warning: 'Warning' | 877 Warning: 'Warning' |
878 }; | 878 }; |
879 | 879 |
880 /** | 880 /** |
881 * @unrestricted | 881 * @unrestricted |
882 */ | 882 */ |
883 Workspace.UISourceCode.LineMarker = class { | 883 Workspace.UISourceCode.LineMarker = class { |
884 /** | 884 /** |
885 * @param {!Common.TextRange} range | 885 * @param {!TextUtils.TextRange} range |
886 * @param {string} type | 886 * @param {string} type |
887 * @param {?} data | 887 * @param {?} data |
888 */ | 888 */ |
889 constructor(range, type, data) { | 889 constructor(range, type, data) { |
890 this._range = range; | 890 this._range = range; |
891 this._type = type; | 891 this._type = type; |
892 this._data = data; | 892 this._data = data; |
893 } | 893 } |
894 | 894 |
895 /** | 895 /** |
896 * @return {!Common.TextRange} | 896 * @return {!TextUtils.TextRange} |
897 */ | 897 */ |
898 range() { | 898 range() { |
899 return this._range; | 899 return this._range; |
900 } | 900 } |
901 | 901 |
902 /** | 902 /** |
903 * @return {string} | 903 * @return {string} |
904 */ | 904 */ |
905 type() { | 905 type() { |
906 return this._type; | 906 return this._type; |
(...skipping 13 matching lines...) Expand all Loading... |
920 Workspace.UISourceCodeMetadata = class { | 920 Workspace.UISourceCodeMetadata = class { |
921 /** | 921 /** |
922 * @param {?Date} modificationTime | 922 * @param {?Date} modificationTime |
923 * @param {?number} contentSize | 923 * @param {?number} contentSize |
924 */ | 924 */ |
925 constructor(modificationTime, contentSize) { | 925 constructor(modificationTime, contentSize) { |
926 this.modificationTime = modificationTime; | 926 this.modificationTime = modificationTime; |
927 this.contentSize = contentSize; | 927 this.contentSize = contentSize; |
928 } | 928 } |
929 }; | 929 }; |
OLD | NEW |