Java Code Examples for com.intellij.openapi.util.DefaultJDOMExternalizer#writeExternal()

The following examples show how to use com.intellij.openapi.util.DefaultJDOMExternalizer#writeExternal() . 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: BashRunConfiguration.java    From BashSupport with Apache License 2.0 6 votes vote down vote up
@Override
public void writeExternal(Element element) throws WriteExternalException {
    super.writeExternal(element);

    // common config
    JDOMExternalizerUtil.writeField(element, "INTERPRETER_OPTIONS", interpreterOptions);
    JDOMExternalizerUtil.writeField(element, "INTERPRETER_PATH", interpreterPath);
    JDOMExternalizerUtil.writeField(element, "PROJECT_INTERPRETER", Boolean.toString(useProjectInterpreter));
    JDOMExternalizerUtil.writeField(element, "WORKING_DIRECTORY", workingDirectory);
    JDOMExternalizerUtil.writeField(element, "PARENT_ENVS", Boolean.toString(isPassParentEnvs()));

    // run config
    JDOMExternalizerUtil.writeField(element, "SCRIPT_NAME", scriptName);
    JDOMExternalizerUtil.writeField(element, "PARAMETERS", getProgramParameters());

    //JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
    DefaultJDOMExternalizer.writeExternal(this, element);
    writeModule(element);
    EnvironmentVariablesComponent.writeExternal(element, getEnvs());

    PathMacroManager.getInstance(getProject()).collapsePathsRecursively(element);
}
 
Example 2
Source File: LogConsolePreferences.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public Element getState() {
  @NonNls Element element = new Element("LogFilters");
  try {
    for (LogFilter filter : myRegisteredLogFilters.keySet()) {
      Element filterElement = new Element(FILTER);
      filterElement.setAttribute(IS_ACTIVE, myRegisteredLogFilters.get(filter).toString());
      filter.writeExternal(filterElement);
      element.addContent(filterElement);
    }
    DefaultJDOMExternalizer.writeExternal(this, element);
  }
  catch (WriteExternalException e) {
    LOG.error(e);
  }
  return element;
}
 
Example 3
Source File: PluginErrorSubmitDialog.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
public void persist() {
    try {
        Element applicationElement = new Element("application");
        Element componentElement = new Element("component");
        applicationElement.addContent(componentElement);

        USERNAME = reportComponent.nameField.getText();
        DefaultJDOMExternalizer.writeExternal(this, componentElement);

        Document document = new Document(applicationElement);
        JDOMUtil.writeDocument(document, getOptionsFilePath(), "\r\n");
    } catch (Exception e) {
        LOGGER.info("Unable to persist configuration file", e);
    }
}
 
Example 4
Source File: CustomCodeStyleSettings.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void writeExternal(Element parentElement, @Nonnull final CustomCodeStyleSettings parentSettings) throws WriteExternalException {
  final Element childElement = new Element(myTagName);
  DefaultJDOMExternalizer.writeExternal(this, childElement, new DifferenceFilter<CustomCodeStyleSettings>(this, parentSettings));
  if (!childElement.getContent().isEmpty()) {
    parentElement.addContent(childElement);
  }
}
 
Example 5
Source File: ShelvedChangeList.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void writeExternal(@Nonnull Element element, @Nonnull ShelvedChangeList shelvedChangeList) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(shelvedChangeList, element);
  element.setAttribute(NAME_ATTRIBUTE, shelvedChangeList.getName());
  element.setAttribute(ATTRIBUTE_DATE, Long.toString(shelvedChangeList.DATE.getTime()));
  element.setAttribute(ATTRIBUTE_RECYCLED_CHANGELIST, Boolean.toString(shelvedChangeList.isRecycled()));
  if (shelvedChangeList.isMarkedToDelete()) {
    element.setAttribute(ATTRIBUTE_TOBE_DELETED_CHANGELIST, Boolean.toString(shelvedChangeList.isMarkedToDelete()));
  }
  for (ShelvedBinaryFile file : shelvedChangeList.getBinaryFiles()) {
    Element child = new Element(ELEMENT_BINARY);
    file.writeExternal(child);
    element.addContent(child);
  }
}
 
Example 6
Source File: BlazeAndroidRunConfigurationDeployTargetManagerBase.java    From intellij with Apache License 2.0 4 votes vote down vote up
@Override
public void writeExternal(Element element) throws WriteExternalException {
  for (DeployTargetState state : deployTargetStates.values()) {
    DefaultJDOMExternalizer.writeExternal(state, element);
  }
}
 
Example 7
Source File: HighlightSeverity.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void writeExternal(final Element element) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(this, element);
}
 
Example 8
Source File: EnvironmentVariable.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void writeExternal(Element element) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(this, element);
}
 
Example 9
Source File: CodeStyleSettingsManager.java    From consulo with Apache License 2.0 4 votes vote down vote up
private void writeExternal(Element element) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(this, element, new DifferenceFilter<CodeStyleSettingsManager>(this, new CodeStyleSettingsManager()));
}
 
Example 10
Source File: CreatePatchCommitExecutor.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void writeExternal(Element element) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(this, element);
}
 
Example 11
Source File: ShelvedBinaryFile.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void writeExternal(Element element) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(this, element);
}
 
Example 12
Source File: DaemonCodeAnalyzerSettingsImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
private void writeExternal(Element element) throws WriteExternalException {
  DefaultJDOMExternalizer.writeExternal(this, element);
  element.setAttribute(PROFILE_ATT, myManager.getRootProfile().getName());
}