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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 this.create(Snippets.scriptSnippetModel.project(), ''); | 270 this.create(Snippets.scriptSnippetModel.project(), ''); |
271 } | 271 } |
272 | 272 |
273 /** | 273 /** |
274 * @override | 274 * @override |
275 */ | 275 */ |
276 sourceDeleted(uiSourceCode) { | 276 sourceDeleted(uiSourceCode) { |
277 this._handleRemoveSnippet(uiSourceCode); | 277 this._handleRemoveSnippet(uiSourceCode); |
278 } | 278 } |
279 }; | 279 }; |
| 280 |
| 281 /** |
| 282 * @implements {UI.ActionDelegate} |
| 283 */ |
| 284 Sources.SourcesNavigatorView.CreatingActionDelegate = class { |
| 285 /** |
| 286 * @override |
| 287 * @param {!UI.Context} context |
| 288 * @param {string} actionId |
| 289 * @return {boolean} |
| 290 */ |
| 291 handleAction(context, actionId) { |
| 292 switch (actionId) { |
| 293 case 'sources.create-snippet': |
| 294 var uiSourceCode = Snippets.scriptSnippetModel.createScriptSnippet(''); |
| 295 Common.Revealer.reveal(uiSourceCode); |
| 296 return true; |
| 297 case 'sources.add-folder-to-workspace': |
| 298 Workspace.isolatedFileSystemManager.addFileSystem(); |
| 299 return true; |
| 300 } |
| 301 return false; |
| 302 } |
| 303 }; |
OLD | NEW |