blob: 83c05ecf53bb1fdae171dda8164b1bfdad90d468 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../orion/plugin.js"></script>
<script type="text/javascript" src="../org.dojotoolkit/dojo/dojo.js.uncompressed.js"></script>
<script>
window.onload = function() {
var provider = new eclipse.PluginProvider({postInstallUrl:"/plugin/list.html"});
provider.registerServiceProvider("orion.navigate.command", {
run : function(item) {
window.alert("Running code on: " + item.Location);
}
}, {
image: "../profile/images/create_user.gif",
name: "Run Code on Single Item",
id: "sample.commands.sample1",
forceSingleItem: true,
tooltip: "Run plugin code only on single file/dir"
});
provider.registerServiceProvider("orion.navigate.command", {
run : function(item) {
var clientDeferred = new dojo.Deferred();
window.setTimeout(function () {
clientDeferred.callback(item.Location);
}, 5000);
return clientDeferred;
}
}, {
image: "../images/gear.gif",
name: "Open HTML in 5 seconds",
id: "sample.commands.sample11",
forceSingleItem: true,
href: true,
validationProperties: {"Name":"*.html"},
tooltip: "Show how a deferred can be used to do asynchronous computation"
});
provider.registerServiceProvider("orion.navigate.command", {
run : function(item) {
return item.Location;
}
}, {
image: "../profile/images/create_user.gif",
name: "Open HTML Raw",
id: "sample.commands.sample2",
forceSingleItem: true,
href: true,
validationProperties: {"Name":"*.html"},
tooltip: "Link to raw html on server"
});
provider.registerServiceProvider("orion.navigate.command", {
run : function(items) {
var locations = [];
for (var i = 0; i<items.length; i++) {
locations.push(items[i].Location);
}
window.alert("Bulk operation on: " + locations);
}
}, {
image: "../profile/images/create_user.gif",
name: "Bulk Item Command",
id: "sample.commands.sample3",
tooltip: "Bulk command operates on selections"
});
provider.registerServiceProvider("orion.navigate.command", {
run : function(item) {
return "http://www.google.com/#q=" + item.Name;
}
}, {
image: "http://www.google.com/favicon.ico",
name: "Google Search",
id: "sample.commands.sample4",
forceSingleItem: true,
href: true,
tooltip: "Link to google search for this file name"
});
provider.connect();
};
</script>
</head>
<body>
</body>
</html>