final IHttpProxyService proxyService = getProxyService();
proxyService.setListenerConfigs((IHttpProxyListenerConfig[]) listenerList.toArray(new IHttpProxyListenerConfig[0]));
}
private void setProxyTransactionManipulator() {
final IHttpProxyTransactionManipulator manipulator = getProxyService().getTransactionManipulator();
final IPreferenceStore preferenceStore = getPreferenceStore();
manipulator.setUserAgent(preferenceStore.getString(IPreferenceConstants.P_USER_AGENT));
manipulator.setUserAgentOverride(preferenceStore.getBoolean(IPreferenceConstants.P_USER_AGENT_OVERRIDE));
manipulator.setBrowserCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_BROWSER_CACHE));
manipulator.setProxyCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_PROXY_CACHE));
preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
final IHttpProxyTransactionManipulator manipulator = getProxyService().getTransactionManipulator();
final String property = event.getProperty();
if (property == IPreferenceConstants.P_USER_AGENT) {
manipulator.setUserAgent(preferenceStore.getString(IPreferenceConstants.P_USER_AGENT));
} else if (property == IPreferenceConstants.P_USER_AGENT_OVERRIDE) {
manipulator.setUserAgentOverride(preferenceStore.getBoolean(IPreferenceConstants.P_USER_AGENT_OVERRIDE));
} else if (property == IPreferenceConstants.P_DISABLE_BROWSER_CACHE) {
manipulator.setBrowserCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_BROWSER_CACHE));
} else if (property == IPreferenceConstants.P_DISABLE_PROXY_CACHE) {
manipulator.setProxyCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_PROXY_CACHE));
}
}
});
}