JBoss Tools SVN: r4516 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console: src/org/hibernate/eclipse/console/model/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-25 12:06:10 -0400 (Thu, 25 Oct 2007)
New Revision: 4516
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/.classpath
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java
Log:
Make sure to refresh all output directories when code generation have been executed.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/.classpath
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/.classpath 2007-10-25 16:00:03 UTC (rev 4515)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/.classpath 2007-10-25 16:06:10 UTC (rev 4516)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2007-10-25 16:00:03 UTC (rev 4515)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2007-10-25 16:06:10 UTC (rev 4516)
@@ -6,6 +6,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.variables.IStringVariableManager;
@@ -162,7 +163,7 @@
* @throws CoreException in case of resolve variables issues.
*/
public Exporter createConfiguredExporter(Configuration cfg, String defaultOutputDirectory,
- String customTemplatePath, Properties globalProperties) throws CoreException {
+ String customTemplatePath, Properties globalProperties, Set outputDirectories) throws CoreException {
Exporter exporter = getExporterDefinition().createExporterInstance();
@@ -181,6 +182,7 @@
}
props.remove("outputdir"); // done to avoid validation check in hibernate tools templates
if(StringHelper.isNotEmpty(loc)) { // only set if something valid found
+ outputDirectories.add(loc);
exporter.setOutputDirectory(new File(loc));
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2007-10-25 16:00:03 UTC (rev 4515)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2007-10-25 16:06:10 UTC (rev 4516)
@@ -23,10 +23,12 @@
import java.io.File;
import java.lang.reflect.Constructor;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
@@ -36,6 +38,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -53,7 +56,7 @@
import org.eclipse.jdt.core.formatter.CodeFormatter;
import org.eclipse.jface.text.DocumentRewriteSessionType;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.util.Assert;
+
import org.eclipse.text.edits.TextEdit;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.JDBCMetaDataConfiguration;
@@ -67,6 +70,7 @@
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
+import org.hibernate.tool.hbm2x.AbstractExporter;
import org.hibernate.tool.hbm2x.ArtifactCollector;
import org.hibernate.tool.hbm2x.Exporter;
import org.hibernate.util.ReflectHelper;
@@ -126,15 +130,20 @@
}
}
+ Set outputDirectories = new HashSet();
+ outputDirectories.add((String)attributes.getOutputPath());
ExporterFactory[] exporters = (ExporterFactory[]) exporterFactories.toArray( new ExporterFactory[exporterFactories.size()] );
- ArtifactCollector collector = runExporters(attributes, exporters, monitor);
- refreshOutputDir( attributes.getOutputPath() );
-
- if(collector==null) {
- return;
+ ArtifactCollector collector = runExporters(attributes, exporters, outputDirectories, monitor);
+
+ if(collector!=null) {
+ formatGeneratedCode( monitor, collector );
}
- formatGeneratedCode( monitor, collector );
+ Iterator iterator = outputDirectories.iterator();
+ while (iterator.hasNext()) {
+ String path = (String) iterator.next();
+ refreshOutputDir( path );
+ }
RefreshTab.refreshResources(configuration, monitor);
@@ -187,7 +196,7 @@
}
}
- private ArtifactCollector runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final IProgressMonitor monitor)
+ private ArtifactCollector runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final Set outputDirectories, final IProgressMonitor monitor)
throws CoreException
{
@@ -237,11 +246,11 @@
Exporter exporter;
try {
- exporter = exporterFactories[i].createConfiguredExporter(cfg, outputPathRes, templatePaths, globalProperties);
+ exporter = exporterFactories[i].createConfiguredExporter(cfg, outputPathRes, templatePaths, globalProperties, outputDirectories);
} catch (CoreException e) {
throw new HibernateConsoleRuntimeException("Error while setting up " + exporterFactories[i].getExporterDefinition(), e);
}
-
+
exporter.start();
monitor.worked(1);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java 2007-10-25 16:00:03 UTC (rev 4515)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java 2007-10-25 16:06:10 UTC (rev 4516)
@@ -2,6 +2,7 @@
import java.io.File;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -32,7 +33,15 @@
public static IResource findMember(IWorkspaceRoot root, String path) {
Path pathOrNull = PathHelper.pathOrNull(path);
if(pathOrNull==null) return null;
- return root.findMember(pathOrNull);
+
+ IResource findMember = root.findMember(pathOrNull);
+ if(findMember==null) {
+ IContainer[] findContainersForLocation = root.findContainersForLocation(pathOrNull);
+ if(findContainersForLocation.length>0) {
+ findMember = findContainersForLocation[0];
+ }
+ }
+ return findMember;
}
public static IPath getLocation(final IResource resource) {
16 years, 7 months
JBoss Tools SVN: r4515 - in trunk/seam/tests/org.jboss.tools.seam.core.test: projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-10-25 12:00:03 -0400 (Thu, 25 Oct 2007)
New Revision: 4515
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/EXIN-13
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.4 2007-10-25 16:00:03 UTC (rev 4515)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:drools="http://jboss.com/products/seam/drools"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:mail="http://jboss.com/products/seam/mail"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
+ http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.1.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
+ http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
+
+
+ <core:init debug="true" jndi-pattern="@jndiPattern@"/>
+
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000"
+ conversation-id-parameter="cid"
+ conversation-is-long-running-parameter="clr"/>
+
+
+ <core:entity-manager-factory name="SeamWebWarTestProjectEntityManagerFactory"
+ persistence-unit-name="SeamWebWarTestProject"/>
+
+ <core:ejb installed="@embeddedEjb@"/>
+
+
+
+ <event type="org.jboss.seam.notLoggedIn">
+ <action expression="#{redirect.captureCurrentView}"/>
+ </event>
+ <event type="org.jboss.seam.postAuthenticate">
+ <action expression="#{redirect.returnToCapturedView}"/>
+ </event>
+
+ <mail:mail-session host="localhost" port="2525" username="test" password="test" />
+
+ <!-- For use with jBPM pageflow or process management -->
+ <!--
+ <core:jbpm>
+ <core:process-definitions></core:process-definitions>
+ <core:pageflow-definitions></core:pageflow-definitions>
+ </core:jbpm>
+ -->
+
+</components>
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10 2007-10-25 16:00:03 UTC (rev 4515)
@@ -0,0 +1,37 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+ @Create
+ public void createMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11 2007-10-25 16:00:03 UTC (rev 4515)
@@ -0,0 +1,38 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+
+ @Unwrap
+ public void unwrapMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12 2007-10-25 16:00:03 UTC (rev 4515)
@@ -0,0 +1,38 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+
+ @Observer
+ public void observerMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9 2007-10-25 16:00:03 UTC (rev 4515)
@@ -0,0 +1,37 @@
+package org.domain.SeamWebWarTestProject.session;
+
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25 15:58:04 UTC (rev 4514)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25 16:00:03 UTC (rev 4515)
@@ -207,6 +207,7 @@
public void testComponentLifeCycleMethodsValidator() {
ISeamProject seamProject = getSeamProject(project);
+ IFile componentsFile = project.getFile("WebContent/WEB-INF/components.xml");
IFile statefulComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java");
@@ -227,8 +228,8 @@
refreshProject(project);
- String[] message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Destroy method' not found", message[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
+ String[] messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Destroy method' not found", messages[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
// Duplicate @Create method
System.out.println("Test - Duplicate @Create method");
@@ -244,8 +245,8 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Create method' not found", message[0].startsWith("Duplicate @Create method \"createMethod"));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Create method' not found", messages[0].startsWith("Duplicate @Create method \"createMethod"));
// Duplicate @Unwrap method
System.out.println("Test - Duplicate @Unwrap method");
@@ -261,14 +262,85 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Unwrap method' not found", message[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Unwrap method' not found", messages[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
// Only component class can have @Destroy method
+ System.out.println("Test - Only component class can have @Destroy method");
+
+ IFile componentsFile4 = project.getFile("WebContent/WEB-INF/components.4");
+
+ try{
+ componentsFile.setContents(componentsFile4.getContents(), true, false, new NullProgressMonitor());
+ componentsFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'components.xml' content to " +
+ "'components.4'", ex);
+ }
+ IFile statefulComponentFile9 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.9");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile9.getContents(), true, false, new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.9'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Destroy method' not found", "Only component class can have @Destroy method \"destroyMethod\"".equals(messages[0]));
+
// Only component class can have @Create method
+ System.out.println("Test - Only component class can have @Create method");
+
+ IFile statefulComponentFile10 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile10.getContents(), true, false, new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.10'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Create method' not found", "Only component class can have @Create method \"createMethod\"".equals(messages[0]));
+
// Only component class can have @Unwrap method
+ System.out.println("Test - Only component class can have @Unwrap method");
+
+ IFile statefulComponentFile11 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.11");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile11.getContents(), true, false, new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.11'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Unwrap method' not found", "Only component class can have @Unwrap method \"unwrapMethod\"".equals(messages[0]));
+
// Only component class can have @Observer method
-
+ System.out.println("Test - Only component class can have @Observer method");
+
+ IFile statefulComponentFile12 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile12.getContents(), true, false, new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.12'", ex);
+ }
+
+ refreshProject(project);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Only component class can have @Observer method' not found", "Only component class can have @Observer method \"observerMethod\"".equals(messages[0]));
}
public void testFactoriesValidator() {
16 years, 7 months
JBoss Tools SVN: r4514 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: widget/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-10-25 11:58:04 -0400 (Thu, 25 Oct 2007)
New Revision: 4514
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1130
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-25 15:19:43 UTC (rev 4513)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-25 15:58:04 UTC (rev 4514)
@@ -283,6 +283,15 @@
editor.doFillIntoGrid(parent);
}
+ public List<String> getRuntimeNames(String version) {
+ SeamRuntime[] rts = SeamRuntimeManager.getInstance().getRuntimes(SeamVersion.parseFromString(version));
+ List<String> result = new ArrayList<String>();
+ for(SeamRuntime seamRuntime : rts) {
+ result.add(seamRuntime.getName());
+ }
+ return result;
+ }
+
public List<String> getRuntimeNames() {
SeamRuntime[] rts = SeamRuntimeManager.getInstance().getRuntimes(/*SeamVersion.SEAM_1_2*/);
List<String> result = new ArrayList<String>();
@@ -476,7 +485,7 @@
@Override
public void run() {
IProfileListener listener = new ConnectionProfileChangeListener();
-
+
ProfileManager.getInstance().addProfileListener(listener);
NewCPWizardCategoryFilter filter = new NewCPWizardCategoryFilter("org.eclipse.datatools.connectivity.db.category"); //$NON-NLS-1$
NewCPWizard wizard = new NewCPWizard(filter, null);
@@ -508,7 +517,7 @@
ProfileManager.getInstance().removeProfileListener(listener);
}
}
-
+
/**
* It is overridden to fill Code Generation group with the default package
* names
@@ -531,6 +540,22 @@
.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)
+ ".test"); //$NON-NLS-1$
if (visible) {
+ ITaggedFieldEditor runtimesField = (ITaggedFieldEditor)((CompositeEditor)jBossSeamHomeEditor).getEditors().get(1);
+ Object oldValue = runtimesField.getValue();
+ Object newValue = "";
+ List<String> runtimes = getRuntimeNames(model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString());
+ if(oldValue==null || !runtimes.contains(oldValue)) {
+ Object defaultRnt = getSeamRuntimeDefaultValue();
+ if(defaultRnt!=null && runtimes.contains(defaultRnt)) {
+ newValue = defaultRnt;
+ } else if(runtimes.size()>0) {
+ newValue = runtimes.get(0);
+ }
+ } else {
+ newValue = oldValue;
+ }
+ runtimesField.setValue(newValue);
+ runtimesField.setTags(runtimes.toArray(new String[0]));
validate();
}
super.setVisible(visible);
@@ -573,7 +598,7 @@
return ValidatorFactory.NO_ERRORS;
}
}
-
+
class ProjectNamesDuplicationValidator implements IValidator {
String propertyName;
@@ -588,11 +613,11 @@
*/
public Map<String, String> validate(Object value, Object context) {
final String projectName = (String)value;
-
+
IDataModel model = (IDataModel)context;
final String deployAs = model.getStringProperty(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
-
+
final String testProjectName = projectName + "-test";
IStatus status = ProjectCreationDataModelProviderNew.validateName(testProjectName);
if (!status.isOK())
@@ -609,7 +634,7 @@
SeamUIMessages.VALIDATOR_FACTORY_EAR_PROJECT +
earProjectName +
SeamUIMessages.VALIDATOR_FACTORY_PROJECT_ALREADY_EXISTS);
-
+
final String ejbProjectName = projectName + "-ejb";
status = ProjectCreationDataModelProviderNew.validateName(ejbProjectName);
if (!status.isOK())
@@ -621,7 +646,7 @@
return ValidatorFactory.NO_ERRORS;
}
}
-
+
public class NewSeamRuntimeAction extends
ButtonFieldEditor.ButtonPressedAction {
/**
@@ -641,22 +666,23 @@
if (added.size()>0) {
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
- getFieldEditor().setValue(added.get(0).getName());
- ((ITaggedFieldEditor) ((CompositeEditor) jBossSeamHomeEditor)
- .getEditors().get(1)).setTags(getRuntimeNames()
- .toArray(new String[0]));
+
+ String seamVersion = model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
+ List<String> runtimes = getRuntimeNames(seamVersion);
+ SeamRuntime newRuntime = added.get(0);
+ if(seamVersion.equals(newRuntime.getVersion().toString())) {
+ getFieldEditor().setValue(added.get(0).getName());
+ }
+ ((ITaggedFieldEditor) ((CompositeEditor) jBossSeamHomeEditor).getEditors().get(1)).setTags(runtimes.toArray(new String[0]));
}
}
}
public class ConnectionProfileChangeListener implements IProfileListener {
-
-
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.IProfileListener#profileAdded(org.eclipse.datatools.connectivity.IConnectionProfile)
*/
public void profileAdded(IConnectionProfile profile) {
- // TODO Auto-generated method stub
connProfileSelEditor.setValue(profile.getName());
((ITaggedFieldEditor) ((CompositeEditor) connProfileSelEditor)
.getEditors().get(1)).setTags(getProfileNameList()
@@ -664,14 +690,14 @@
validate();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.IProfileListener#profileChanged(org.eclipse.datatools.connectivity.IConnectionProfile)
*/
public void profileChanged(IConnectionProfile profile) {
profileAdded(profile);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.IProfileListener#profileDeleted(org.eclipse.datatools.connectivity.IConnectionProfile)
*/
@@ -686,4 +712,4 @@
public void finishPressed() {
model.removeListener(validatorDelegate);
};
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-25 15:19:43 UTC (rev 4513)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-25 15:58:04 UTC (rev 4514)
@@ -98,6 +98,9 @@
}
public void setValue(Object newValue) {
+ if(newValue==null) {
+ return;
+ }
super.setValue(newValue);
if(comboField!=null) {
comboField.removePropertyChangeListener(this);
16 years, 7 months
JBoss Tools SVN: r4513 - trunk/common/plugins/org.jboss.tools.common.model.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-25 11:19:43 -0400 (Thu, 25 Oct 2007)
New Revision: 4513
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
Log:
JBIDE-1150
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2007-10-25 14:34:33 UTC (rev 4512)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2007-10-25 15:19:43 UTC (rev 4513)
@@ -27,6 +27,8 @@
matchingStrategy = "org.jboss.tools.common.core.resources.MatchingStrategyImpl"
name="%editors.xml.advanced.name">
<contentTypeBinding contentTypeId="org.eclipse.jst.j2ee.webDD"/>
+ <contentTypeBinding contentTypeId="org.eclipse.jst.jee.ee5webDD"/>
+
<contentTypeBinding contentTypeId="org.jboss.tools.common.model.ui.xml"/>
<contentTypeBinding contentTypeId="org.eclipse.jst.jsf.facesconfig.facesConfigFile"/>
16 years, 7 months
JBoss Tools SVN: r4512 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: hqleditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-10-25 10:34:33 -0400 (Thu, 25 Oct 2007)
New Revision: 4512
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorDocumentSetupParticipant.java
Log:
JBIDE-1172: HIbernate Dynamic SQL Preview is UGLY!
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2007-10-25 13:01:50 UTC (rev 4511)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2007-10-25 14:34:33 UTC (rev 4512)
@@ -50,6 +50,7 @@
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.QLFormatHelper;
import org.hibernate.eclipse.hqleditor.HQLEditor;
+import org.hibernate.eclipse.hqleditor.HQLEditorDocumentSetupParticipant;
import org.hibernate.eclipse.hqleditor.HQLSourceViewer;
import org.hibernate.eclipse.hqleditor.HQLSourceViewerConfiguration;
import org.hibernate.engine.query.HQLQueryPlan;
@@ -103,7 +104,8 @@
private SourceViewer textViewer;
private HQLEditor currentEditor;
private MonoReconciler reconciler;
-
+ private HQLEditorDocumentSetupParticipant docSetupParticipant = new HQLEditorDocumentSetupParticipant();
+
private void hookIntoEditor(IWorkbenchPartReference partRef) {
if(partRef==null) {
setCurrentEditor(null);
@@ -230,7 +232,11 @@
public void createPartControl(Composite parent) {
textViewer = new HQLSourceViewer( parent, new VerticalRuler(1), null, false, SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL );
//textViewer.setEditable(false);
- textViewer.setDocument( new Document() );
+ IDocument doc = new Document();
+ textViewer.setDocument( doc );
+
+ docSetupParticipant.setup( doc );
+
textViewer.getDocument().set("No HQL Query editor selected");
textViewer.configure(new HQLSourceViewerConfiguration(null));
@@ -276,6 +282,7 @@
.getActiveWorkbenchWindow();
IPartService service = window.getPartService();
service.removePartListener(partListener);
+ docSetupParticipant.unsetup();
super.dispose();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorDocumentSetupParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorDocumentSetupParticipant.java 2007-10-25 13:01:50 UTC (rev 4511)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorDocumentSetupParticipant.java 2007-10-25 14:34:33 UTC (rev 4512)
@@ -32,6 +32,7 @@
* order to setup document partitioning for HQL documents.
*/
public class HQLEditorDocumentSetupParticipant implements IDocumentSetupParticipant {
+ private IDocumentPartitioner partitioner;
/**
* Sets up the document to be ready for use by a text file buffer.
@@ -41,9 +42,13 @@
public void setup( IDocument document ) {
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 extension3 = (IDocumentExtension3) document;
- IDocumentPartitioner partitioner = new DefaultPartitioner( new HQLPartitionScanner(), HQLPartitionScanner.HQL_PARTITION_TYPES );
+ partitioner = new DefaultPartitioner( new HQLPartitionScanner(), HQLPartitionScanner.HQL_PARTITION_TYPES );
partitioner.connect( document );
extension3.setDocumentPartitioner( HQLSourceViewerConfiguration.HQL_PARTITIONING, partitioner );
}
}
+
+ public void unsetup() {
+ partitioner.disconnect();
+ }
}
16 years, 7 months
JBoss Tools SVN: r4511 - in trunk/seam/tests/org.jboss.tools.seam.core.test: src/org/jboss/tools/seam/core/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-10-25 09:01:50 -0400 (Thu, 25 Oct 2007)
New Revision: 4511
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/EXIN-13
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7 2007-10-25 13:01:50 UTC (rev 4511)
@@ -0,0 +1,64 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+@Name("statefulComponent")
+
+@Stateful
+(a)Scope(ScopeType.APPLICATION)
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+
+ @Create
+ public void createMethod(){
+
+ }
+
+ @Create
+ public void createMethod2(){
+
+ }
+
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8 2007-10-25 13:01:50 UTC (rev 4511)
@@ -0,0 +1,62 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+@Name("statefulComponent")
+
+@Stateful
+(a)Scope(ScopeType.APPLICATION)
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+ @Unwrap
+ public void unwrapMethod(){
+
+ }
+
+ @Unwrap
+ public void unwrapMethod2(){
+
+ }
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25 12:01:17 UTC (rev 4510)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25 13:01:50 UTC (rev 4511)
@@ -231,7 +231,39 @@
assertTrue("Problem marker 'Duplicate @Destroy method' not found", message[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
// Duplicate @Create method
+ System.out.println("Test - Duplicate @Create method");
+
+ IFile statefulComponentFile7 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile7.getContents(), true, false, new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.7'", ex);
+ }
+
+ refreshProject(project);
+
+ message = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Create method' not found", message[0].startsWith("Duplicate @Create method \"createMethod"));
+
// Duplicate @Unwrap method
+ System.out.println("Test - Duplicate @Unwrap method");
+
+ IFile statefulComponentFile8 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.8");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile8.getContents(), true, false, new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.8'", ex);
+ }
+
+ refreshProject(project);
+
+ message = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Unwrap method' not found", message[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
+
// Only component class can have @Destroy method
// Only component class can have @Create method
// Only component class can have @Unwrap method
16 years, 7 months
JBoss Tools SVN: r4510 - in trunk/seam/tests/org.jboss.tools.seam.core.test: src/org/jboss/tools/seam/core/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-10-25 08:01:17 -0400 (Thu, 25 Oct 2007)
New Revision: 4510
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/EXIN-13
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6 2007-10-25 12:01:17 UTC (rev 4510)
@@ -0,0 +1,56 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+@Name("statefulComponent")
+
+@Stateful
+(a)Scope(ScopeType.APPLICATION)
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+ @Destroy
+ public void destroyMethod2(){
+
+ }
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25 11:46:13 UTC (rev 4509)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-25 12:01:17 UTC (rev 4510)
@@ -99,9 +99,9 @@
refreshProject(project);
- String message = getMarkersMessage(bbcComponentFile);
+ String[] messages = getMarkersMessage(bbcComponentFile);
- assertTrue("Problem marker 'Duplicate component name' not found","Duplicate component name: abcComponent".equals(message));
+ assertTrue("Problem marker 'Duplicate component name' not found","Duplicate component name: abcComponent".equals(messages[0]));
// Stateful component does not contain @Remove method
System.out.println("Test - Stateful component does not contain @Remove method");
@@ -117,8 +117,8 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Stateful component does not contain @Remove method' not found", "Stateful component \"statefulComponent\" must have a method marked @Remove".equals(message));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Stateful component does not contain @Remove method' not found", "Stateful component \"statefulComponent\" must have a method marked @Remove".equals(messages[0]));
// Stateful component does not contain @Destroy method
System.out.println("Test - Stateful component does not contain @Destroy method");
@@ -134,8 +134,8 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Stateful component does not contain @Destroy method' not found", "Stateful component \"statefulComponent\" must have a method marked @Destroy".equals(message));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Stateful component does not contain @Destroy method' not found", "Stateful component \"statefulComponent\" must have a method marked @Destroy".equals(messages[0]));
// Stateful component has wrong scope
System.out.println("Test - Stateful component has wrong scope");
@@ -151,8 +151,8 @@
refreshProject(project);
- message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Stateful component has wrong scope' not found", "Stateful component \"statefulComponent\" should not have org.jboss.seam.ScopeType.PAGE, nor org.jboss.seam.ScopeType.STATELESS".equals(message));
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Stateful component has wrong scope' not found", "Stateful component \"statefulComponent\" should not have org.jboss.seam.ScopeType.PAGE, nor org.jboss.seam.ScopeType.STATELESS".equals(messages[0]));
// Component class name cannot be resolved to a type
System.out.println("Test - Component class name cannot be resolved to a type");
@@ -169,8 +169,8 @@
refreshProject(project);
- message = getMarkersMessage(componentsFile);
- assertTrue("Problem marker 'Component class name cannot be resolved to a type' not found", "\"org.domain.SeamWebTestProject.session.StateComponent\" cannot be resolved to a type".equals(message));
+ messages = getMarkersMessage(componentsFile);
+ assertTrue("Problem marker 'Component class name cannot be resolved to a type' not found", "\"org.domain.SeamWebTestProject.session.StateComponent\" cannot be resolved to a type".equals(messages[0]));
// Component class does not contain setter for property
System.out.println("Test - Component class does not contain setter for property");
@@ -197,8 +197,8 @@
refreshProject(project);
- message = getMarkersMessage(componentsFile);
- assertTrue("Problem marker 'Component class does not contain setter for property' not found", "Class \"StatefulComponent\" of component \"statefulComponent\" does not contain setter for property \"abc\"".equals(message));
+ messages = getMarkersMessage(componentsFile);
+ assertTrue("Problem marker 'Component class does not contain setter for property' not found", "Class \"StatefulComponent\" of component \"statefulComponent\" does not contain setter for property \"abc\"".equals(messages[0]));
}
public void testEntitiesValidator() {
@@ -227,8 +227,8 @@
refreshProject(project);
- String message = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Destroy method' not found", "Stateful component \"statefulComponent\" must have a method marked @Remove".equals(message));
+ String[] message = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Destroy method' not found", message[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
// Duplicate @Create method
// Duplicate @Unwrap method
@@ -269,19 +269,21 @@
return -1;
}
- private String getMarkersMessage(IFile file){
- String message="";
+ private String[] getMarkersMessage(IFile file){
+ String[] messages = new String[1];
+ messages[0]="";
try{
IMarker[] markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
+ messages = new String[markers.length];
for(int i=0;i<markers.length;i++){
System.out.println("Marker - "+markers[i].getAttribute(IMarker.MESSAGE, ""));
- message = markers[i].getAttribute(IMarker.MESSAGE, "");
+ messages[i] = markers[i].getAttribute(IMarker.MESSAGE, "");
}
}catch(CoreException ex){
JUnitUtils.fail("Error in getting problem markers", ex);
}
- return message;
+ return messages;
}
private void refreshProject(IProject project){
16 years, 7 months
JBoss Tools SVN: r4509 - trunk/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-25 07:46:13 -0400 (Thu, 25 Oct 2007)
New Revision: 4509
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
JBIDE-1182
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-10-25 11:42:41 UTC (rev 4508)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-10-25 11:46:13 UTC (rev 4509)
@@ -473,7 +473,7 @@
icon="images/xstudio/views/web_project.gif"
activeByDefault="true"
contentProvider="org.jboss.tools.jst.web.ui.navigator.XProjectContentProvider"
- labelProvider="org.jboss.tools.jst.web.ui.navigator.WebProjectsLabelProvider"
+ labelProvider="org.jboss.tools.jst.web.ui.navigator.XLabelProvider"
id="org.jboss.tools.jst.web.ui.navigator.projectContent">
<triggerPoints>
<or>
16 years, 7 months
JBoss Tools SVN: r4508 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-25 07:42:41 -0400 (Thu, 25 Oct 2007)
New Revision: 4508
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XLabelProvider.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java
Log:
JBIDE-1182
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java 2007-10-25 11:35:32 UTC (rev 4507)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XActionProvider.java 2007-10-25 11:42:41 UTC (rev 4508)
@@ -53,7 +53,9 @@
registerAction(actionBars, o, "CopyActions.Copy", ActionFactory.COPY.getId());
registerAction(actionBars, o, "CopyActions.Paste", ActionFactory.PASTE.getId());
registerAction(actionBars, o, "CopyActions.Cut", ActionFactory.CUT.getId());
- actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, new XOpenAction(o));
+ if(o.getFileType() <= XModelObject.FILE) {
+ actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, new XOpenAction(o));
+ }
}
}
Added: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XLabelProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XLabelProvider.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XLabelProvider.java 2007-10-25 11:42:41 UTC (rev 4508)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.navigator;
+
+import org.jboss.tools.common.model.impl.ExtraRootImpl;
+import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
+import org.jboss.tools.jst.web.model.pv.WebProjectNode;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class XLabelProvider extends WebProjectsLabelProvider {
+
+ public XLabelProvider() {}
+
+ public String getText(Object element) {
+ if(element instanceof WebProjectNode && element instanceof ExtraRootImpl) {
+ return WebUIMessages.WEB_RESOURCES;
+ }
+ return super.getText(element);
+ }
+
+
+}
16 years, 7 months
JBoss Tools SVN: r4507 - in trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages: xpl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-25 07:35:32 -0400 (Thu, 25 Oct 2007)
New Revision: 4507
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java
Log:
JBIDE-1182
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2007-10-25 11:31:46 UTC (rev 4506)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2007-10-25 11:35:32 UTC (rev 4507)
@@ -167,4 +167,5 @@
CREATE_NEW_GROUP=Create New Group
JAVA_PROJECT_EXISTS=Java project {0} exists. The wizard will make it {1} project
CHECK_JVM=Check JVM
-CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER=Context root cannot contain character {0}.
\ No newline at end of file
+CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER=Context root cannot contain character {0}.
+WEB_RESOURCES=Web Resources
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java 2007-10-25 11:31:46 UTC (rev 4506)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java 2007-10-25 11:35:32 UTC (rev 4507)
@@ -186,4 +186,5 @@
public static String CANNOT_FIND_TOOLSJAR;
public static String CHECK_JVM;
public static String CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER;
+ public static String WEB_RESOURCES;
}
16 years, 7 months