
Ui.Button.extend('Ui.ActionButton', {
	action: undefined,
	selection: undefined,

	constructor: function(config) {
		this.action = config.action;
		delete(config.action);
		this.selection = config.selection;
		delete(config.selection);

		this.connect(this.getDropBox(), 'drop', this.onActionButtonDrop);
		this.connect(this, 'press', this.onActionButtonDrop);

		this.getDropBox().addType('all', this.onActionButtonEffect.bind(this));
	},

	onActionButtonEffect: function(data, dataTransfer) {
		if('draggable' in dataTransfer) {
			var elements = this.selection.getElements();
			var found = undefined;
			for(var i = 0; (found === undefined) && (i < elements.length); i++) {
				if(elements[i] === dataTransfer.draggable)
					found = elements[i];
			}
			if(found !== undefined)
				return [ 'run' ];
		}
		return [];
	},

	onActionButtonDrop: function() {
		var scope = this;
		if('scope' in this.action)
			scope = this.action.scope;
		this.action.callback.call(scope, this.selection);
		// clear the selection after the action done
		this.selection.clear();
	}
});

@@ -1062,12 +1062,199 @@
 r();%0A%09%7D%0A
+%7D, %7B%7D, %7B%0A%09style: %7B%0A%09%09textTransform: 'uppercase',%0A%09%09radius: 0,%0A%09%09borderWidth: 0,%0A%09%09background: 'rgba(250,250,250,0)',%0A%09%09backgroundBorder: 'rgba(250,250,250,0)',%0A%09%09focusColor: '#f6caa2'%0A%09%7D%0A
 %7D);%0A

set a default style