- Revision
- 737
- Author
- wolfdancer
- Date
- 2007-06-10 19:56:32 -0500 (Sun, 10 Jun 2007)
Log Message
update to selena
Modified Paths
- trunk/plugins/intellij/META-INF/plugin.xml
- trunk/plugins/intellij/jbehave-intellij.iml
- trunk/plugins/intellij/jbehave-intellij.ipr
- trunk/plugins/intellij/src/org/jbehave/plugin/idea/JBehaveRunConfiguration.java
Added Paths
Diff
Modified: trunk/plugins/intellij/META-INF/plugin.xml (736 => 737)
--- trunk/plugins/intellij/META-INF/plugin.xml 2007-05-28 19:54:06 UTC (rev 736) +++ trunk/plugins/intellij/META-INF/plugin.xml 2007-06-11 00:56:32 UTC (rev 737) @@ -5,9 +5,9 @@ <version>1.0.1</version> <vendor logo="/behave.png" url="" email="[EMAIL PROTECTED]">JBehave</vendor> <change-notes> - First formal release + Update to Selena </change-notes> - <idea-version since-build="5784"/> + <idea-version since-build="6951"/> <application-components> <component>
Modified: trunk/plugins/intellij/jbehave-intellij.iml (736 => 737)
--- trunk/plugins/intellij/jbehave-intellij.iml 2007-05-28 19:54:06 UTC (rev 736) +++ trunk/plugins/intellij/jbehave-intellij.iml 2007-06-11 00:56:32 UTC (rev 737) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="PLUGIN_MODULE"> +<module relativePaths="true" type="PLUGIN_MODULE" version="4"> <component name="DevKit.ModuleBuildProperties" url="" /> - <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="false"> <output url="" /> <exclude-output />
Modified: trunk/plugins/intellij/jbehave-intellij.ipr (736 => 737)
--- trunk/plugins/intellij/jbehave-intellij.ipr 2007-05-28 19:54:06 UTC (rev 736) +++ trunk/plugins/intellij/jbehave-intellij.ipr 2007-06-11 00:56:32 UTC (rev 737) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project version="4" relativePaths="false"> +<project relativePaths="false" version="4"> <component name="AntConfiguration"> <defaultAnt bundledAnt="true" /> </component> @@ -33,11 +33,9 @@ <entry name="?*.tld" /> </wildcardResourcePatterns> </component> - <component name="DataSourceManagerImpl" /> <component name="DependenciesAnalyzeManager"> <option name="myForwardDirection" value="false" /> </component> - <component name="DependencyValidationManager" /> <component name="EclipseCompilerSettings"> <option name="DEBUGGING_INFO" value="true" /> <option name="GENERATE_NO_WARNINGS" value="true" /> @@ -53,14 +51,13 @@ <option name="MAXIMUM_HEAP_SIZE" value="128" /> </component> <component name="EntryPointsManager"> - <entry_points /> + <entry_points version="2.0" /> </component> <component name="ExportToHTMLSettings"> <option name="PRINT_LINE_NUMBERS" value="false" /> <option name="OPEN_IN_BROWSER" value="false" /> <option name="OUTPUT_DIRECTORY" /> </component> - <component name="GUI Designer component loader factory" /> <component name="IdProvider" IDEtalkID="AE237564EECF1BAFF27FA2D75D5BA545" /> <component name="InspectionProjectProfileManager"> <option name="PROJECT_PROFILE" value="Project Default" /> @@ -251,12 +248,13 @@ </item> </group> </component> + <component name="ProjectFileVersion" converted="true" /> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/jbehave-intellij.iml" filepath="$PROJECT_DIR$/jbehave-intellij.iml" /> </modules> </component> - <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA 6148" project-jdk-type="IDEA JDK"> + <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA 6951" project-jdk-type="IDEA JDK"> <output url="" /> </component> <component name="ProjectRunConfigurationManager"> @@ -281,7 +279,6 @@ </method> </configuration> </component> - <component name="RAILS_PROJECT_VIEW_PANE" /> <component name="RUBY_DOC_SETTINGS"> <RUBY_DOC NAME="DEFAULTS" VALUE="TRUE" /> <RUBY_DOC NAME="NUMBER" VALUE="0" /> @@ -293,8 +290,9 @@ <option name="GENERATE_IIOP_STUBS" value="false" /> <option name="ADDITIONAL_OPTIONS_STRING" value="" /> </component> - <component name="StarteamVcsAdapter" /> - <component name="VssVcs" /> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="svn" /> + </component> <component name="com.intellij.jsf.UserDefinedFacesConfigs"> <option name="USER_DEFINED_CONFIGS"> <value> @@ -302,12 +300,5 @@ </value> </option> </component> - <component name="libraryTable" /> - <component name="uidesigner-configuration"> - <option name="INSTRUMENT_CLASSES" value="true" /> - <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" /> - <option name="DEFAULT_LAYOUT_MANAGER" value="GridLayoutManager" /> - </component> - <UsedPathMacros /> </project>
Modified: trunk/plugins/intellij/src/org/jbehave/plugin/idea/JBehaveRunConfiguration.java (736 => 737)
--- trunk/plugins/intellij/src/org/jbehave/plugin/idea/JBehaveRunConfiguration.java 2007-05-28 19:54:06 UTC (rev 736) +++ trunk/plugins/intellij/src/org/jbehave/plugin/idea/JBehaveRunConfiguration.java 2007-06-11 00:56:32 UTC (rev 737) @@ -3,16 +3,13 @@ import com.intellij.execution.ExecutionException; import com.intellij.execution.configurations.*; import com.intellij.execution.filters.TextConsoleBuilderFactory; -import com.intellij.execution.runners.JavaProgramRunner; import com.intellij.execution.runners.RunnerInfo; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.options.SettingsEditor; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.DefaultJDOMExternalizer; import com.intellij.openapi.util.InvalidDataException; -import com.intellij.openapi.util.JDOMExternalizable; import com.intellij.openapi.util.WriteExternalException; import com.intellij.util.PathUtil; import org.jdom.Element; @@ -21,89 +18,89 @@ import java.util.Collection; public class JBehaveRunConfiguration extends RuntimeConfiguration { - public String behaviorClass; - public String behaviorMethod; - public String moduleName; + public String behaviorClass = ""; + public String behaviorMethod = ""; + public String moduleName = ""; - protected JBehaveRunConfiguration(Project project, ConfigurationFactory factory, String name) { - super(name, project, factory); - } + protected JBehaveRunConfiguration(Project project, ConfigurationFactory factory, String name) { + super(name, project, factory); + } - public SettingsEditor<JBehaveRunConfiguration> getConfigurationEditor() { - return new JBehaveRunSettingsEditor(getProject()); - } + public SettingsEditor<JBehaveRunConfiguration> getConfigurationEditor() { + return new JBehaveRunSettingsEditor(getProject()); + } - public SettingsEditor<JDOMExternalizable> getRunnerSettingsEditor(JavaProgramRunner runner) { - return null; - } + public void readExternal(Element element) throws InvalidDataException { + super.readExternal(element); + RunConfigurationField.readFromElement(this, element); + } - public void readExternal(Element element) throws InvalidDataException { - super.readExternal(element); - DefaultJDOMExternalizer.readExternal(this, element); - } + public void writeExternal(Element element) throws WriteExternalException { + super.writeExternal(element); + RunConfigurationField.writeToElement(this, element); + } - public void writeExternal(Element element) throws WriteExternalException { - super.writeExternal(element); - DefaultJDOMExternalizer.writeExternal(this, element); - } + public RunProfileState getState(DataContext context, RunnerInfo runnerInfo, RunnerSettings runner, ConfigurationPerRunnerSettings configuration) throws ExecutionException { + JBehaveCommandLineState commandLineState = new JBehaveCommandLineState(this, runner, configuration); + commandLineState.setConsoleBuilder(TextConsoleBuilderFactory.getInstance().createBuilder(getProject())); + commandLineState.setModulesToCompile(getModules()); + return commandLineState; + } - public RunProfileState getState(DataContext context, RunnerInfo runnerInfo, RunnerSettings runner, ConfigurationPerRunnerSettings configuration) throws ExecutionException { - JBehaveCommandLineState commandLineState = new JBehaveCommandLineState(this, runner, configuration); - commandLineState.setConsoleBuilder(TextConsoleBuilderFactory.getInstance().createBuilder(getProject())); - commandLineState.setModulesToCompile(getModules()); - return commandLineState; - } + public void checkConfiguration() throws RuntimeConfigurationException { + super.checkConfiguration(); + } - public void checkConfiguration() throws RuntimeConfigurationException { - super.checkConfiguration(); - } + public Module[] getModules() { + return ModuleManager.getInstance(getProject()).getModules(); + } - public Module[] getModules() { - return ModuleManager.getInstance(getProject()).getModules(); - } + public Module getModule() { + return lookUp(getModules(), moduleName); + } - public Module getModule() { - return lookUp(getModules(), moduleName); + private Module lookUp(Module[] modules, String moduleName) { + for (Module module : modules) { + if (module.getName().equals(moduleName)) { + return module; + } } + return modules.length > 0 ? modules[0] : null; + } - private Module lookUp(Module[] modules, String moduleName) { - for (Module module : modules) { - if (module.getName().equals(moduleName)) { - return module; - } - } - return modules.length > 0 ? modules[0] : null; - } + public void setModule(Module module) { + moduleName = module == null ? null : module.getName(); + } - public void setModule(Module module) { - moduleName = module == null ? null : module.getName(); - } + public String getWorkingDirectoryPath() { + return PathUtil.getCanonicalPath(getProject().getBaseDir().getPath()); + } - public String getWorkingDirectoryPath() { - return PathUtil.getCanonicalPath(getProject().getProjectFile().getParent().getPath()); - } + public String getBehaviorClass() { + return behaviorClass == null ? "" : behaviorClass; + } - public String getBehaviorClass() { - return behaviorClass == null ? "" : behaviorClass; - } + public void setBehaviorClass(String behaviorClass) { + this.behaviorClass = behaviorClass; + } - public void setBehaviorClass(String behaviorClass) { - this.behaviorClass = behaviorClass; - } + public Collection<Module> getValidModules() { + return Arrays.asList(ModuleManager.getInstance(getProject()).getModules()); + } - public Collection<Module> getValidModules() { - return Arrays.asList(ModuleManager.getInstance(getProject()).getModules()); - } + protected JBehaveRunConfiguration createInstance() { + return new JBehaveRunConfiguration(getProject(), getFactory(), getName()); + } - protected JBehaveRunConfiguration createInstance() { - return new JBehaveRunConfiguration(getProject(), getFactory(), getName()); - } + public String getBehaviourMethod() { + return behaviorMethod == null ? "" : behaviorMethod; + } - public String getBehaviourMethod() { - return behaviorMethod == null ? "" : behaviorMethod; - } + public void setBehaviorMethod(String methodName) { + behaviorMethod = methodName; + } - public void setBehaviorMethod(String methodName) { - behaviorMethod = methodName; - } + public void setModuleByName(String value) { + moduleName = value; + } }
Added: trunk/plugins/intellij/src/org/jbehave/plugin/idea/RunConfigurationField.java (0 => 737)
--- trunk/plugins/intellij/src/org/jbehave/plugin/idea/RunConfigurationField.java (rev 0) +++ trunk/plugins/intellij/src/org/jbehave/plugin/idea/RunConfigurationField.java 2007-06-11 00:56:32 UTC (rev 737) @@ -0,0 +1,94 @@ +package org.jbehave.plugin.idea; + +import com.intellij.openapi.module.Module; +import com.intellij.openapi.util.InvalidDataException; +import org.jdom.Element; + +import java.util.HashMap; +import java.util.Map; + +abstract public class RunConfigurationField { + private static Map<String, RunConfigurationField> fields = new HashMap<String, RunConfigurationField>(); + private String name; + + public RunConfigurationField(String name) { + this.name = name; + fields.put(name, this); + } + + public String getName() { + return name; + } + + abstract public String getValue(JBehaveRunConfiguration runConfiguration); + + abstract public void setValue(JBehaveRunConfiguration runConfiguration, String value); + + public static RunConfigurationField getField(String fieldName) { + RunConfigurationField field = fields.get(fieldName); + return field == null ? NULL : field; + } + + public static final RunConfigurationField NULL = new RunConfigurationField("") { + public String getValue(JBehaveRunConfiguration runConfiguration) { + return ""; + } + + public void setValue(JBehaveRunConfiguration runConfiguration, String value) { + } + }; + + public static final RunConfigurationField CLASS_NAME = new RunConfigurationField("behaviorClass") { + public String getValue(JBehaveRunConfiguration runConfiguration) { + return runConfiguration.getBehaviorClass(); + } + + public void setValue(JBehaveRunConfiguration runConfiguration, String value) { + runConfiguration.setBehaviorClass(value); + } + }; + + public static final RunConfigurationField METHOD_NAME = new RunConfigurationField("behaviorMethod") { + public String getValue(JBehaveRunConfiguration runConfiguration) { + return runConfiguration.getBehaviourMethod(); + } + + public void setValue(JBehaveRunConfiguration runConfiguration, String value) { + runConfiguration.setBehaviorMethod(value); + } + }; + + public static final RunConfigurationField MODULE = new RunConfigurationField("moduleName") { + public String getValue(JBehaveRunConfiguration runConfiguration) { + Module module = runConfiguration.getModule(); + return module == null ? "" : module.getName(); + } + + public void setValue(JBehaveRunConfiguration runConfiguration, String value) { + runConfiguration.setModuleByName(value); + } + }; + + public static void writeToElement(JBehaveRunConfiguration behaveRunConfiguration, Element parentNode) { + for (RunConfigurationField field : fields.values()) { + String value = field.getValue(behaveRunConfiguration); + if (value.length() != 0) { + Element element = new Element("option"); + parentNode.addContent(element); + element.setAttribute("name", field.getName()); + element.setAttribute("value", value); + } + } + } + + static void readFromElement(JBehaveRunConfiguration runConfiguration, Element element) throws InvalidDataException { + for (final Object o : element.getChildren("option")) { + Element e = (Element) o; + String fieldName = e.getAttributeValue("name"); + if (fieldName == null) { + throw new InvalidDataException("element should have name attribute:" + element); + } + getField(fieldName).setValue(runConfiguration, e.getAttributeValue("value")); + } + } +}
To unsubscribe from this list please visit:
