public class ProxyPassthrough extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IHttpProxyService proxyService = Activator.getDefault().getProxyService();
if(proxyService == null) {
Shell shell = HandlerUtil.getActiveWorkbenchWindow(event).getShell();
ErrorDialog.displayError(shell, "Proxy service is null");
return null;
}
final boolean oldValue = HandlerUtil.toggleCommandState(event.getCommand());
proxyService.setPassthrough(!oldValue);
return null;
}