Java Code Examples for com.intellij.openapi.util.JDOMExternalizerUtil#readField()

The following examples show how to use com.intellij.openapi.util.JDOMExternalizerUtil#readField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WeaveConfiguration.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public void readExternal(Element element) throws InvalidDataException
{
    super.readExternal(element);
    this.weaveHome = JDOMExternalizerUtil.readField(element, WEAVE_HOME_FIELD);
    this.weaveFile = JDOMExternalizerUtil.readField(element, WEAVE_FILE);
    this.weaveOutput = JDOMExternalizerUtil.readField(element, WEAVE_OUTPUT);
    final List<Element> children = element.getChildren(WEAVE_INPUT);
    this.weaveInputs = new ArrayList<>();
    for (Element child : children)
    {
        final WeaveInput weaveInput = new WeaveInput();
        weaveInput.readExternal(child);
        weaveInputs.add(weaveInput);
    }
    getConfigurationModule().readExternal(element);
}
 
Example 2
Source File: RoboVmRunConfiguration.java    From robovm-idea with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void readExternal(Element element) throws InvalidDataException {
    super.readExternal(element);

    readModule(element);
    moduleName = JDOMExternalizerUtil.readField(element, "moduleName");
    String targetTypeStr = JDOMExternalizerUtil.readField(element, "targetType");
    targetType = targetTypeStr.length() == 0? null: TargetType.valueOf(targetTypeStr);
    String deviceArchStr = JDOMExternalizerUtil.readField(element, "deviceArch");
    deviceArch = deviceArchStr.length() == 0? null: Arch.valueOf(deviceArchStr);
    signingIdentity = JDOMExternalizerUtil.readField(element, "signingIdentity");
    provisioningProfile = JDOMExternalizerUtil.readField(element, "provisioningProfile");
    String simArchStr = JDOMExternalizerUtil.readField(element, "simArch");
    simArch = simArchStr.length() == 0? null: Arch.valueOf(simArchStr);
    simulatorName = JDOMExternalizerUtil.readField(element, "simulatorName");
    arguments = JDOMExternalizerUtil.readField(element, "arguments");
    if(arguments == null) arguments = "";
    workingDir = JDOMExternalizerUtil.readField(element, "workingDir");
    if(workingDir == null) workingDir = "";
}
 
Example 3
Source File: MuleConfiguration.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(Element element) throws InvalidDataException
{
    super.readExternal(element);
    this.vmArgs = JDOMExternalizerUtil.readField(element, VM_ARGS_FIELD);
    this.muleHome = JDOMExternalizerUtil.readField(element, MULE_HOME_FIELD);
    this.clearData = JDOMExternalizerUtil.readField(element, CLEAR_DATA_FIELD);

    getConfigurationModule().readExternal(element);
}
 
Example 4
Source File: BashRunConfiguration.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(Element element) throws InvalidDataException {
    PathMacroManager.getInstance(getProject()).expandPaths(element);
    super.readExternal(element);

    DefaultJDOMExternalizer.readExternal(this, element);
    readModule(element);
    EnvironmentVariablesComponent.readExternal(element, getEnvs());

    // common config
    interpreterOptions = JDOMExternalizerUtil.readField(element, "INTERPRETER_OPTIONS");
    interpreterPath = JDOMExternalizerUtil.readField(element, "INTERPRETER_PATH");
    workingDirectory = JDOMExternalizerUtil.readField(element, "WORKING_DIRECTORY");

    // 1.7.0 to 1.7.2 broke the run configs by defaulting to useProjectInterpreter, using field USE_PROJECT_INTERPRETER
    // we try to workaround for config saved by these versions by using another field and a smart fallback
    String useProjectInterpreterValue = JDOMExternalizerUtil.readField(element, "PROJECT_INTERPRETER");
    String oldUseProjectInterpreterValue = JDOMExternalizerUtil.readField(element, "USE_PROJECT_INTERPRETER");
    if (useProjectInterpreterValue != null) {
        useProjectInterpreter = Boolean.parseBoolean(useProjectInterpreterValue);
    } else if (StringUtils.isEmpty(interpreterPath) && oldUseProjectInterpreterValue != null) {
        // only use old "use project interpreter" setting when there's no interpreter in the run config and a configured project interpreter
        Project project = getProject();
        if (!BashProjectSettings.storedSettings(project).getProjectInterpreter().isEmpty()) {
            useProjectInterpreter = Boolean.parseBoolean(oldUseProjectInterpreterValue);
        }
    }

    String parentEnvValue = JDOMExternalizerUtil.readField(element, "PARENT_ENVS");
    if (parentEnvValue != null) {
        setPassParentEnvs(Boolean.parseBoolean(parentEnvValue));
    }

    // run config
    scriptName = JDOMExternalizerUtil.readField(element, "SCRIPT_NAME");
    setProgramParameters(JDOMExternalizerUtil.readField(element, "PARAMETERS"));
}
 
Example 5
Source File: ProjectFilesViewPane.java    From intellij-pants-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(@NotNull Element element) throws InvalidDataException {
  super.readExternal(element);
  final String showExcludedOption = JDOMExternalizerUtil.readField(element, SHOW_EXCLUDED_FILES_OPTION);
  myShowExcludedFiles = showExcludedOption == null || Boolean.parseBoolean(showExcludedOption);

  final String showOnlyLoadedOption = JDOMExternalizerUtil.readField(element, SHOW_ONLY_LOADED_FILES_OPTION);
  myShowOnlyLoadedFiles = showOnlyLoadedOption == null || Boolean.parseBoolean(showOnlyLoadedOption);
}
 
Example 6
Source File: TextAttributesKey.java    From consulo with Apache License 2.0 5 votes vote down vote up
public TextAttributesKey(@Nonnull Element element) {
  this(JDOMExternalizerUtil.readField(element, "myExternalName"));
  Element myDefaultAttributesElement = JDOMExternalizerUtil.getOption(element, "myDefaultAttributes");
  if (myDefaultAttributesElement != null) {
    myDefaultAttributes = new TextAttributes(myDefaultAttributesElement);
  }
}
 
Example 7
Source File: HaskellTestRunConfiguration.java    From intellij-haskforce with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(Element element) throws InvalidDataException {
    PathMacroManager.getInstance(getProject()).expandPaths(element);
    super.readExternal(element);
    programArguments = JDOMExternalizerUtil.readField(element, PROGRAM_ARGUMENTS);
}
 
Example 8
Source File: HaskellApplicationRunConfiguration.java    From intellij-haskforce with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(Element element) throws InvalidDataException {
    PathMacroManager.getInstance(getProject()).expandPaths(element);
    super.readExternal(element);
    programArguments = JDOMExternalizerUtil.readField(element, PROGRAM_ARGUMENTS);
}
 
Example 9
Source File: HighlightSeverity.java    From consulo with Apache License 2.0 4 votes vote down vote up
public HighlightSeverity(@Nonnull Element element) {
  this(JDOMExternalizerUtil.readField(element, "myName"), Integer.valueOf(JDOMExternalizerUtil.readField(element, "myVal")));
}