if (designEditor.getEditorInput() != null && designEditor.getEditorInput() instanceof ICamelEditorInput) {
ICamelEditorInput camelInput = (ICamelEditorInput) designEditor.getEditorInput();
IDocument doc = getDocument();
if (doc != null) {
String xml = doc.get();
camelInput.save(xml);
}
} else {
// then we call the save method of the text editor
sourceEditor.doSave(monitor);
}