2012-05-21 19:37:30 +00:00
|
|
|
/**
|
|
|
|
* Creates an ve.ui.Tool object.
|
2012-06-13 23:06:21 +00:00
|
|
|
*
|
2012-05-21 19:37:30 +00:00
|
|
|
* @class
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
|
|
* @param {String} name
|
|
|
|
*/
|
|
|
|
ve.ui.Tool = function( toolbar, name, title ) {
|
|
|
|
this.toolbar = toolbar;
|
|
|
|
this.name = name;
|
|
|
|
this.title = title;
|
|
|
|
this.$ = $( '<div class="es-tool"></div>' ).attr( 'title', this.title );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Static Members */
|
|
|
|
|
|
|
|
ve.ui.Tool.tools = {};
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
ve.ui.Tool.prototype.updateState = function() {
|
|
|
|
throw 'Tool.updateState not implemented in this subclass:' + this.constructor;
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.ui.Tool.prototype.clearState = function() {
|
|
|
|
this.$.removeClass( 'es-toolbarButtonTool-down' );
|
|
|
|
};
|