Rename ui.Tool.static.canEditModel to isCompatibleWith

Change-Id: Ic7583f0966946c870f38a2e7ad06e558238c8794
This commit is contained in:
Trevor Parscal 2013-10-16 00:26:21 +02:00 committed by Timo Tijhof
parent 36fc3b5911
commit e41d4d470f
4 changed files with 10 additions and 10 deletions

View file

@ -39,7 +39,7 @@ ve.ui.DialogTool.static.dialog = '';
/**
* Annotation or node models this tool is related to.
*
* Used by #canEditModel.
* Used by #isCompatibleWith.
*
* @static
* @property {Function[]}
@ -50,7 +50,7 @@ ve.ui.DialogTool.static.modelClasses = [];
/**
* @inheritdoc
*/
ve.ui.DialogTool.static.canEditModel = function ( model ) {
ve.ui.DialogTool.static.isCompatibleWith = function ( model ) {
return ve.isInstanceOfAny( model, this.modelClasses );
};

View file

@ -39,7 +39,7 @@ ve.ui.InspectorTool.static.inspector = '';
/**
* Annotation or node models this tool is related to.
*
* Used by #canEditModel.
* Used by #isCompatibleWith.
*
* @static
* @property {Function[]}
@ -50,7 +50,7 @@ ve.ui.InspectorTool.static.modelClasses = [];
/**
* @inheritdoc
*/
ve.ui.InspectorTool.static.canEditModel = function ( model ) {
ve.ui.InspectorTool.static.isCompatibleWith = function ( model ) {
return ve.isInstanceOfAny( model, this.modelClasses );
};

View file

@ -127,15 +127,15 @@ ve.ui.Tool.static.titleMessage = '';
ve.ui.Tool.static.autoAdd = true;
/**
* Check if this tool can be used on a model.
* Check if this tool is compatible with given data.
*
* @method
* @static
* @inheritable
* @param {ve.dm.Model} model Model to check
* @returns {boolean} Tool can be used to edit model
* @param {Mixed} data Data to check
* @returns {boolean} Tool can be used with data
*/
ve.ui.Tool.static.canEditModel = function () {
ve.ui.Tool.static.isCompatibleWith = function () {
return false;
};

View file

@ -145,7 +145,7 @@ ve.ui.ToolFactory.prototype.getToolsForAnnotations = function ( annotations ) {
candidateTool = null;
for ( name in this.registry ) {
tool = this.registry[name];
if ( tool.static.canEditModel( annotation ) ) {
if ( tool.static.isCompatibleWith( annotation ) ) {
if ( !candidateTool || tool.prototype instanceof candidateTool ) {
candidateTool = tool;
candidateToolName = name;
@ -182,7 +182,7 @@ ve.ui.ToolFactory.prototype.getToolForNode = function ( node ) {
for ( name in this.registry ) {
tool = this.registry[name];
if ( tool.static.canEditModel( node ) ) {
if ( tool.static.isCompatibleWith( node ) ) {
if ( !candidateTool || tool.prototype instanceof candidateTool ) {
candidateTool = tool;
candidateToolName = name;