Gre*_*ory 4 eclipse eclipse-plugin unison
由于我们无法将Eclipse的RSE设置为用于远程编辑的工具,因此我安装了Unison.但是如何让Eclipse在每个文件保存中自动运行unison?是否有可用的eclipse插件?
TIA
根据重要性,我会写一个简单的插件来处理这个问题.
编辑:你真正需要做的就是:
1)使用RCP\PDE Eclipse安装从模板创建插件
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 ) {}
} );
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2532 次 |
最近记录: |