En fonction de l'importance, je voudrais écrire un plugin simple à gérer cela.
EDIT: Tout ce que vous vraiment besoin de faire est la suivante:
1) Créer le plugin à partir des modèles avec le RCP \ Eclipse PDE installer
2) Ajoutez le code suivant à votre activateur ..
@Override
public void start(final BundleContext context) throws Exception {
super.start(context);
plugin = this;
ICommandService commandService = (ICommandService)plugin.getWorkbench().getService(ICommandService.class);
commandService.addExecutionListener(new IExecutionListener() {
public void notHandled(final String commandId, final NotHandledException exception) {}
public void postExecuteFailure(final String commandId, final ExecutionException exception) {}
public void postExecuteSuccess(final String commandId, final Object returnValue) {
if (commandId.equals("org.eclipse.ui.file.save")) {
// add in your action here...
// personally, I would use a custom preference page,
// but hard coding would work ok too
}
}
public void preExecute(final String commandId, final ExecutionEvent event) {}
});
}
Les actions de l'éditeur "on save" sont connectables via le point d'extension et cela semble être un ajout utile. – cjstehno