blob: 1b40467428c0e0be325c23d09d27ca4f83069958 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../org.dojotoolkit/dojo/dojo.js.uncompressed.js"></script>
<script type="text/javascript" src="../orion/plugin.js"></script>
<script>
window.onload = function() {
var provider = new eclipse.PluginProvider();
provider.registerServiceProvider("orion.edit.command", {
run : function(text) {
// return text.toUpperCase(); <-- original call
var d = new dojo.Deferred(); // create a promise
setTimeout(function() { // wait two seconds
d.resolve(text.toUpperCase()); // then "resolve" the promise - do the regular call
}, 2000);
return d; // return the promise immediately
}
}, {
name : "UPPERCASE_ASYNC",
img : "../images/gear.gif",
key : [ "a", true ]
});
provider.connect();
};
</script>
</head>
<body>
</body>
</html>