由於我們無法將Eclipse的RSE設置爲使用該工具進行遠程編輯,因此我已安裝Unison。但是,如何讓Eclipse在每次保存文件時自動運行一致?有沒有一個eclipse插件可用於此?保存在Eclipse中運行外部應用程序
TIA
由於我們無法將Eclipse的RSE設置爲使用該工具進行遠程編輯,因此我已安裝Unison。但是,如何讓Eclipse在每次保存文件時自動運行一致?有沒有一個eclipse插件可用於此?保存在Eclipse中運行外部應用程序
TIA
根據不同的重要性,我會寫一個簡單的插件來處理這個問題。
編輯: 所有你真的需要做的是:
1)從創建與RCP \ Eclipse的PDE模板插件安裝
2)下面的代碼添加到您激活..
@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) {}
});
}
您可以將其設置爲在每個版本上運行。任何外部工具都可以在每個構建中運行,只需打開項目的首選項,進入構建器頁面,單擊「新建...」。
在最新版本的Eclipse中,您可以通過在構建器屬性的「構建選項」選項卡上選中「在自動構建期間」將構建器設置爲保存運行。 – machineghost 2012-10-14 05:22:45
編輯「保存」操作可通過擴展點插入,聽起來像是一個有用的補充。 – cjstehno 2009-08-26 19:53:48