Skip to main content

Project API Introduction

By default, netDecor provides a standard project toolbar with "New", "Open", "Save", and "Save As" actions. In API v2, only the Save and Open events were exposed. The v3 API lets you redesign project management from the ground up. The addButton method disables the default buttons and lets you add fully configurable buttons to the panel. Together with the other methods in the Project API, you can implement a completely custom project workflow.

Example

This example creates the standard toolbar and adds an extra Share button.

note

This example only creates buttons and registers click handlers. The onclick functions are placeholders; they do not implement persistence, file dialogs, or backend integration. You need to provide the actual implementation.

var newButton = NetDecor.v3.project.addButton({
label: { en:"New", pl: "Nowy" },
icon: "New",
shortcut:{
flags:["LCtrl"],
key:"N"
},
onclick: function () {
// implementation
}
});

var openButton = NetDecor.v3.project.addButton({
label: { en:"Open", pl: "Otwórz" },
icon: "Open",
shortcut:{
flags:["LCtrl"],
key:"O"
},
onclick: function () {
// implementation
}
});

var saveButton = NetDecor.v3.project.addButton({
label: { en:"Save", pl: "Zapisz" },
icon: "Save",
shortcut:{
flags:["LCtrl"],
key:"S"
},
onclick: function () {
// implementation
}
});


var saveAsButton = NetDecor.v3.project.addButton({
label: { en:"Save as", pl: "Zapisz jako" },
icon: "SaveAs",
onclick: function () {
// implementation
}
});

var shareButton = NetDecor.v3.project.addButton({
label: { en:"Share", pl: "Udostępnij" },
icon: "Share",
onclick: function () {
// implementation
}
});

See also

addButton IconResourceId