Author: dgolovin
Date: 2007-07-25 04:39:40 -0400 (Wed, 25 Jul 2007)
New Revision: 2647
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.jdt.core.prefs
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/seam16.png
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/sample.gif
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.ui/images/xstudio/wizards/new_jsp_file.gif
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/build.properties
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
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/text/java/SeamELProposalProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
trunk/struts/plugins/org.jboss.tools.struts.ui/images/xstudio/wizards/new_jsp_file.gif
Log:
http://jira.jboss.org/jira/browse/EXIN-221
creating ear seam project
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -234,7 +234,7 @@
}
resource.refreshLocal(IResource.DEPTH_ONE, null);
} catch (Exception e) {
- ModelPlugin.getPluginLog().logError("Exception caught in
FolderImpl.update()");
+ ModelPlugin.getPluginLog().logError("Exception caught in
FolderImpl.update()",e);
} finally {
fsi.unlockUpdate();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2007-07-25 08:32:20 UTC
(rev 2646)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2007-07-25 08:39:40 UTC
(rev 2647)
@@ -43,7 +43,10 @@
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.wst.web,
- org.eclipse.jdt.core.manipulation
+ org.eclipse.jdt.core.manipulation,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.modulecore
Bundle-Version: 2.0.0
Eclipse-LazyStart: true
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2007-07-25 08:32:20 UTC (rev 2646)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2007-07-25 08:39:40 UTC (rev 2647)
@@ -1908,5 +1908,16 @@
<xclass id="org.jboss.tools.jsf.model.helpers.autolayout.JSFItems"
class="org.jboss.tools.jsf.model.helpers.autolayout.JSFItems"/>
</extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <event-handler
+ facet="jst.jsf"
+ type="PRE_INSTALL"
+ version="[1.1">
+ <delegate
+
class="org.jboss.tools.jsf.project.facet.PostInstallJsfFacetDelegate">
+ </delegate>
+ </event-handler>
+ </extension>
-</plugin>
\ No newline at end of file
+</plugin>
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/images/xstudio/wizards/new_jsp_file.gif
===================================================================
(Binary files differ)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-25 08:32:20
UTC (rev 2646)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-25 08:39:40
UTC (rev 2647)
@@ -25,6 +25,7 @@
org.eclipse.jst.j2ee,
org.eclipse.jst.ws,
org.eclipse.jface.text,
+ org.eclipse.jdt.launching,
org.eclipse.wst.sse.core,
org.eclipse.wst.xml.core
Provide-Package: org.jboss.tools.seam.core,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/build.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/build.properties 2007-07-25 08:32:20 UTC
(rev 2646)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/build.properties 2007-07-25 08:39:40 UTC
(rev 2647)
@@ -2,5 +2,12 @@
bin.includes = plugin.xml,\
META-INF/,\
seam-core.jar,\
- plugin.properties
+ plugin.properties,\
+ templates/
jars.compile.order = seam-core.jar
+src.includes = templates/,\
+ src/,\
+ plugin.xml,\
+ plugin.properties,\
+ build.properties,\
+ META-INF/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-25 08:32:20 UTC (rev
2646)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-25 08:39:40 UTC (rev
2647)
@@ -224,4 +224,4 @@
</persistent>
</extension>
-</plugin>
\ No newline at end of file
+</plugin>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -106,13 +106,15 @@
//ignore - all checks are done above
return null;
}
- try {
- ISeamProject seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
- if(resolve) seamProject.resolve();
- return seamProject;
- } catch (Exception e) {
- getPluginLog().logError(e);
- }
+
+ ISeamProject seamProject;
+ try {
+ seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
+ if(resolve) seamProject.resolve();
+ return seamProject;
+ } catch (CoreException e) {
+ getPluginLog().logError(e);
+ }
return null;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -117,7 +118,7 @@
id = s.id;
resource = s.resource;
- return null;
+ return new ArrayList<Change>();
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -10,18 +10,16 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.project.facet;
import java.io.File;
+import java.io.FileFilter;
import java.io.IOException;
-import java.util.Properties;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.regex.Pattern;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
-import org.apache.tools.ant.types.Resource;
-import org.apache.tools.ant.types.resources.FileResource;
import org.apache.tools.ant.util.FileUtils;
-import org.apache.tools.ant.util.ResourceUtils;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import
org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegete.FileSetFileFilter;
/**
*
@@ -30,12 +28,114 @@
*/
public class AntCopyUtils {
+ public static class FileSet {
+
+ File dir = null;
+
+ List<Pattern> include = new ArrayList<Pattern>();
+
+ List<Pattern> exclude = new ArrayList<Pattern>();
+
+ public FileSet(String dir) {
+ this.dir = new File(dir);
+ }
+
+ public FileSet(File dir) {
+ this.dir = dir;
+ }
+
+ public FileSet(FileSet template) {
+ addTemplate(template);
+ }
+
+ public void addTemplate(FileSet template){
+ include.addAll(template.getIncluded());
+ exclude.addAll(template.getExcluded());
+ }
+
+ public FileSet() {
+
+ }
+
+ public FileSet add(FileSet set) {
+ addTemplate(set);
+ return this;
+ }
+
+ public FileSet dir(String dir) {
+ this.dir = new File(dir);
+ return this;
+ }
+
+ public FileSet dir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public FileSet include(String pattern) {
+ include.add(Pattern.compile(pattern));
+ return this;
+
+ }
+
+ public FileSet exclude(String pattern) {
+ exclude.add(Pattern.compile(pattern));
+ return this;
+ }
+
+ public boolean isIncluded(String file) {
+ int i = dir.getAbsolutePath().length()+1;
+ String relatedPath = file.substring(i);
+ if(new File(file).isDirectory())return true;
+ for (Pattern pattern : include) {
+ if(pattern.matcher(relatedPath.replace('\\', '/')).matches() ) {
+ return !isExcluded(relatedPath);
+ }
+ }
+ return false;
+ }
+
+ public boolean isExcluded(String file){
+ for (Pattern pattern : exclude) {
+ if(pattern.matcher(file.replace('\\', '/')).matches()) return true;
+ }
+ return false;
+ }
+
+ public List<Pattern> getExcluded() {
+ return Collections.unmodifiableList(exclude);
+ }
+
+ public List<Pattern> getIncluded() {
+ return Collections.unmodifiableList(include);
+ }
+
+ /**
+ * @return
+ */
+ public File getDir() {
+ return dir;
+ }
+ }
+
+ public static class FileSetFileFilter implements FileFilter {
+
+ FileSet set;
+ public FileSetFileFilter(FileSet set) {
+ this.set = set;
+ }
+
+ public boolean accept(File pathname){
+ return set.isIncluded(pathname.getAbsolutePath());
+ }
+ }
+
public static void copyFilesAndFolders(File sourceFolder, File destinationFolder,
FilterSetCollection set, boolean override) {
- copyFilesAndFolders(sourceFolder, destinationFolder, null, set, override);
+ copyFilesAndFolders(sourceFolder, destinationFolder,null, set, override);
}
public static void copyFilesAndFolders(File sourceFolder, File destinationFolder,
- FileSetFileFilter fileSetFilter,
+ AntCopyUtils.FileSetFileFilter fileSetFilter,
FilterSetCollection filterSetCollection, boolean override) {
File[] files =
fileSetFilter==null?sourceFolder.listFiles():sourceFolder.listFiles(fileSetFilter);
for (File file : files) {
@@ -65,6 +165,7 @@
SeamCorePlugin.getPluginLog().logError(e);
}
}
+
public static void copyFileToFile(File source, File dest, FilterSetCollection
filterSetCollection, boolean override ) {
try {
FileUtils.getFileUtils().copyFile(source, dest,filterSetCollection,override);
@@ -72,4 +173,16 @@
SeamCorePlugin.getPluginLog().logError(e);
}
}
+
+ public static void copyFiles(File source, File dest, FileFilter filter) {
+ dest.mkdir();
+ for (File file:source.listFiles(filter)) {
+ if(file.isDirectory())continue;
+ try {
+ FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new
FilterSetCollection(),true);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -11,9 +11,6 @@
package org.jboss.tools.seam.internal.core.project.facet;
-import java.util.HashMap;
-import java.util.Map;
-
import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
/**
@@ -23,7 +20,7 @@
*/
public interface ISeamFacetDataModelProperties extends IActionConfigFactory {
- public static final String SEAM_PROJECT_NAME = "seam.project.name";
+ public static final String SEAM_PROJECT_NAME = "project.name";
public static final String SEAM_PROJECT_INSTANCE = "seam.project.instance";
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -10,12 +10,16 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.project.facet;
+import java.io.File;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+import org.jboss.tools.seam.core.SeamCorePlugin;
/**
* Data model provider for Seam facet wizard page
@@ -82,4 +86,8 @@
}
return super.getDefaultProperty(propertyName);
}
+
+ public static File getTemplatesFolder() throws IOException {
+ return new
File(FileLocator.resolve(Platform.getBundle(SeamCorePlugin.PLUGIN_ID).getEntry("/templates")).getPath());
+ }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -11,24 +11,21 @@
package org.jboss.tools.seam.internal.core.project.facet;
import java.io.File;
-import java.io.FileFilter;
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Pattern;
import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
-import org.apache.tools.ant.util.FileUtils;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -39,12 +36,14 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamResourceVisitor;
public class SeamFacetInstallDelegete extends Object implements IDelegate {
- public static String PROFILE = "dev-war";
+ public static String DEV_WAR_PROFILE = "dev-war";
+ public static String DEV_EAR_PROFILE = "dev";
- public static FileSet TOMCAT_WAR_LIB_FILESET = new FileSet()
+ public static AntCopyUtils.FileSet TOMCAT_WAR_LIB_FILESET = new AntCopyUtils.FileSet()
.include("activation\\.jar")
.include("ajax4jsf*.\\.jar")
.include("commons-beanutils.*\\.jar")
@@ -76,10 +75,9 @@
.include("spring\\.jar")
.include("thirdparty-all\\.jar");
- public static FileSet JBOSS_WAR_LIB_FILESET = new FileSet()
+ public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_WAR_CONFIG = new
AntCopyUtils.FileSet()
.include("ajax4jsf.*\\.jar")
.include("antlr.*\\.jar")
- .include("antlr.*\\.jar")
.include("commons-beanutils.*\\.jar")
.include("commons-collections.*\\.jar")
.include("commons-digester.*\\.jar")
@@ -101,13 +99,37 @@
.include("stringtemplate.*\\.jar")
.include("testng-.*\\.jar");
- public static FileSet EAR_LIB_FILESET = new FileSet()
- .include("jboss-aop-jdk50\\.jar")
- .include("jboss-cache-jdk50\\.jar")
- .include("jboss-seam\\.jar")
- .include("jgroups\\.jar");
+ public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new
AntCopyUtils.FileSet()
+ .include("ajax4jsf.*\\.jar")
+ .include("commons-beanutils.*\\.jar")
+ .include("commons-digester.*\\.jar")
+ .include("commons-collections.*\\.jar")
+ .include("jboss-seam-debug\\.jar")
+ .include("jboss-seam-ioc\\.jar")
+ .include("jboss-seam-mail\\.jar")
+ .include("jboss-seam-pdf\\.jar")
+ .include("jboss-seam-remoting\\.jar")
+ .include("jboss-seam-ui\\.jar")
+ .include("jsf-facelets\\.jar")
+ .include("oscache.*\\.jar");
+
+ public static AntCopyUtils.FileSet JBOSS_EAR_CONTENT = new AntCopyUtils.FileSet()
+ .include("antlr.*\\.jar")
+ .include("commons-jci-core.*\\.jar")
+ .include("commons-jci-janino.*\\.jar")
+ .include("drools-compiler.*\\.jar")
+ .include("drools-core.*\\.jar")
+ .include("janino.*\\.jar")
+ .include("jboss-seam.jar")
+ .include("jbpm.*\\.jar")
+ .include("security\\.drl")
+ .include("stringtemplate.*\\.jar");
- public static FileSet VIEW_FILESET = new FileSet()
+ public static AntCopyUtils.FileSet JBOSS_EAR_CONTENT_META_INF = new
AntCopyUtils.FileSet()
+ .include("META-INF/application\\.xml")
+ .include("META-INF/jboss-app\\.xml");
+
+ public static AntCopyUtils.FileSet VIEW_FILESET = new AntCopyUtils.FileSet()
.include("home\\.xhtml")
.include("error\\.xhtml")
.include("login\\.xhtml")
@@ -120,28 +142,31 @@
.include("img")
.exclude(".*/.*\\.ftl");
- public static FileSet JBOOS_WAR_WEBINF_SET = new FileSet()
+ public static AntCopyUtils.FileSet JBOOS_WAR_WEBINF_SET = new AntCopyUtils.FileSet()
.include("WEB-INF/web\\.xml")
.include("WEB-INF/pages\\.xml")
.include("WEB-INF/jboss-web\\.xml")
.include("WEB-INF/faces-config\\.xml")
.include("WEB-INF/componets\\.xml");
- public static FileSet JBOOS_WAR_WEB_INF_CLASSES_SET = new FileSet()
+ public static AntCopyUtils.FileSet JBOOS_WAR_WEB_INF_CLASSES_SET = new
AntCopyUtils.FileSet()
.include("import\\.sql")
.include("security\\.drl")
.include("seam\\.properties")
.include("messages_en\\.properties");
+ public static AntCopyUtils.FileSet JBOSS_EAR_META_INF_SET = new AntCopyUtils.FileSet()
+ .include("META-INF/jboss-app\\.xml");
+
public static String DROOLS_LIB_SEAM_RELATED_PATH = "drools/lib";
public static String SEAM_LIB_RELATED_PATH = "lib";
public static String WEB_LIBRARIES_RELATED_PATH = "WEB-INF/lib";
- public void execute(IProject project, IProjectFacetVersion fv,
+ public void execute(final IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
- IDataModel model = (IDataModel)config;
+ final IDataModel model = (IDataModel)config;
// get WebContents folder path from DWP model
WebArtifactEdit edit = WebArtifactEdit.getWebArtifactEditForRead(project);
@@ -151,78 +176,70 @@
IContainer folder = webRootFolder.getUnderlyingFolder();
model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
- File webContentFolder = folder.getLocation().toFile();
- File webInfFolder = new File(webContentFolder,"WEB-INF");
- File webInfClasses = new File(webInfFolder,"classes");
- File webInfClassesMetaInf = new File(webInfClasses, "META-INF");
+ final File webContentFolder = folder.getLocation().toFile();
+ final File webInfFolder = new File(webContentFolder,"WEB-INF");
+ final File webInfClasses = new File(webInfFolder,"classes");
+ final File webInfClassesMetaInf = new File(webInfClasses, "META-INF");
webInfClassesMetaInf.mkdirs();
- File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
- File srcFolder = srcRootFolder.getUnderlyingFolder().getLocation().toFile();
- File srcWebInf = new File(srcFolder, "META-INF");
- String seamHomePath =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
+ final File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
+ final File srcFolder = srcRootFolder.getUnderlyingFolder().getLocation().toFile();
+ final File srcWebInf = new File(srcFolder, "META-INF");
- File seamHomeFolder = new File(seamHomePath);
- File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
- File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
- File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
- File securityDrools = new File(seamGenResFolder,"security.drl");
- File seamGenHomeFolder = new File(seamHomePath,"seam-gen");
- File seamGenViewSource = new File(seamGenHomeFolder,"view");
- File dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml");
-
- File jdbcDriverFile = new
File(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH).toString());
- File hibernateConsoleLaunchFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.launch");
- File hibernateConsolePropsFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.properties");
- File hibernateConsolePref = new File(seamGenHomeFolder,
"hibernatetools/.settings/org.hibernate.eclipse.console.prefs");
- File persistenceFile = new File(seamGenResFolder,"META-INF/persistence-" +
PROFILE + ".xml");
+ final String seamHomePath =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
- FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
- FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- FilterSet filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
+ final File seamHomeFolder = new File(seamHomePath);
+ final File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
+ final File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
+ final File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
+ final File seamGenHomeFolder = new File(seamHomePath,"seam-gen");
+ final File seamGenViewSource = new File(seamGenHomeFolder,"view");
+ final File dataSourceDsFile = new File(seamGenResFolder,
"datasource-ds.xml");
+ final File componentsFile = new
File(seamGenResFolder,"WEB-INF/components"+(isWarConfiguration(model)?"-war":"")+".xml");
+ final File jdbcDriverFile = new
File(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH).toString());
+ final File hibernateConsoleLaunchFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.launch");
+ final File hibernateConsolePropsFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.properties");
+ final File hibernateConsolePref = new File(seamGenHomeFolder,
"hibernatetools/.settings/org.hibernate.eclipse.console.prefs");
+ final File persistenceFile = new
File(seamGenResFolder,"META-INF/persistence-" +
(isWarConfiguration(model)?DEV_WAR_PROFILE:DEV_EAR_PROFILE) + ".xml");
+
+ final File applicationFile = new
File(seamGenResFolder,"META-INF/application.xml");
+
+ final FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ final FilterSet projectFilterSet =
SeamFacetFilterSetFactory.createProjectFilterSet(model);
+ final FilterSet filtersFilterSet =
SeamFacetFilterSetFactory.createFiltersFilterSet(model);
+
// ****************************************************************
// Copy view folder from seam-gen installation to WebContent folder
// ****************************************************************
-
- FileSet viewFileSet = new FileSet(VIEW_FILESET).dir(seamGenViewSource);
- FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
+ final AntCopyUtils.FileSet viewFileSet = new
AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
+ final FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
viewFilterSetCollection.addFilterSet(jdbcFilterSet);
viewFilterSetCollection.addFilterSet(projectFilterSet);
+
AntCopyUtils.copyFilesAndFolders(
seamGenViewSource,
webContentFolder,
- new FileSetFileFilter(viewFileSet),
+ new AntCopyUtils.FileSetFileFilter(viewFileSet),
viewFilterSetCollection,
true);
// *******************************************************************
// Copy manifest and configuration resources the same way as view
// *******************************************************************
+ AntCopyUtils.FileSet webInfSet = new
AntCopyUtils.FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
- FileSet webInfSet = new FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder,webContentFolder,new FileSetFileFilter(webInfSet),
viewFilterSetCollection, true);
-
- FileSet webInfClassesSet = new
FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder,srcFolder,new FileSetFileFilter(webInfClassesSet),
viewFilterSetCollection, true);
-
AntCopyUtils.copyFileToFile(
- dataSourceDsFile,
- new File(srcFolder,project.getName()+"-ds.xml"),
- viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFile(
- hibernateConsoleLaunchFile,
- new File(project.getLocation().toFile(),project.getName()+".launch"),
+ componentsFile,
+ new File(webInfFolder,"components.xml"),
new FilterSetCollection(projectFilterSet), true);
-
- AntCopyUtils.copyFileToFile(
- persistenceFile,
- new File(srcWebInf,"persistence.xml"),
- new FilterSetCollection(projectFilterSet), true);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,webContentFolder,new AntCopyUtils.FileSetFileFilter(webInfSet),
viewFilterSetCollection, true);
+ AntCopyUtils.FileSet webInfClassesSet = new
AntCopyUtils.FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,srcFolder,new AntCopyUtils.FileSetFileFilter(webInfClassesSet),
viewFilterSetCollection, true);
+
FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
hibernateDialectFilterSet.addFilterSet(projectFilterSet);
@@ -232,23 +249,6 @@
hibernateConsolePropsFile,
project.getLocation().toFile(),
hibernateDialectFilterSet, true);
-
- // add copy for /hibernatetools/seam-gen.reveng.xml
-
-
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePref,
- new File(project.getLocation().toFile(),".settings"),
- new FilterSetCollection(projectFilterSet), true);
-
- //
********************************************************************************************
- // Copy libraries libraries (seam jars, seam dependencies jars, drols jars, jdbc jar)
- //
********************************************************************************************
- copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamHomeFolder)));
- copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamLibFolder)));
- copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(droolsLibFolder)));
- copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamHomeFolder)));
- copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamLibFolder)));
//
********************************************************************************************
// Copy JDBC driver if there is any
@@ -256,221 +256,166 @@
if(jdbcDriverFile.exists())
AntCopyUtils.copyFileToFolder(jdbcDriverFile, webLibFolder, true);
- // Copy sources to src
- AntCopyUtils.copyFileToFile(
- new File(seamGenHomeFolder,"src/Authenticator.java"),
- new File(project.getLocation().toFile(),"src/" +
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"),
- new FilterSetCollection(filtersFilterSet), true);
-
+
// TODO may be generate RHDS studio feature to show it on projects view
//
********************************************************************************************
// Handle WAR/EAR configurations
//
********************************************************************************************
- if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS).equals("war"))
{
- AntCopyUtils.copyFileToFile(
- new File(seamGenResFolder,"WEB-INF/components-war.xml"),
- new File(webInfFolder,"components.xml"),
+ if(isWarConfiguration(model)) {
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(project.getLocation().toFile(),".settings"),
new FilterSetCollection(projectFilterSet), true);
+
+ // In case of WAR configuration
+ AntCopyUtils.copyFiles(seamHomeFolder,webLibFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,webLibFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder,webLibFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
- //
********************************************************************************************
- // TODO replace with appropriate one to handle Dynamic Web Project Structure
- //
********************************************************************************************
- AntCopyUtils.copyFileToFile(
- new File(seamHomeFolder,"seam-gen/build-scripts/build-war.xml"),
- new File(project.getLocation().toFile(),"build.xml"),
- new FilterSetCollection(projectFilterSet), true);
//
********************************************************************************************
// Copy seam project indicator
//
********************************************************************************************
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"),
srcFolder, true);
- } else {
- // copy ear files
+ // Copy sources to src
AntCopyUtils.copyFileToFile(
- new File(seamGenResFolder,"WEB-INF/components.xml"),
- new File(webInfFolder,"components.xml"),
- new FilterSetCollection(projectFilterSet), true);
+ new File(seamGenHomeFolder,"src/Authenticator.java"),
+ new File(project.getLocation().toFile(),"src/" +
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"),
+ new FilterSetCollection(filtersFilterSet), true);
+
AntCopyUtils.copyFileToFile(
- new File(seamHomeFolder,"seam-gen/build-scripts/build.xml"),
- new File(project.getLocation().toFile(),"build.xml"),
- new FilterSetCollection(projectFilterSet), true);
- }
-
- writeXModel(project, model);
-
-
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
-
- EclipseResourceUtil.addNatureToProject(project,
"org.jboss.tools.jsf.jsfnature");
- EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ persistenceFile,
+ new File(project.getLocation().toFile(),"src/META-INF/persistence.xml"),
+ viewFilterSetCollection, true);
- }
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(srcFolder,project.getName()+"-ds.xml"),
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(project.getLocation().toFile(),project.getName()+".launch"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ if(jdbcDriverFile.exists())
+ AntCopyUtils.copyFileToFolder(jdbcDriverFile, webLibFolder, true);
+
+ } else {
+
+ // In case of EAR configuration
+ AntCopyUtils.copyFiles(seamHomeFolder,webLibFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,webLibFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder,webLibFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
- public static void copyFiles(File source, File dest, FileFilter filter) {
- dest.mkdir();
- for (File file:source.listFiles(filter)) {
- if(file.isDirectory())continue;
- try {
- FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new
FilterSetCollection(),true);
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
- }
+ Job create = new Job("New WTP") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+
+ IProject ear =
WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear",
monitor);
+
+ try {
+ FilterSet filterSet = new FilterSet();
+ filterSet.addFilter("projectName", project.getName());
+ filterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimename(project));
+
+ File earContentsFolder = new
File(ear.getLocation().toFile(),"EarContent");
+ File earContentsMetaInfFolder = new File(earContentsFolder,"META-INF");
+
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,
+ earContentsFolder,
+ new AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_META_INF_SET).dir(seamGenResFolder)),
+ viewFilterSetCollection,true);
- public static class FileSet {
-
- File dir = null;
-
- List<Pattern> include = new ArrayList<Pattern>();
-
- List<Pattern> exclude = new ArrayList<Pattern>();
-
- public FileSet(String dir) {
- this.dir = new File(dir);
- }
-
- public FileSet(File dir) {
- this.dir = dir;
- }
-
- public FileSet(FileSet template) {
- addTemplate(template);
- }
-
- public void addTemplate(FileSet template){
- include.addAll(template.getIncluded());
- exclude.addAll(template.getExcluded());
- }
-
- public FileSet() {
+ // Copy configuration files from template
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ear"),
+ ear.getLocation().toFile(),
+ new FilterSetCollection(filterSet), true);
+
+ // Fill ear contents
+ AntCopyUtils.copyFiles(seamHomeFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(seamGenResFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)));
- }
-
- public FileSet add(FileSet set) {
- addTemplate(set);
- return this;
- }
-
- public FileSet dir(String dir) {
- this.dir = new File(dir);
- return this;
- }
-
- public FileSet dir(File dir) {
- this.dir = dir;
- return this;
- }
-
- public FileSet include(String pattern) {
- include.add(Pattern.compile(pattern));
- return this;
-
- }
-
- public FileSet exclude(String pattern) {
- exclude.add(Pattern.compile(pattern));
- return this;
- }
-
- public boolean isIncluded(String file) {
- int i = dir.getAbsolutePath().length()+1;
- String relatedPath = file.substring(i);
- if(new File(file).isDirectory())return true;
- for (Pattern pattern : include) {
- if(pattern.matcher(relatedPath.replace('\\', '/')).matches() ) {
- return !isExcluded(relatedPath);
+ //
********************************************************************************************
+ // Copy JDBC driver if there is any
+ //
********************************************************************************************
+ if(jdbcDriverFile.exists())
+ AntCopyUtils.copyFileToFolder(jdbcDriverFile, earContentsFolder, true);
+
+ IProject ejb =
WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb",
monitor);
+
+
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ejb"),
+ ejb.getLocation().toFile(),
+ new FilterSetCollection(filterSet), true);
+
+ //
*******************************************************************************************
+ // Copy sources to ejb project in case of EAR configuration
+ //
*******************************************************************************************
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"),
+ new File(ejb.getLocation().toFile(),"ejbModule/" +
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"),
+ new FilterSetCollection(filtersFilterSet), true);
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new
File(ejb.getLocation().toFile(),"ejbModule/META-INF/persistence.xml"),
+ viewFilterSetCollection, true);
+ //
********************************************************************************************
+ // Copy seam project indicator
+ //
********************************************************************************************
+ AntCopyUtils.copyFileToFolder(new
File(seamGenResFolder,"seam.properties"), new
File(ejb.getLocation().toFile(),"ejbModule/"), true);
+
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new
File(ejb.getLocation().toFile(),"ejbModule/"+project.getName()+"-ds.xml"),
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder,"META-INF/ejb-jar.xml"),
+ new File(ejb.getLocation().toFile(),"ejbModule/META-INF/"),
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(ejb.getLocation().toFile(),".settings"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(ejb.getLocation().toFile(),ejb.getName()+".launch"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ ear.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ ejb.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return Status.OK_STATUS;
}
- }
- return false;
+ };
+ create.setRule(ResourcesPlugin.getWorkspace().getRoot());
+ create.schedule();
}
- public boolean isExcluded(String file){
- for (Pattern pattern : exclude) {
- if(pattern.matcher(file.replace('\\', '/')).matches()) return true;
- }
- return false;
- }
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- public List<Pattern> getExcluded() {
- return Collections.unmodifiableList(exclude);
- }
-
- public List<Pattern> getIncluded() {
- return Collections.unmodifiableList(include);
- }
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
- /**
- * @return
- */
- public File getDir() {
- return dir;
- }
}
-
- public static class FileSetFileFilter implements FileFilter {
-
- FileSet set;
- public FileSetFileFilter(FileSet set) {
- this.set = set;
- }
-
- public boolean accept(File pathname){
- return set.isIncluded(pathname.getAbsolutePath());
- }
- }
- private void writeXModel(IProject project, IDataModel model) {
- String projectName = project.getName();
- String webContent = "WebContent";
-
- //TODO This returns null. Why? How else can we get WebContent folder name?
- webContent =
(String)model.getProperty(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER);
-
- if(webContent == null) {
- webContent = "WebContent";
- }
- String src = "src";
-
- String[] srcs = EclipseResourceUtil.getJavaProjectSrcLocations(project);
- if (srcs.length > 0) {
- src =
srcs[0].replace('\\','/').substring(srcs[0].lastIndexOf('/') +
1);
- }
- File location = new
File(project.getLocation().toFile(),".settings/org.jboss.tools.jst.web.xml");
-
- Object[] arguments = {
- projectName,
- webContent,
- src
- };
- String body = MessageFormat.format(XMODEL, arguments);
-
- org.jboss.tools.common.util.FileUtil.writeFile(location, body);
+ public static boolean isWarConfiguration(IDataModel model) {
+ return
"war".equals(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS));
}
-
- /**
- * {0} - project name
- * {1} - WebContent folder name
- * {2} - src folder name
- */
- private static String XMODEL =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
- "<FILESYSTEMS APPLICATION_NAME=\"{0}\"
ENTITY=\"FileSystems\"" +
- " VERSION=\"2.0.0\" WORKSPACE_HOME=\"./{1}/WEB-INF\">"
+
- "<FILESYSTEM ENTITY=\"FileSystemFolder\"
LOCATION=\"%redhat.workspace%\" NAME=\"WEB-INF\"/>" +
- "<FILESYSTEM ENTITY=\"FileSystemFolder\"
INFO=\"Content-Type=Web\"" +
- " LOCATION=\"%redhat.workspace%/..\"
NAME=\"WEB-ROOT\"/>" +
- "<FILESYSTEM ENTITY=\"FileSystemFolder\"" +
- " LOCATION=\"%redhat.workspace%/../../{2}\"
NAME=\"src\"/>" +
- "<FILESYSTEM ENTITY=\"FileSystemFolder\"
LOCATION=\"%redhat.workspace%/lib\" NAME=\"lib\"/>" +
- "<FILESYSTEM ENTITY=\"FileSystemFolder\"" +
- " LOCATION=\"%redhat.workspace%/classes\"
NAME=\"classes\"/>" +
- "<WEB ENTITY=\"JstWeb\" MODEL_PATH=\"/web.xml\"
SERVLET_VERSION=\"2.4\">" +
- " <MODULE ENTITY=\"WebJSFModule\"
MODEL_PATH=\"/faces-config.xml\"" +
- " ROOT=\"WEB-ROOT\" SRC=\"src\"
URI=\"/WEB-INF/faces-config.xml\"/>" +
- "</WEB>" +
- "</FILESYSTEMS>"
- ;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -10,10 +10,25 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.project.facet;
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -30,10 +45,10 @@
/* (non-Javadoc)
* @see
org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object,
org.eclipse.core.runtime.IProgressMonitor)
*/
- public void execute(IProject project, IProjectFacetVersion fv,
+ public void execute(final IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
IEclipsePreferences prefs = SeamCorePlugin.getSeamFacetPreferences(project);
- IDataModel model = (IDataModel)config;
+ final IDataModel model = (IDataModel)config;
for (Object propertyName : model.getAllProperties()) {
Object value = model.getProperty(propertyName.toString());
prefs.put(propertyName.toString(), value==null?"":value.toString());
@@ -43,5 +58,6 @@
} catch (BackingStoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
+
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -13,7 +13,6 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * 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.seam.internal.core.project.facet;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+/**
+ * @author eskimo
+ *
+ */
+public class WtpUtils {
+ public static IProject createEclipseProject(String projectName, IProgressMonitor
monitor) {
+
+ IProject newProjectHandle = ResourcesPlugin.getWorkspace()
+ .getRoot().getProject(projectName);
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProjectDescription description = workspace
+ .newProjectDescription(projectName);
+
+ String eclWsPath = ResourcesPlugin.getWorkspace().getRoot()
+ .getRawLocation().toString();
+ try {
+ newProjectHandle.create(description,new NullProgressMonitor());
+ newProjectHandle.open(monitor);
+
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return newProjectHandle;
+ }
+
+ public static IProject createEarProject(String projectName, IProgressMonitor monitor) {
+ IProject earProject = createEclipseProject(projectName,monitor);
+ return null;
+ }
+
+ public static IProject createDefaultEjbProject(String projectName,IProgressMonitor
monitor) {
+ IProject ejbProject = createEclipseProject(projectName,monitor);
+ //J2EEComponentClasspathContainer.CONTAINER_ID;
+ addJavaNature(ejbProject, new Path("build/classes"), new
Path("ejbModule"), monitor);
+ return null;
+ }
+
+ public static void addJavaNature(IProject project, IPath outputLocation, IPath
srcLocation, IProgressMonitor monitor) {
+ try {
+ IProjectDescription newDescr = project.getDescription();
+ newDescr.setNatureIds(new String[] {JavaCore.NATURE_ID});
+ ICommand builderCmd = project.getDescription().newCommand();
+ builderCmd.setBuilderName(JavaCore.BUILDER_ID);
+ newDescr.setBuildSpec(new ICommand[] {builderCmd});
+ project.setDescription(newDescr, monitor);
+ IJavaProject newJavaPr = JavaCore.create(project);
+ project.getFolder(outputLocation).create(IFolder.FORCE, true, monitor);
+ project.getFolder(srcLocation).create(IFolder.FORCE, true, monitor);
+
+ newJavaPr.setRawClasspath(
+ new IClasspathEntry[]{
+ JavaCore.newSourceEntry(Path.ROOT.append(srcLocation)),
+ JavaCore.newContainerEntry(new Path(JavaRuntime.JRE_CONTAINER))},
+ monitor);
+ newJavaPr.setOutputLocation(outputLocation, monitor);
+ newJavaPr.save(monitor, true);
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public static String getServerRuntimename(IProject project) {
+ IJavaProject javaProject = JavaCore.create(project);
+ if(javaProject!=null) {
+ try {
+ IClasspathEntry[] entries = javaProject.getRawClasspath();
+ IClasspathContainer container =
JavaCore.getClasspathContainer(Path.ROOT.append("org.eclipse.jst.server.core.container"),
javaProject);
+ for (IClasspathEntry classpathEntry : entries) {
+ if(Path.ROOT.append("org.eclipse.jst.server.core.container").isPrefixOf(classpathEntry.getPath()))
{
+ return classpathEntry.getPath().lastSegment();
+ }
+ }
+ System.out.println(container.getPath().lastSegment());
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ return "";
+ }
+}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -32,7 +32,6 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsLoader;
import org.jboss.tools.common.model.filesystems.impl.JarSystemImpl;
-import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
Added: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
(rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>@projectName@-ear</name>
+ <comment></comment>
+ <projects>
+ <project>@projectName@-ejb</project>
+ <project>@projectName@</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.project.facet.core.xml 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="@runtimeName@"/>
+ <fixed facet="jst.ear"/>
+ <installed facet="jst.ear" version="5.0"/>
+</faceted-project>
Added: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath
(rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="ejbModule"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/@runtimeName@"/>
+ <classpathentry exported="true" kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
(rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>@projectName@</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.jdt.core.prefs 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,7 @@
+#Thu Jul 19 17:20:50 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.project.facet.core.xml 2007-07-25
08:39:40 UTC (rev 2647)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="@runtimeName@"/>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.ejb"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.ejb" version="3.0"/>
+</faceted-project>
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/sample.gif
===================================================================
(Binary files differ)
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/seam16.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/seam16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-25 08:32:20 UTC (rev
2646)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-25 08:39:40 UTC (rev
2647)
@@ -11,7 +11,7 @@
<wizard
category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.ui.wizard.SeamProjectWizard"
- icon="icons/sample.gif"
+ icon="icons/view/seam_project_new.gif"
id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard"
name="Seam Project"
project="true">
@@ -25,7 +25,7 @@
<wizard
category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.ui.wizard.SeamActionWizard"
- icon="icons/sample.gif"
+ icon="icons/view/component_new.gif"
id="org.jboss.tools.seam.ui.wizard.SeamActionWizard"
name="Seam Action">
<description>
@@ -38,7 +38,7 @@
<wizard
category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.ui.wizard.SeamFofrmWizard"
- icon="icons/sample.gif"
+ icon="icons/view/component_new.gif"
id="org.jboss.tools.seam.ui.wizard2"
name="Seam Form">
<description>
@@ -90,7 +90,7 @@
<view
category="org.jboss.tools.seam.ui"
class="org.eclipse.ui.navigator.CommonNavigator"
- icon="icons/sample.gif"
+ icon="icons/seam16.png"
id="org.jboss.tools.seam.ui.views.SeamComponentsNavigator"
name="Seam Components">
</view>
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-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -86,7 +86,9 @@
ITaggedFieldEditor jdbcUrlForDb = IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,
"JDBC Url for Your Database:",
- Arrays.asList(HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])),HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])[0]);
+ Arrays.asList(HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(
+ HIBERNATE_HELPER.getDialectClass("HSQL"))[0])),
+ HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])[0].replace("<",
"").replace(">", ""));
IFieldEditor dbUserName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_USER_NAME,
"Database User Name:", "username");
@@ -246,7 +248,13 @@
if(evt.getNewValue()==null) {
jdbcUrlForDb.setTags(new String[]{});
} else {
- jdbcUrlForDb.setTags(HIBERNATE_HELPER.getConnectionURLS(evt.getNewValue().toString()));
+ String[] connectionUrls =
HIBERNATE_HELPER.getConnectionURLS(evt.getNewValue().toString());
+ String[] newUrls = new String[connectionUrls.length];
+ int i = 0;
+ for (String string : connectionUrls) {
+ newUrls[i++] = string.replace("<",
"").replace(">", "");
+ }
+ jdbcUrlForDb.setTags(newUrls);
}
}
});
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -12,6 +12,8 @@
package org.jboss.tools.seam.ui.text.java;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -249,10 +251,17 @@
if (string.length() > 0)
result.add(createProposal(string, prefix, offset));
}
-
+
if (result == null || result.size() == 0)
return NO_PROPOSALS;
- return (ICompletionProposal[]) result.toArray(new
ICompletionProposal[result.size()]);
+ ICompletionProposal[] resultArray = (ICompletionProposal[]) result.toArray(new
ICompletionProposal[uniqueSuggestions.size()]);
+ Arrays.sort(resultArray, new Comparator<ICompletionProposal>() {
+
+ public int compare(ICompletionProposal arg0,
+ ICompletionProposal arg1) {
+ return arg1.getDisplayString().compareTo(arg1.getDisplayString());
+ }});
+ return resultArray;
} catch (BadLocationException x) {
return NO_PROPOSALS;
} catch (StringIndexOutOfBoundsException e) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -23,6 +23,8 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Combo;
@@ -60,35 +62,31 @@
});
comboControl.addSelectionChangedListener(this);
+ comboControl.getCombo().addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ firePropertyChange(new Object(), comboControl.getCombo().getText());
+ }});
comboControl.setLabelProvider(new ILabelProvider() {
- public void addListener(ILabelProviderListener listener) {
- // TODO Auto-generated method stub
-
+ public void addListener(ILabelProviderListener listener) {
}
- public void dispose() {
- // TODO Auto-generated method stub
-
+ public void dispose() {
}
public boolean isLabelProperty(Object element, String property) {
- // TODO Auto-generated method stub
return false;
}
public void removeListener(ILabelProviderListener listener) {
- // TODO Auto-generated method stub
-
}
public Image getImage(Object element) {
- // TODO Auto-generated method stub
return null;
}
public String getText(Object element) {
- // TODO Auto-generated method stub
return element.toString();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -10,31 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.ui.wizard;
-import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
import org.eclipse.ui.INewWizard;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.internal.core.project.facet.SeamFacetFilterSetFactory;
/**
*
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-07-25
08:32:20 UTC (rev 2646)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-07-25
08:39:40 UTC (rev 2647)
@@ -68,7 +68,6 @@
Control findControlByClass(Composite comp, Class claz) {
for (Control child : comp.getChildren()) {
- System.out.println(child.getClass().getName());
if(child.getClass()==claz) {
return child;
} else if(child instanceof Composite){
@@ -82,7 +81,6 @@
Control findGroupByText(Composite comp, String text) {
for (Control child : comp.getChildren()) {
- System.out.println(child.getClass().getName());
if(child instanceof Group && ((Group)child).getText().equals(text)) {
return child;
} else if(child instanceof Composite){
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/images/xstudio/wizards/new_jsp_file.gif
===================================================================
(Binary files differ)