@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); ConfigurationState state = XmlSerializer.deserialize(element, ConfigurationState.class); myServerName = null; myDeploymentSource = null; if (state != null) { myServerName = state.myServerName; if (!state.myDeploymentItemState.isEmpty()) { DeploymentItemState itemState = state.myDeploymentItemState.get(0); myDeploymentSource = itemState.createSource(getProject()); myDeploymentConfiguration = myDeploymentConfigurator.createDefaultConfiguration(myDeploymentSource); if (itemState.mySettings != null) { ComponentSerializationUtil.loadComponentState(myDeploymentConfiguration.getSerializer(), itemState.mySettings); } } } }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); ConfigurationState state = XmlSerializer.deserialize(element, ConfigurationState.class); myServerName = null; myDeploymentSource = null; if (state != null) { myServerName = state.myServerName; Element deploymentTag = state.myDeploymentTag; if (deploymentTag != null) { String typeId = deploymentTag.getAttributeValue(DEPLOYMENT_SOURCE_TYPE_ATTRIBUTE); DeploymentSourceType<?> type = findDeploymentSourceType(typeId); if (type != null) { myDeploymentSource = type.load(deploymentTag, getProject()); myDeploymentConfiguration = myDeploymentConfigurator.createDefaultConfiguration(myDeploymentSource); ComponentSerializationUtil.loadComponentState(myDeploymentConfiguration.getSerializer(), deploymentTag.getChild(SETTINGS_ELEMENT)); } else { LOG.warn("Cannot load deployment source for '" + getName() + "' run configuration: unknown deployment type '" + typeId + "'"); } } } }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); ConfigurationState state = XmlSerializer.deserialize(element, ConfigurationState.class); myDeploymentSource = null; if (state != null) { Element deploymentTag = state.myDeploymentTag; if (deploymentTag != null) { String typeId = deploymentTag.getAttributeValue(DEPLOYMENT_SOURCE_TYPE_ATTRIBUTE); DeploymentSourceType<?> type = findDeploymentSourceType(typeId); if (type != null) { myDeploymentSource = type.load(deploymentTag, getProject()); myDeploymentConfiguration = myDeploymentConfigurator.createDefaultConfiguration(myDeploymentSource); ComponentSerializationUtil.loadComponentState(myDeploymentConfiguration.getSerializer(), deploymentTag.getChild(SETTINGS_ELEMENT)); } else { LOG.warn("Cannot load deployment source for '" + getName() + "' run configuration: unknown deployment type '" + typeId + "'"); } } } }
private void readProperties(Element element) { final String typeId = element.getAttributeValue(LIBRARY_TYPE_ATTR); if (typeId == null) return; myKind = (PersistentLibraryKind<?>) LibraryKind.findById(typeId); if (myKind == null) return; myProperties = myKind.createDefaultProperties(); final Element propertiesElement = element.getChild(PROPERTIES_ELEMENT); if (propertiesElement != null) { ComponentSerializationUtil.loadComponentState(myProperties, propertiesElement); } }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); ConfigurationState state = XmlSerializer.deserialize(element, ConfigurationState.class); myServerName = null; myDeploymentSource = null; if (state != null) { myServerName = state.myServerName; final Element deploymentTag = state.myDeploymentTag; if (deploymentTag != null) { String typeId = deploymentTag.getAttributeValue(DEPLOYMENT_SOURCE_TYPE_ATTRIBUTE); final DeploymentSourceType<?> type = findDeploymentSourceType(typeId); if (type != null) { myDeploymentSource = new ReadAction<DeploymentSource>() { protected void run(final @NotNull Result<DeploymentSource> result) { result.setResult(type.load(deploymentTag, getProject())); } }.execute().getResultObject(); myDeploymentConfiguration = myDeploymentConfigurator.createDefaultConfiguration(myDeploymentSource); ComponentSerializationUtil.loadComponentState(myDeploymentConfiguration.getSerializer(), deploymentTag.getChild(SETTINGS_ELEMENT)); } else { LOG.warn("Cannot load deployment source for '" + getName() + "' run configuration: unknown deployment type '" + typeId + "'"); } } } }
protected XBreakpointBase(final XBreakpointType<Self, P> type, XBreakpointManagerImpl breakpointManager, S breakpointState) { myState = breakpointState; myType = type; myBreakpointManager = breakpointManager; myProperties = type.createProperties(); if (myProperties != null) { ComponentSerializationUtil.loadComponentState(myProperties, myState.getPropertiesElement()); } initExpressions(); }
public static void loadFacetConfiguration(final @NotNull FacetConfiguration configuration, final @Nullable Element config) throws InvalidDataException { if (config != null) { if (configuration instanceof PersistentStateComponent) { ComponentSerializationUtil.loadComponentState((PersistentStateComponent)configuration, config); } else { configuration.readExternal(config); } } }
protected XBreakpointBase(final XBreakpointType<Self, P> type, XBreakpointManagerImpl breakpointManager, S breakpointState) { myState = breakpointState; myType = type; myBreakpointManager = breakpointManager; myProperties = type.createProperties(); if (myProperties != null) { ComponentSerializationUtil.loadComponentState(myProperties, myState.getPropertiesElement()); } }
private void readProperties(Element element) { final String typeId = element.getAttributeValue(LIBRARY_TYPE_ATTR); if (typeId == null) return; myKind = (PersistentLibraryKind<?>)LibraryKind.findById(typeId); if (myKind == null) return; myProperties = myKind.createDefaultProperties(); final Element propertiesElement = element.getChild(PROPERTIES_ELEMENT); if (propertiesElement != null) { ComponentSerializationUtil.loadComponentState(myProperties, propertiesElement); } }