@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); }
@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, "WORKING_DIRECTORY", workingDirectory); JDOMExternalizerUtil.writeField(element, "PARENT_ENVS", Boolean.toString(passParentEnvs)); JDOMExternalizerUtil.writeField(element, "ALTERNATE_INTERPRETER", Boolean.toString(overrideSDK)); EnvironmentVariablesComponent.writeExternal(element, envs); // ??? getConfigurationModule().writeExternal(element); // run config JDOMExternalizerUtil.writeField(element, "SCRIPT_NAME", scriptName); JDOMExternalizerUtil.writeField(element, "PARAMETERS", scriptParameters); }
@Override public void writeExternal(Element element) throws WriteExternalException { JDOMExternalizerUtil.addChildren(element, LOG_FILE, myLogFiles); JDOMExternalizerUtil.addChildren(element, PREDEFINED_LOG_FILE_ELEMENT, myPredefinedLogFiles); if (myFileOutputPath != null || mySaveOutput) { Element fileOutputPathElement = new Element(FILE_OUTPUT); if (myFileOutputPath != null) { fileOutputPathElement.setAttribute(OUTPUT_FILE, myFileOutputPath); } if (mySaveOutput) { fileOutputPathElement.setAttribute(SAVE, String.valueOf(mySaveOutput)); } element.addContent(fileOutputPathElement); } if (!isNewSerializationUsed()) { if (myShowConsoleOnStdOut) {//default value shouldn't be written element.setAttribute(SHOW_CONSOLE_ON_STD_OUT, String.valueOf(true)); } if (myShowConsoleOnStdErr) {//default value shouldn't be written element.setAttribute(SHOW_CONSOLE_ON_STD_ERR, String.valueOf(true)); } } }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); myScriptName = JDOMExternalizerUtil.readField(element, "SCRIPT_NAME"); myClassName = JDOMExternalizerUtil.readField(element, "CLASS_NAME"); myMethodName = JDOMExternalizerUtil.readField(element, "METHOD_NAME"); myFolderName = JDOMExternalizerUtil.readField(element, "FOLDER_NAME"); myPattern = JDOMExternalizerUtil.readField(element, "PATTERN"); usePattern = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "USE_PATTERN")); try { final String testType = JDOMExternalizerUtil.readField(element, "TEST_TYPE"); myTestType = testType != null ? TestType.valueOf(testType) : TestType.TEST_SCRIPT; } catch (IllegalArgumentException e) { myTestType = TestType.TEST_SCRIPT; // safe default } }
public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); myInterpreterOptions = JDOMExternalizerUtil.readField(element, "INTERPRETER_OPTIONS"); readEnvs(element); mySdkHome = JDOMExternalizerUtil.readField(element, "SDK_HOME"); myWorkingDirectory = JDOMExternalizerUtil.readField(element, "WORKING_DIRECTORY"); myUseModuleSdk = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "IS_MODULE_SDK")); final String addContentRoots = JDOMExternalizerUtil.readField(element, "ADD_CONTENT_ROOTS"); myAddContentRoots = addContentRoots == null || Boolean.parseBoolean(addContentRoots); final String addSourceRoots = JDOMExternalizerUtil.readField(element, "ADD_SOURCE_ROOTS"); myAddSourceRoots = addSourceRoots == null || Boolean.parseBoolean(addSourceRoots); getConfigurationModule().readExternal(element); setMappingSettings(PathMappingSettings.readExternal(element)); // extension settings: PythonRunConfigurationExtensionsManager.getInstance().readExternal(this, element); }
public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); JDOMExternalizerUtil.writeField(element, "INTERPRETER_OPTIONS", myInterpreterOptions); writeEnvs(element); JDOMExternalizerUtil.writeField(element, "SDK_HOME", mySdkHome); JDOMExternalizerUtil.writeField(element, "WORKING_DIRECTORY", myWorkingDirectory); JDOMExternalizerUtil.writeField(element, "IS_MODULE_SDK", Boolean.toString(myUseModuleSdk)); JDOMExternalizerUtil.writeField(element, "ADD_CONTENT_ROOTS", Boolean.toString(myAddContentRoots)); JDOMExternalizerUtil.writeField(element, "ADD_SOURCE_ROOTS", Boolean.toString(myAddSourceRoots)); getConfigurationModule().writeExternal(element); // extension settings: PythonRunConfigurationExtensionsManager.getInstance().writeExternal(this, element); PathMappingSettings.writeExternal(element, getMappingSettings()); }
@Override public void loadExtension(@NotNull JpsGlobal global, @NotNull Element componentTag) { final JpsIntelliLangConfigurationImpl configuration = new JpsIntelliLangConfigurationImpl(); final String annotationName = JDOMExternalizerUtil.readField(componentTag, PATTERN_ANNOTATION_NAME); if (annotationName != null) { configuration.setPatternAnnotationClassName(annotationName); } final String instrumentationType = JDOMExternalizerUtil.readField(componentTag, INSTRUMENTATION_TYPE_NAME); if (instrumentationType != null) { try { final InstrumentationType type = InstrumentationType.valueOf(instrumentationType); configuration.setInstrumentationType(type); } catch (IllegalArgumentException ignored) { LOG.info(ignored); } } JpsIntelliLangExtensionService.getInstance().setConfiguration(global, configuration); }
@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 workingDirectory = JDOMExternalizerUtil.readField(element, "WORKING_DIRECTORY"); 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")); }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); // common config 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); }
@Override public void readExternal(@NotNull Element element) throws InvalidDataException { super.readExternal(element); suggestedName = JDOMExternalizerUtil.readField(element, "SUGGESTED_NAME"); actionName = JDOMExternalizerUtil.readField(element, "ACTION_NAME"); runTest = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "RUN_TEST")); testTargets = JDOMExternalizerUtil.readField(element, "TEST_TARGETS"); runFailed = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "RUN_FAILED")); xunitXML = JDOMExternalizerUtil.readField(element, "XUNIT_XML"); useOptions = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "USE_OPTIONS")); options = JDOMExternalizerUtil.readField(element, "OPTIONS"); useVariables = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "USE_VARIABLES")); variables = JDOMExternalizerUtil.readField(element, "VARIABLES"); verbose = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "VERBOSE")); disableScreenshot = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, "DISABLE_SCREENSHOT")); }
@Override public void writeExternal(@NotNull Element element) throws WriteExternalException { super.writeExternal(element); JDOMExternalizerUtil.writeField(element, "SUGGESTED_NAME", suggestedName); JDOMExternalizerUtil.writeField(element, "ACTION_NAME", actionName); JDOMExternalizerUtil.writeField(element, "RUN_TEST", String.valueOf(runTest)); JDOMExternalizerUtil.writeField(element, "TEST_TARGETS", testTargets); JDOMExternalizerUtil.writeField(element, "RUN_FAILED", String.valueOf(runFailed)); JDOMExternalizerUtil.writeField(element, "XUNIT_XML", xunitXML); JDOMExternalizerUtil.writeField(element, "USE_OPTIONS", String.valueOf(useOptions)); JDOMExternalizerUtil.writeField(element, "OPTIONS", options); JDOMExternalizerUtil.writeField(element, "USE_VARIABLES", String.valueOf(useVariables)); JDOMExternalizerUtil.writeField(element, "VARIABLES", variables); JDOMExternalizerUtil.writeField(element, "VERBOSE", String.valueOf(verbose)); JDOMExternalizerUtil.writeField(element, "DISABLE_SCREENSHOT", String.valueOf(disableScreenshot)); }
@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 = ""; }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); setModuleName(moduleName); writeModule(element); JDOMExternalizerUtil.writeField(element, "moduleName", moduleName); JDOMExternalizerUtil.writeField(element, "targetType", targetType == null? null: targetType.toString()); JDOMExternalizerUtil.writeField(element, "deviceArch", deviceArch == null? null: deviceArch.toString()); JDOMExternalizerUtil.writeField(element, "signingIdentity", signingIdentity); JDOMExternalizerUtil.writeField(element, "provisioningProfile", provisioningProfile); JDOMExternalizerUtil.writeField(element, "simArch", simArch == null? null: simArch.toString()); JDOMExternalizerUtil.writeField(element, "simulatorName", simulatorName); JDOMExternalizerUtil.writeField(element, "arguments", arguments == null? "": arguments); JDOMExternalizerUtil.writeField(element, "workingDir", workingDir == null? "": workingDir); }
@Override public void writeExternal(@NotNull final Element element) throws WriteExternalException { super.writeExternal(element); if (myMLFile != null) { final String mlFilePath = FileUtil.toSystemIndependentName(myMLFile.getPath()); JDOMExternalizerUtil.writeField(element, "ocamlModule", mlFilePath); } JDOMExternalizerUtil.writeField(element, "programParams", myProgramParams); JDOMExternalizerUtil.writeField(element, "useModuleSdk", String.valueOf(myIsUsedModuleSdk)); writeModule(element); if (mySpecifiedSdk != null) { final String sdkHomePath = FileUtil.toSystemIndependentName(mySpecifiedSdk.getHomePath()); JDOMExternalizerUtil.writeField(element, "specifiedSdkHome", sdkHomePath); } JDOMExternalizerUtil.writeField(element, "compilerOptions", myCompilerOptions); JDOMExternalizerUtil.writeField(element, "linkerOptions", myLinkerOptions); JDOMExternalizerUtil.writeField(element, "runnerOptions", myRunnerOptions); JDOMExternalizerUtil.writeField(element, "workingDirectory", FileUtil.toSystemIndependentName(myWorkingDirectory)); }
@Override @SuppressWarnings({"HardCodedStringLiteral"}) public void writeExternal(Element element) { super.writeExternal(element); if(ON_DEMAND) { JDOMExternalizerUtil.writeField(element, "ON_DEMAND", "true"); } if(USE_CLASS_FILTERS) { JDOMExternalizerUtil.writeField(element, "USE_CLASS_FILTERS", "true"); } DebuggerUtilsEx.writeFilters(element, "filter", myClassFilters); }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); myChildren.clear(); myAppendDefaultChildren = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, APPEND_DEFAULT_NAME)); List<Element> children = element.getChildren(CHILDREN_EXPRESSION); for(Element item : children) { String name = item.getAttributeValue(CHILD_NAME); TextWithImports text = DebuggerUtils.getInstance().readTextWithImports(item.getChildren().get(0)); boolean onDemand = Boolean.parseBoolean(item.getAttributeValue(CHILD_ONDEMAND)); myChildren.add(new ChildInfo(name, text, onDemand)); } }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); if(myAppendDefaultChildren) { JDOMExternalizerUtil.writeField(element, APPEND_DEFAULT_NAME, "true"); } for(ChildInfo childInfo : myChildren) { Element child = new Element(CHILDREN_EXPRESSION); child.setAttribute(CHILD_NAME, childInfo.myName); if(childInfo.myOnDemand) { child.setAttribute(CHILD_ONDEMAND, "true"); } child.addContent(DebuggerUtils.getInstance().writeTextWithImports(childInfo.myExpression)); element.addContent(child); } }
public void writeExternal(@NotNull Element element) { if(myName != null) { JDOMExternalizerUtil.writeField(element, NAME_OPTION, myName); } if(myEnabled != myEnabledDefaultValue) { JDOMExternalizerUtil.writeField(element, ENABLED_OPTION, Boolean.toString(myEnabled)); } if(myClassName != null) { JDOMExternalizerUtil.writeField(element, CLASSNAME_OPTION, myClassName); } if(!myShowType) { // default is true //noinspection ConstantConditions JDOMExternalizerUtil.writeField(element, SHOW_TYPE_OPTION, Boolean.toString(myShowType)); } }
@Override public void writeTextWithImports(Element root, String name, TextWithImports value) { if(value.getKind() == CodeFragmentKind.EXPRESSION) { JDOMExternalizerUtil.writeField(root, name, value.toExternalForm()); } else { Element element = JDOMExternalizerUtil.writeOption(root, name); XExpression expression = TextWithImportsImpl.toXExpression(value); if(expression != null) { XmlSerializer.serializeInto(new XExpressionState(expression), element, new SkipDefaultValuesSerializationFilters()); } } }
@Override public TextWithImports readTextWithImports(Element root, String name) { String s = JDOMExternalizerUtil.readField(root, name); if(s != null) { return new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, s); } else { Element option = JDOMExternalizerUtil.getOption(root, name); if(option != null) { XExpressionState state = new XExpressionState(); XmlSerializer.deserializeInto(state, option); return TextWithImportsImpl.fromXExpression(state.toXExpression()); } } return null; }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); this.tomcatInfo = TomcatInfoConfigs.getInstance(getProject()).getCurrent(); // this.tomcatInstallation = PropertiesComponent.getInstance().getValue("TOMCAT_INSTALLATION"); // this.tomcatInstallation = JDOMExternalizerUtil.readField(element, "TOMCAT_INSTALLATION"); this.docBase = JDOMExternalizerUtil.readField(element, "DOC_BASE"); this.contextPath = JDOMExternalizerUtil.readField(element, "CONTEXT_PATH"); this.port = JDOMExternalizerUtil.readField(element, "TOMCAT_PORT"); this.vmOptions = JDOMExternalizerUtil.readField(element, "VM_OPTIONS"); }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); TomcatInfoConfigs.getInstance(getProject()).setCurrent(tomcatInfo); // JDOMExternalizerUtil.writeField(element, "TOMCAT_INSTALLATION", tomcatInstallation); JDOMExternalizerUtil.writeField(element, "DOC_BASE", docBase); JDOMExternalizerUtil.writeField(element, "CONTEXT_PATH", contextPath); JDOMExternalizerUtil.writeField(element, "TOMCAT_PORT", port); JDOMExternalizerUtil.writeField(element, "VM_OPTIONS", vmOptions); }
@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); }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); // Stores the values of this class into the parent JDOMExternalizerUtil.writeField(element, VM_ARGS_FIELD, this.getVmArgs()); JDOMExternalizerUtil.writeField(element, MULE_HOME_FIELD, this.getMuleHome()); JDOMExternalizerUtil.writeField(element, CLEAR_DATA_FIELD, this.getClearData()); getConfigurationModule().writeExternal(element); }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); // Stores the values of this class into the parent JDOMExternalizerUtil.writeField(element, HOST_PROP_NAME, this.host); JDOMExternalizerUtil.writeField(element, PORT_PROP_NAME, String.valueOf(this.port)); JDOMExternalizerUtil.writeField(element, JVM_PORT_PROP_NAME, String.valueOf(this.jvmPort)); JDOMExternalizerUtil.writeField(element, ISCUSTOMMAP_PROP_NAME, String.valueOf(isCustomAppsMap)); if (modulesToAppsMap != null) { for (String moduleName : modulesToAppsMap.keySet()) { JDOMExternalizerUtil.writeField(element, MODULE_NAME_PREFIX + moduleName, modulesToAppsMap.get(moduleName)); } } }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); // Stores the values of this class into the parent JDOMExternalizerUtil.writeField(element, WEAVE_HOME_FIELD, this.getWeaveHome()); JDOMExternalizerUtil.writeField(element, WEAVE_FILE, this.getWeaveFile()); JDOMExternalizerUtil.writeField(element, WEAVE_OUTPUT, this.getWeaveOutput()); JDOMExternalizerUtil.addChildren(element, WEAVE_INPUT, weaveInputs); getConfigurationModule().writeExternal(element); }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); // common config interpreterOptions = JDOMExternalizerUtil.readField(element, "INTERPRETER_OPTIONS"); interpreterPath = JDOMExternalizerUtil.readField(element, "INTERPRETER_PATH"); if (getProject().getBasePath() != null) workingDirectory = JDOMExternalizerUtil.readField(element, "WORKING_DIRECTORY", getProject().getBasePath()); String str = JDOMExternalizerUtil.readField(element, "PARENT_ENVS"); if (str != null) { passParentEnvs = Boolean.parseBoolean(str); } str = JDOMExternalizerUtil.readField(element, "ALTERNATE_INTERPRETER"); if (str != null) { overrideSDK = Boolean.parseBoolean(str); } EnvironmentVariablesComponent.readExternal(element, envs); // ??? getConfigurationModule().readExternal(element); // run config scriptName = JDOMExternalizerUtil.readField(element, "SCRIPT_NAME"); scriptParameters = JDOMExternalizerUtil.readField(element, "PARAMETERS"); }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); // Reads the conf file into this class String locations = JDOMExternalizerUtil.readField(element, MODULES_FIELD); if (locations != null) { tomcatModules = (Modules) GSON.fromJson(locations, Modules.class); } this.tomcatInstallation = JDOMExternalizerUtil.readField(element, TOMCAT_PATH_FIELD); this.vmArgs = JDOMExternalizerUtil.readField(element, VM_ARGS_FIELD); String passParentEnvironmentVariablesValue = JDOMExternalizerUtil.readField(element, PASS_PARENT_ENV_VARS_FIELD); this.passParentEnvironmentVariables = Boolean.valueOf(passParentEnvironmentVariablesValue); EnvironmentVariablesComponent.readExternal(element, this.environmentVariables); }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); // Stores the values of this class into the parent String modulesString = GSON.toJson(tomcatModules); JDOMExternalizerUtil.writeField(element, MODULES_FIELD, modulesString); JDOMExternalizerUtil.writeField(element, TOMCAT_PATH_FIELD, this.getTomcatInstallation()); JDOMExternalizerUtil.writeField(element, VM_ARGS_FIELD, this.getVmArgs()); JDOMExternalizerUtil.writeField(element, PASS_PARENT_ENV_VARS_FIELD, "" + this.isPassParentEnvironmentVariables()); if (this.environmentVariables != null && !this.environmentVariables.isEmpty()) { EnvironmentVariablesComponent.writeExternal(element, this.getEnvironmentVariables()); } }
@Override public void loadExtension(@NotNull JpsProject project, @NotNull Element componentTag) { JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project); String assertNotNull = JDOMExternalizerUtil.readField(componentTag, "ASSERT_NOT_NULL"); if (assertNotNull != null) { configuration.setAddNotNullAssertions(Boolean.parseBoolean(assertNotNull)); } String clearOutputDirectory = JDOMExternalizerUtil.readField(componentTag, "CLEAR_OUTPUT_DIRECTORY"); configuration.setClearOutputDirectoryOnRebuild(clearOutputDirectory == null || Boolean.parseBoolean(clearOutputDirectory)); }
@SuppressWarnings({"HardCodedStringLiteral"}) public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); final String value = JDOMExternalizerUtil.readField(element, "USE_CLASS_FILTERS"); USE_CLASS_FILTERS = "true".equalsIgnoreCase(value); myClassFilters = DebuggerUtilsEx.readFilters(element.getChildren("filter")); }
@NotNull public static AttributesFlyweight create(@NotNull Element element) throws InvalidDataException { Color FOREGROUND = DefaultJDOMExternalizer.toColor(JDOMExternalizerUtil.readField(element, "FOREGROUND")); Color BACKGROUND = DefaultJDOMExternalizer.toColor(JDOMExternalizerUtil.readField(element, "BACKGROUND")); Color EFFECT_COLOR = DefaultJDOMExternalizer.toColor(JDOMExternalizerUtil.readField(element, "EFFECT_COLOR")); Color ERROR_STRIPE_COLOR = DefaultJDOMExternalizer.toColor(JDOMExternalizerUtil.readField(element, "ERROR_STRIPE_COLOR")); int fontType = DefaultJDOMExternalizer.toInt(JDOMExternalizerUtil.readField(element, "FONT_TYPE", "0")); if (fontType < 0 || fontType > 3) { fontType = 0; } int FONT_TYPE = fontType; int EFFECT_TYPE = DefaultJDOMExternalizer.toInt(JDOMExternalizerUtil.readField(element, "EFFECT_TYPE", "0")); return create(FOREGROUND, BACKGROUND, FONT_TYPE, EFFECT_COLOR, toEffectType(EFFECT_TYPE), ERROR_STRIPE_COLOR); }
void writeExternal(@NotNull Element element) { writeColor(element, "FOREGROUND", getForeground()); writeColor(element, "BACKGROUND", getBackground()); int fontType = getFontType(); if (fontType != 0) { JDOMExternalizerUtil.writeField(element, "FONT_TYPE", String.valueOf(fontType)); } writeColor(element, "EFFECT_COLOR", getEffectColor()); writeColor(element, "ERROR_STRIPE_COLOR", getErrorStripeColor()); int effectType = fromEffectType(getEffectType()); if (effectType != 0) { JDOMExternalizerUtil.writeField(element, "EFFECT_TYPE", String.valueOf(effectType)); } }
public TextAttributesKey(@NotNull Element element) { this(JDOMExternalizerUtil.readField(element, "myExternalName")); Element myDefaultAttributesElement = JDOMExternalizerUtil.getOption(element, "myDefaultAttributes"); if (myDefaultAttributesElement != null) { myDefaultAttributes = new TextAttributes(myDefaultAttributesElement); } }
public void writeExternal(Element element) { JDOMExternalizerUtil.writeField(element, "myExternalName", myExternalName); if (myDefaultAttributes != NULL_ATTRIBUTES) { Element option = JDOMExternalizerUtil.writeOption(element, "myDefaultAttributes"); myDefaultAttributes.writeExternal(option); } }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); if (!myShowExcludedFiles) { JDOMExternalizerUtil.writeField(element, SHOW_EXCLUDED_FILES_OPTION, String.valueOf(false)); } }
@Override public void readExternal(Element element) throws InvalidDataException { super.readExternal(element); myInputFile = JDOMExternalizerUtil.readField(element, INPUT_FILE_FIELD); myOutputFile = JDOMExternalizerUtil.readField(element, OUTPUT_FILE_FIELD); myParams = JDOMExternalizerUtil.readField(element, PARAMS_FIELD); myTask = JDOMExternalizerUtil.readField(element, TASK); openInBrowser = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, OPEN_IN_BROWSER)); }
@Override public void writeExternal(Element element) throws WriteExternalException { super.writeExternal(element); JDOMExternalizerUtil.writeField(element, INPUT_FILE_FIELD, myInputFile); JDOMExternalizerUtil.writeField(element, OUTPUT_FILE_FIELD, myOutputFile); JDOMExternalizerUtil.writeField(element, PARAMS_FIELD, myParams); JDOMExternalizerUtil.writeField(element, TASK, myTask); JDOMExternalizerUtil.writeField(element, OPEN_IN_BROWSER, String.valueOf(openInBrowser)); }