JBoss Tools SVN: r29294 - branches/jbosstools-3.2.x/seam/plugins/org.jboss.tools.seam.ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-02-23 17:51:34 -0500 (Wed, 23 Feb 2011)
New Revision: 29294
Modified:
branches/jbosstools-3.2.x/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-8464 fixed in brunch
Modified: branches/jbosstools-3.2.x/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.2.x/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-02-23 22:45:40 UTC (rev 29293)
+++ branches/jbosstools-3.2.x/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-02-23 22:51:34 UTC (rev 29294)
@@ -21,7 +21,7 @@
icon="$nl$/icons/view/seam_project_new.gif"
id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard"
name="Seam Web Project"
- preferredPerspectives="org.jboss.tools.seam.ui.SeamPerspective"
+ preferredPerspectives="org.jboss.tools.seam.ui.SeamPerspective, org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="true">
<description>
Create a Seam Web Project
14 years, 10 months
JBoss Tools SVN: r29293 - trunk/seam/plugins/org.jboss.tools.seam.ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-02-23 17:45:40 -0500 (Wed, 23 Feb 2011)
New Revision: 29293
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-8464 fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-02-23 22:40:50 UTC (rev 29292)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-02-23 22:45:40 UTC (rev 29293)
@@ -21,7 +21,7 @@
icon="$nl$/icons/view/seam_project_new.gif"
id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard"
name="Seam Web Project"
- preferredPerspectives="org.jboss.tools.seam.ui.SeamPerspective"
+ preferredPerspectives="org.jboss.tools.seam.ui.SeamPerspective, org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="true">
<description>
Create a Seam Web Project
14 years, 10 months
JBoss Tools SVN: r29292 - branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-02-23 17:40:50 -0500 (Wed, 23 Feb 2011)
New Revision: 29292
Modified:
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
Log:
JBIDE-8443
https://issues.jboss.org/browse/JBIDE-8443
Modified: branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
===================================================================
--- branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2011-02-23 22:37:51 UTC (rev 29291)
+++ branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2011-02-23 22:40:50 UTC (rev 29292)
@@ -1863,13 +1863,13 @@
visibility="false" xmlname="NAME"/>
<XModelAttribute PROPERTIES="save=always" default="BASIC"
name="auth-method" xmlname="auth-method.#text">
- <Constraint loader="List">
+ <Constraint loader="ListString">
<value name="BASIC"/>
<value name="DIGEST"/>
<value name="FORM"/>
<value name="CLIENT-CERT"/>
</Constraint>
- <Editor name="List"/>
+ <Editor name="ListString"/>
</XModelAttribute>
<XModelAttribute name="realm-name" xmlname="realm-name.#text"/>
<XModelAttribute name="form-login-page" xmlname="form-login-config.form-login-page.#text">
@@ -2328,8 +2328,8 @@
<XModelAttribute name="description" xmlname="description.#text">
<Editor name="Note"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="id=true" name="role-name" xmlname="role-name.#text">
- <Constraint loader="JavaName">
+ <XModelAttribute PROPERTIES="id=true;save=always" name="role-name" xmlname="role-name.#text">
+ <Constraint loader="Nmtoken">
<value name="acceptIncorrect=true"/>
</Constraint>
<Editor name="Name"/>
@@ -2378,7 +2378,7 @@
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;save=always" name="role-name" xmlname="role-name.#text">
- <Constraint loader="JavaName"/>
+ <Constraint loader="Nmtoken"/>
<Editor name="Name"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always" name="role-link" xmlname="role-link.#text">
14 years, 10 months
JBoss Tools SVN: r29291 - in branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model: src/org/jboss/tools/common/meta/constraint/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-02-23 17:37:51 -0500 (Wed, 23 Feb 2011)
New Revision: 29291
Added:
branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintNmtoken.java
Modified:
branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/plugin.xml
branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelMessages.java
branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/messages.properties
Log:
JBIDE-8443
https://issues.jboss.org/browse/JBIDE-8443
Modified: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/plugin.xml 2011-02-23 22:14:46 UTC (rev 29290)
+++ branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/plugin.xml 2011-02-23 22:37:51 UTC (rev 29291)
@@ -339,6 +339,8 @@
class="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintInt"/>
<xclass id="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintJavaName"
class="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintJavaName"/>
+ <xclass id="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintNmtoken"
+ class="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintNmtoken"/>
<xclass id="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintJavaNameOrEmpty"
class="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintJavaNameOrEmpty"/>
<xclass id="org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintList"
Added: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintNmtoken.java
===================================================================
--- branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintNmtoken.java (rev 0)
+++ branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintNmtoken.java 2011-02-23 22:37:51 UTC (rev 29291)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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.common.meta.constraint.impl;
+
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.plugin.ModelMessages;
+
+public class XAttributeConstraintNmtoken extends XAttributeConstraintProperties {
+
+ char[][] intervals = {
+ {':', ':'}, {'A', 'Z'}, {'_', '_'}, {'a', 'z'}, {0xC0, 0xD6},
+ {0xD8, 0xF6}, {0xF8 , 0x2FF}, {0x370, 0x37D}, {0x37F, 0x1FFF},
+ {0x200C, 0x200D}, {0x2070, 0x218F}, {0x2C00, 0x2FEF}, {0x3001, 0xD7FF},
+ {0xF900, 0xFDCF}, {0xFDF0, 0xFFFD}, // {0x10000, 0xEFFFF},
+ {'-', '-'}, {'.', '.'}, {'0', '9'},
+ {0xB7, 0xB7}, {0x0300, 0x036F}, {0x203F, 0x2040},
+ };
+
+ public XAttributeConstraintNmtoken() {}
+
+ public boolean accepts(String value) {
+ if(value == null) return false;
+ if(value.length() == 0) return true;
+ for (int i = 1; i < value.length(); i++) {
+ char ch = value.charAt(i);
+ boolean ok = false;
+ for (int k = 0; k < intervals.length; k++) {
+ if(ch >= intervals[k][0] && ch <= intervals[k][1]) {
+ ok = true;
+ break;
+ }
+ }
+ if(!ok) return false;
+ }
+ return true;
+ }
+
+ public String getError(String value) {
+ return (value.length() == 0) ? (isRequired() ? ModelMessages.CONSTRAINT_NONEMPTY : null) :
+ accepts(value) ? null :
+ ModelMessages.CONSTRAINT_NMTOKEN;
+ }
+
+ boolean isRequired() {
+ return attribute != null && "always".equals(attribute.getProperty("save")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public String getCorrectedValue(String value) {
+ if(value == null || value.length() == 0) return null;
+ if(XModelObjectConstants.TRUE.equals(getProperties().getProperty("acceptIncorrect"))) return value; //$NON-NLS-1$
+ //
+ return value;
+ }
+
+
+}
+
Property changes on: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintNmtoken.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelMessages.java
===================================================================
--- branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelMessages.java 2011-02-23 22:14:46 UTC (rev 29290)
+++ branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelMessages.java 2011-02-23 22:37:51 UTC (rev 29291)
@@ -18,6 +18,7 @@
public static String CONSTRAINT_NONEMPTY;
public static String CONSTRAINT_NO_JAVA_KEYWORD;
public static String CONSTRAINT_JAVA_NAME;
+ public static String CONSTRAINT_NMTOKEN;
public static String CONSTRAINT_INTEGER_OR_LIST;
public static String CONSTRAINT_RED_HAT_TEMPLATE_NAME;
public static String CONSTRAINT_XML_NAME;
Modified: branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/messages.properties
===================================================================
--- branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/messages.properties 2011-02-23 22:14:46 UTC (rev 29290)
+++ branches/jbosstools-3.2.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/messages.properties 2011-02-23 22:37:51 UTC (rev 29291)
@@ -7,6 +7,7 @@
CONSTRAINT_NONEMPTY = cannot be empty
CONSTRAINT_NO_JAVA_KEYWORD = is a Java keyword
CONSTRAINT_JAVA_NAME = is not a Java name
+CONSTRAINT_NMTOKEN = is not a valid NMToken
CONSTRAINT_INTEGER_OR_LIST = must be an integer or be selected from the list
CONSTRAINT_RED_HAT_TEMPLATE_NAME = is not an Red Hat project template name
CONSTRAINT_XML_NAME = is not xml name
14 years, 10 months
JBoss Tools SVN: r29290 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-02-23 17:14:46 -0500 (Wed, 23 Feb 2011)
New Revision: 29290
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
Log:
JBIDE-8444
https://issues.jboss.org/browse/JBIDE-8444
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2011-02-23 20:46:00 UTC (rev 29289)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2011-02-23 22:14:46 UTC (rev 29290)
@@ -1863,13 +1863,13 @@
visibility="false" xmlname="NAME"/>
<XModelAttribute PROPERTIES="save=always" default="BASIC"
name="auth-method" xmlname="auth-method.#text">
- <Constraint loader="List">
+ <Constraint loader="ListString">
<value name="BASIC"/>
<value name="DIGEST"/>
<value name="FORM"/>
<value name="CLIENT-CERT"/>
</Constraint>
- <Editor name="List"/>
+ <Editor name="ListString"/>
</XModelAttribute>
<XModelAttribute name="realm-name" xmlname="realm-name.#text"/>
<XModelAttribute name="form-login-page" xmlname="form-login-config.form-login-page.#text">
14 years, 10 months
JBoss Tools SVN: r29289 - branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-23 15:46:00 -0500 (Wed, 23 Feb 2011)
New Revision: 29289
Added:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/delta.png
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/keys.gif
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/keysd.gif
Log:
adding icons to branch - no jira
Added: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/delta.png
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/delta.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/keys.gif
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/keys.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/keysd.gif
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/keysd.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 10 months
JBoss Tools SVN: r29288 - trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-02-23 15:17:55 -0500 (Wed, 23 Feb 2011)
New Revision: 29288
Modified:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
Fixed compilation errors.
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2011-02-23 20:11:26 UTC (rev 29287)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2011-02-23 20:17:55 UTC (rev 29288)
@@ -37,6 +37,20 @@
protected IProject project = null;
/**
+ * @return the project
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /**
+ * @param project the project to set
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
*
*/
public AbstractResourceMarkerTest() {
14 years, 10 months
JBoss Tools SVN: r29287 - trunk/jsf/plugins/org.jboss.tools.jsf/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-02-23 15:11:26 -0500 (Wed, 23 Feb 2011)
New Revision: 29287
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
Log:
Fixed compilation errors.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2011-02-23 17:08:32 UTC (rev 29286)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2011-02-23 20:11:26 UTC (rev 29287)
@@ -36,6 +36,7 @@
org.jboss.tools.jsf.web.helpers.context,
org.jboss.tools.jsf.web.pattern,
org.jboss.tools.jsf.web.validation,
+ org.jboss.tools.jsf.web.validation.i18n,
org.jboss.tools.jsf.web.validation.jsf2,
org.jboss.tools.jsf.web.validation.jsf2.action,
org.jboss.tools.jsf.web.validation.jsf2.components,
14 years, 10 months
JBoss Tools SVN: r29286 - in trunk/jsf/tests/org.jboss.tools.jsf.test: projects/i18nTestProject and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-23 12:08:32 -0500 (Wed, 23 Feb 2011)
New Revision: 29286
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/.jsdtscope
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/JavaSource/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/classes/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/lib/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/externalization-validator-test-case-1.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-7003, junit has been added
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.classpath (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.classpath 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.web"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_23">
+ <attributes>
+ <attribute name="owner.project.facets" value="java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.project (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.project 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>i18nTestProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/.jsdtscope
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/.jsdtscope (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/.jsdtscope 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="WebContent"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.jdt.core.prefs 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,8 @@
+#Wed Feb 23 17:07:39 EET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.component 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="i18nTestProject">
+ <wb-resource deploy-path="/" source-path="/WebContent"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+ <property name="context-root" value="i18nTestProject"/>
+ <property name="java-output-path" value="/i18nTestProject/WebContent/WEB-INF/classes"/>
+ </wb-module>
+</project-modules>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,7 @@
+<root>
+ <facet id="jst.jsf">
+ <node name="libprov">
+ <attribute name="provider-id" value="jsf-user-library-provider"/>
+ </node>
+ </facet>
+</root>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="Apache Tomcat v6.0"/>
+ <fixed facet="jst.jsf"/>
+ <fixed facet="wst.jsdt.web"/>
+ <fixed facet="java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="java" version="1.6"/>
+ <installed facet="jst.web" version="2.5"/>
+ <installed facet="jst.jsf" version="1.2"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.container 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/.settings/org.eclipse.wst.jsdt.ui.superType.name 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/META-INF/MANIFEST.MF 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/WEB-INF/web.xml 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
+ <description>Facelets StarterKit</description>
+ <display-name>i18nTestProject</display-name>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/externalization-validator-test-case-1.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/externalization-validator-test-case-1.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/i18nTestProject/WebContent/externalization-validator-test-case-1.xhtml 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+<f:view contentType="text/html" />
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>First JSF 2.0 application</title>
+</h:head>
+<body>
+String shou ld be validated as need to be externalized
+<h:outputText value="Another strign for externalization" />
+#{el.sting}
+</body>
+</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-02-23 15:07:02 UTC (rev 29285)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-02-23 17:08:32 UTC (rev 29286)
@@ -30,6 +30,7 @@
import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
import org.jboss.tools.jsf.test.refactoring.MethodRefactoringTest;
import org.jboss.tools.jsf.test.validation.ELValidatorTest;
+import org.jboss.tools.jsf.test.validation.I18nValidatorTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -79,6 +80,10 @@
JSF2RefactoringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
new String[] { "projects/JSF2ComponentsValidator" }, //$NON-NLS-1$
new String[] { "JSF2ComponentsValidator" })); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ I18nValidatorTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
+ new String[] { "projects/i18nTestProject" }, //$NON-NLS-1$
+ new String[] { "i18nTestProject" })); //$NON-NLS-1$
suite.addTest(new ProjectImportTestSetup(new TestSuite(ELValidatorTest.class),"org.jboss.tools.jsf.test","projects/JSFKickStartOldFormat","JSFKickStartOldFormat") {
@Override
protected void setUp() throws Exception {
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java 2011-02-23 17:08:32 UTC (rev 29286)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.test.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.jsf.web.validation.i18n.I18nValidationComponent;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * Test class for Externalize String Validator
+ *
+ * @author mareshkau
+ *
+ */
+public class I18nValidatorTest extends AbstractResourceMarkerTest{
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setProject(ResourcesPlugin.getWorkspace().getRoot().getProject("i18nTestProject")); //$NON-NLS-1$
+ }
+
+ public void testShowErrorMarkers() throws CoreException {
+ IFile testFile = getProject().getFile("WebContent/externalization-validator-test-case-1.xhtml"); //$NON-NLS-1$
+ testFile.deleteMarkers(I18nValidationComponent.PROBLEM_ID, true, IResource.DEPTH_ZERO);
+ IMarker[] elMarkers = testFile.findMarkers(I18nValidationComponent.PROBLEM_ID, true, IResource.DEPTH_ZERO);
+ assertEquals("Markers should be cleaned", 0,elMarkers.length); //$NON-NLS-1$
+ ValidationFramework.getDefault().validate(testFile, new NullProgressMonitor());
+ elMarkers = testFile.findMarkers(I18nValidationComponent.PROBLEM_ID, true, IResource.DEPTH_ZERO);
+ assertEquals("Should be 2 Markers", 2,elMarkers.length); //$NON-NLS-1$
+ }
+
+}
14 years, 10 months
JBoss Tools SVN: r29285 - in trunk/forge/plugins/org.jboss.tools.seam.forge: src/org/jboss/tools/seam/forge/console and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-02-23 10:07:02 -0500 (Wed, 23 Feb 2011)
New Revision: 29285
Removed:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectRecord.java
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/META-INF/MANIFEST.MF
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectImporter.java
Log:
import created project as maven project after new-project command
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/META-INF/MANIFEST.MF
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/META-INF/MANIFEST.MF 2011-02-23 14:12:55 UTC (rev 29284)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/META-INF/MANIFEST.MF 2011-02-23 15:07:02 UTC (rev 29285)
@@ -5,14 +5,14 @@
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.ui.console;bundle-version="3.5.0",
- org.eclipse.jface.text;bundle-version="3.6.1",
- org.eclipse.debug.ui;bundle-version="3.6.1",
- org.eclipse.jdt.launching;bundle-version="3.5.100",
- org.eclipse.core.variables;bundle-version="3.2.400",
- org.eclipse.ui.editors;bundle-version="3.6.1",
- org.eclipse.ui.ide;bundle-version="3.6.1",
- org.maven.ide.eclipse;bundle-version="0.12.0"
+ org.eclipse.ui.console,
+ org.eclipse.jface.text,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.launching,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.maven.ide.eclipse,
+ org.maven.ide.eclipse.maven_embedder;bundle-version="0.12.1"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.jboss.tools.seam.forge.Activator
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java 2011-02-23 14:12:55 UTC (rev 29284)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java 2011-02-23 15:07:02 UTC (rev 29285)
@@ -2,6 +2,7 @@
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;
+import org.jboss.tools.seam.forge.importer.ProjectImporter;
public class CommandRecorder implements IDocumentListener {
@@ -63,8 +64,30 @@
}
private void postProcessCurrentCommand() {
- System.out.println("post processing current command : " + currentCommand);
- System.out.println("beforePrompt :\n" + beforePrompt);
+ if ("pwd".equals(currentCommand)) {
+ // do nothing
+ } else if ("new-project".equals(currentCommand)) {
+ int index = beforePrompt.lastIndexOf("Wrote ");
+ if (index == -1) return;
+ if (index + 6 > beforePrompt.length()) return;
+ String str = beforePrompt.substring(index + 6);
+ index = str.lastIndexOf("/src/main/resources/META-INF/forge.xml\n***SUCCESS*** Created project [");
+ if (index == -1) return;
+ if (index + 70 > str.length()) return;
+ String projectPath = str.substring(0, index);
+ str = str.substring(index + 70);
+ index = str.indexOf("] in new working directory [");
+ if (index == -1) return;
+ if (index + 28 > str.length()) return;
+ str = str.substring(index + 28);
+ index = str.indexOf("]");
+ if (index == -1) return;
+ String projectDirName = str.substring(0, index);
+ index = projectPath.indexOf(projectDirName);
+ if (index == -1) return;
+ String projectBaseDirPath = projectPath.substring(0, index - 1);
+ new ProjectImporter(projectBaseDirPath, projectDirName).importProject();
+ }
}
}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectImporter.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectImporter.java 2011-02-23 14:12:55 UTC (rev 29284)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectImporter.java 2011-02-23 15:07:02 UTC (rev 29285)
@@ -1,26 +1,69 @@
package org.jboss.tools.seam.forge.importer;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import org.apache.maven.model.Model;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.maven.ide.eclipse.MavenPlugin;
-import org.maven.ide.eclipse.project.LocalProjectScanner;
+import org.maven.ide.eclipse.core.IMavenConstants;
+import org.maven.ide.eclipse.project.MavenProjectInfo;
+import org.maven.ide.eclipse.project.ProjectImportConfiguration;
public class ProjectImporter {
- LocalProjectScanner localProjectScanner;
+ private String baseDirPath;
+ private String projectName;
- File workspaceRoot;
+ public ProjectImporter(String baseDirPath, String projectName) {
+ this.baseDirPath = baseDirPath;
+ this.projectName = projectName;
+ }
+ public void importProject() {
+ final MavenPlugin mavenPlugin = MavenPlugin.getDefault();
+ Job job = new WorkspaceJob("Importing Forge project") {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+ mavenPlugin.getProjectConfigurationManager().importProjects(
+ getProjectToImport(),
+ new ProjectImportConfiguration(),
+ monitor);
+ } catch(CoreException ex) {
+ return ex.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(mavenPlugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+ }
- public void importProject() {
-
- MavenPlugin mavenPlugin = MavenPlugin.getDefault();
-
-// Job job = new org.maven.ide.eclipse.internal.project.
-
-// localProjectScanner = new LocalProjectScanner
+ private MavenProjectInfo createMavenProjectInfo() {
+ MavenProjectInfo result = null;
+ try {
+ File projectDir = new File(baseDirPath, projectName);
+ File pomFile = new File(projectDir, IMavenConstants.POM_FILE_NAME);
+ Model model = MavenPlugin.getDefault().getMavenModelManager().readMavenModel(pomFile);
+ String pomName = projectName + "/" + IMavenConstants.POM_FILE_NAME;
+ result = new MavenProjectInfo(pomName, pomFile, model, null);
+ } catch (CoreException e) {
+
+ }
+ return result;
}
+
+ private Collection<MavenProjectInfo> getProjectToImport() {
+ ArrayList<MavenProjectInfo> result = new ArrayList<MavenProjectInfo>(1);
+ result.add(createMavenProjectInfo());
+ return result;
+ }
}
Deleted: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectRecord.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectRecord.java 2011-02-23 14:12:55 UTC (rev 29284)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectRecord.java 2011-02-23 15:07:02 UTC (rev 29285)
@@ -1,77 +0,0 @@
-package org.jboss.tools.seam.forge.importer;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-public class ProjectRecord {
-
- File projectFile;
-
- String projectName;
-
- IProjectDescription description;
-
- /**
- * Create a record for a project based on the info in the file.
- *
- * @param file
- */
- ProjectRecord(File file) {
- projectFile = file;
- setProjectName();
- }
-
- /**
- * Set the name of the project based on the projectFile.
- */
- private void setProjectName() {
- IProjectDescription newDescription = null;
- try {
- IPath path = new Path(projectFile.getPath());
- // if the file is in the default location, use the directory
- // name as the project name
- newDescription = ResourcesPlugin.getWorkspace().loadProjectDescription(path);
-
- if(isDefaultLocation(path)) {
- // projectName = path.segment(path.segmentCount() - 2);
- // newDescription = ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
- }
- } catch(CoreException e) {
- // no good couldn't get the name
- }
-
- if(newDescription == null) {
- this.description = null;
- projectName = ""; //$NON-NLS-1$
- } else {
- this.description = newDescription;
- projectName = this.description.getName();
- }
- }
-
- /**
- * Returns whether the given project description file path is in the default location for a project
- *
- * @param path The path to examine
- * @return Whether the given path is the default location for a project
- */
- private boolean isDefaultLocation(IPath path) {
- // The project description file must at least be within the project, which is within the workspace location
- return path.segmentCount() > 1 && path.removeLastSegments(2).toFile().equals(Platform.getLocation().toFile());
- }
-
- /**
- * Get the name of the project
- *
- * @return String
- */
- public String getProjectName() {
- return projectName;
- }
-}
14 years, 10 months