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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 25 matching lines...) Expand all Loading... |
36 * @param {!WebInspector.UISourceCode} uiSourceCode | 36 * @param {!WebInspector.UISourceCode} uiSourceCode |
37 * @return {!WebInspector.SourceFrame} | 37 * @return {!WebInspector.SourceFrame} |
38 */ | 38 */ |
39 viewForFile: function(uiSourceCode) { }, | 39 viewForFile: function(uiSourceCode) { }, |
40 } | 40 } |
41 | 41 |
42 /** | 42 /** |
43 * @constructor | 43 * @constructor |
44 * @extends {WebInspector.Object} | 44 * @extends {WebInspector.Object} |
45 * @param {!WebInspector.TabbedEditorContainerDelegate} delegate | 45 * @param {!WebInspector.TabbedEditorContainerDelegate} delegate |
46 * @param {string} settingName | 46 * @param {!WebInspector.Setting} setting |
47 * @param {string} placeholderText | 47 * @param {string} placeholderText |
48 */ | 48 */ |
49 WebInspector.TabbedEditorContainer = function(delegate, settingName, placeholder
Text) | 49 WebInspector.TabbedEditorContainer = function(delegate, setting, placeholderText
) |
50 { | 50 { |
51 WebInspector.Object.call(this); | 51 WebInspector.Object.call(this); |
52 this._delegate = delegate; | 52 this._delegate = delegate; |
53 | 53 |
54 this._tabbedPane = new WebInspector.TabbedPane(); | 54 this._tabbedPane = new WebInspector.TabbedPane(); |
55 this._tabbedPane.setPlaceholderText(placeholderText); | 55 this._tabbedPane.setPlaceholderText(placeholderText); |
56 this._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(
this)); | 56 this._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(
this)); |
57 | 57 |
58 this._tabbedPane.setCloseableTabs(true); | 58 this._tabbedPane.setCloseableTabs(true); |
59 this._tabbedPane.element.id = "sources-editor-container-tabbed-pane"; | 59 this._tabbedPane.element.id = "sources-editor-container-tabbed-pane"; |
60 | 60 |
61 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabClos
ed, this._tabClosed, this); | 61 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabClos
ed, this._tabClosed, this); |
62 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted, this._tabSelected, this); | 62 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted, this._tabSelected, this); |
63 | 63 |
64 this._tabIds = new Map(); | 64 this._tabIds = new Map(); |
65 this._files = {}; | 65 this._files = {}; |
66 | 66 |
67 this._previouslyViewedFilesSetting = WebInspector.settings.createSetting(set
tingName, []); | 67 this._previouslyViewedFilesSetting = setting; |
68 this._history = WebInspector.TabbedEditorContainer.History.fromObject(this._
previouslyViewedFilesSetting.get()); | 68 this._history = WebInspector.TabbedEditorContainer.History.fromObject(this._
previouslyViewedFilesSetting.get()); |
69 } | 69 } |
70 | 70 |
71 WebInspector.TabbedEditorContainer.Events = { | 71 WebInspector.TabbedEditorContainer.Events = { |
72 EditorSelected: "EditorSelected", | 72 EditorSelected: "EditorSelected", |
73 EditorClosed: "EditorClosed" | 73 EditorClosed: "EditorClosed" |
74 } | 74 } |
75 | 75 |
76 WebInspector.TabbedEditorContainer._tabId = 0; | 76 WebInspector.TabbedEditorContainer._tabId = 0; |
77 | 77 |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 /** | 731 /** |
732 * @override | 732 * @override |
733 * @param {!WebInspector.TabbedPane} tabbedPane | 733 * @param {!WebInspector.TabbedPane} tabbedPane |
734 * @param {!Array.<string>} ids | 734 * @param {!Array.<string>} ids |
735 */ | 735 */ |
736 closeTabs: function(tabbedPane, ids) | 736 closeTabs: function(tabbedPane, ids) |
737 { | 737 { |
738 this._editorContainer._closeTabs(ids); | 738 this._editorContainer._closeTabs(ids); |
739 } | 739 } |
740 } | 740 } |
OLD | NEW |