displayName: function() { },
/**
+ * @return {string}
+ */
+ url: function() { },
+
+ /**
* @param {string} path
* @param {function(?Date, ?number)} callback
*/
}
/**
+ * @constructor
+ * @extends {WebInspector.Object}
* @param {!WebInspector.Workspace} workspace
* @param {string} projectId
* @param {!WebInspector.ProjectDelegate} projectDelegate
- * @constructor
*/
WebInspector.Project = function(workspace, projectId, projectDelegate)
{
this._workspace = workspace;
this._projectId = projectId;
this._projectDelegate = projectDelegate;
+ this._url = this._projectDelegate.url();
this._displayName = this._projectDelegate.displayName();
}
+/**
+ * @enum {string}
+ */
+WebInspector.Project.Events = {
+ DisplayNameUpdated: "DisplayNameUpdated"
+};
+
WebInspector.Project.prototype = {
/**
* @return {string}
},
/**
+ * @param {string} displayName
+ */
+ setDisplayName: function(displayName)
+ {
+ if (this._displayName === displayName)
+ return;
+ this._displayName = displayName;
+ this.dispatchEventToListeners(WebInspector.Project.Events.DisplayNameUpdated);
+ },
+
+ /**
+ * @return {string}
+ */
+ url: function()
+ {
+ return this._url;
+ },
+
+ /**
* @return {boolean}
*/
isServiceProject: function()
indexContent: function(progress)
{
this._projectDelegate.indexContent(progress);
- }
+ },
+
+ __proto__: WebInspector.Object.prototype
}
/**
UISourceCodeAdded: "UISourceCodeAdded",
UISourceCodeRemoved: "UISourceCodeRemoved",
UISourceCodeContentCommitted: "UISourceCodeContentCommitted",
+ ProjectAdded: "ProjectAdded",
ProjectRemoved: "ProjectRemoved"
}
var project = new WebInspector.Project(this, projectId, projectDelegate);
this._projects[projectId] = project;
var projectStore = new WebInspector.ProjectStore(project);
+ this.dispatchEventToListeners(WebInspector.Workspace.Events.ProjectAdded, project);
return projectStore;
},