@Override public void writeExternal(Element element) throws WriteExternalException { Settings settings = new Settings(); settings.host = this.host; settings.port = this.port; settings.route = this.route; if (this.browser != null) settings.browser = this.browser.getId().toString(); else settings.browser = ""; if (this.interpreter != null) settings.interpreterName = this.interpreter.getName(); else settings.interpreterName = ""; XmlSerializer.serializeInto(settings, element, new SkipDefaultsSerializationFilter()); super.writeExternal(element); }
@Nullable @Override public Element getState() { Element state = XmlSerializer.serialize(this, new SkipDefaultsSerializationFilter()); try { DebuggerUtilsEx.writeFilters(state, "filter", mySteppingFilters); } catch(WriteExternalException e) { LOG.error(e); return null; } for(ContentState eachState : myContentStates.values()) { final Element content = new Element("content"); if(eachState.write(content)) { state.addContent(content); } } return state; }
@Override public Element getState() { Element element = XmlSerializer.serialize(this, new SkipDefaultsSerializationFilter()); String profile = InspectionProfileManagerImpl.getInstanceImpl().getRootProfileName(); if (!InspectionProfileImpl.DEFAULT_PROFILE_NAME.equals(profile)) { element.setAttribute("profile", profile); } return element; }
@Override public void initComponent() { final HttpConfigurable currentState = getState(); if (currentState != null) { final Element serialized = XmlSerializer.serializeIfNotDefault(currentState, new SkipDefaultsSerializationFilter()); if (serialized == null) { // all settings are defaults // trying user's proxy configuration entered while obtaining the license final SharedProxyConfig.ProxyParameters cfg = SharedProxyConfig.load(); if (cfg != null) { SharedProxyConfig.clear(); if (cfg.host != null) { USE_HTTP_PROXY = true; PROXY_HOST = cfg.host; PROXY_PORT = cfg.port; if (cfg.login != null) { setPlainProxyPassword(new String(cfg.password)); storeSecure("proxy.login", cfg.login); PROXY_AUTHENTICATION = true; KEEP_PROXY_PASSWORD = true; } } } } } mySelector = new IdeaWideProxySelector(this); String name = getClass().getName(); CommonProxy.getInstance().setCustom(name, mySelector); CommonProxy.getInstance().setCustomAuth(name, new IdeaWideAuthenticator(this)); }