Author: dgolovin
Date: 2007-11-16 03:59:22 -0500 (Fri, 16 Nov 2007)
New Revision: 4937
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
Log:
http://jira.jboss.org/jira/browse/JBIDE-1322
So what I have commited.
Seam project that enabled Seam Support by project 'Seam Settings' preference page
is excluded from Seam artifacts wizards. If it is selected in navigator and Seam artifact
wizard called, selected project will not appear by default in 'Seam Project'
field. It will not appear in browse dialog for 'Seam Project' field.
This fix at least NPE.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-11-16
08:50:01 UTC (rev 4936)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-11-16
08:59:22 UTC (rev 4937)
@@ -377,6 +377,8 @@
public static String VALIDATOR_FACTORY_SEAM_RUNTIME_IS_NOT_SELECTED;
+ public static String VALIDATOR_FACTORY_SELECTED_PRJ_IS_CLOSED;
+
public static String VALIDATOR_FACTORY_SELECTED_PROJECT;
public static String VALIDATOR_FACTORY_TEST_PROJECT;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-11-16
08:50:01 UTC (rev 4936)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-11-16
08:59:22 UTC (rev 4937)
@@ -38,6 +38,8 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamPreferences;
+import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
@@ -149,7 +151,7 @@
}
String version = (String) context;
- if(version.startsWith("2.0")) {
+ if(version.startsWith("2.0")) { //$NON-NLS-1$
File seamJarFile = new File(value.toString(), "lib/jboss-seam.jar");
//$NON-NLS-1$
if (!seamJarFile.isFile()) {
errors = createErrorMap();
@@ -354,12 +356,17 @@
if (!selection.hasNature(ISeamProject.NATURE_ID)
|| SeamCorePlugin.getSeamPreferences(selection)==null
|| selection.getAdapter(IFacetedProject.class)==null
- ||
!((IFacetedProject)selection.getAdapter(IFacetedProject.class)).hasProjectFacet(ProjectFacetsManager.getProjectFacet("jst.web")))
{ //$NON-NLS-1$
+ ||
!((IFacetedProject)selection.getAdapter(IFacetedProject.class)).hasProjectFacet(ProjectFacetsManager.getProjectFacet("jst.web"))
+ ||
"".equals(SeamCorePlugin.getSeamPreferences(selection).get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
""))) { //$NON-NLS-1$
return createErrormessage(
SeamUIMessages.VALIDATOR_FACTORY_SELECTED_PROJECT + project.getName() +
SeamUIMessages.VALIDATOR_FACTORY_IS_NOT_A_SEAM_WEB_PROJECT);
+ } else {
+ //TODO validate project(s) structure
}
} catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
+ // it might happen only if project is closed and project
+ // name typed by hand
+ return
createErrormessage(NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_SELECTED_PRJ_IS_CLOSED,
project.getName()));
}
}
return NO_ERRORS;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-11-16
08:50:01 UTC (rev 4936)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-11-16
08:59:22 UTC (rev 4937)
@@ -125,7 +125,7 @@
VALIDATOR_FACTORY_SEAM_HOME_FOLDER_DOES_NOT_EXISTS=Seam Home folder doesn't exist
VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_DOES_NOT_EXIST=Seam Runtime ''{0}''
home directory doesn't exist for selected Seam Web Project
VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_IS_MISSING=Seam Runtime ''{0}'' home
directory doesn't exist
-VALIDATOR_FACTORY_SEAM_RT_RESOURCES_DIR_IS_MISSING=Seam Runtime '{0)' resource
templates directory doesn't exist
+VALIDATOR_FACTORY_SEAM_RT_RESOURCES_DIR_IS_MISSING=Seam Runtime ''{0}''
resource templates directory doesn't exist
VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_DOES_NOT_EXIST=Seam Runtime
''{0}'' templates directory doesn't exist for selected Seam Web
Project
VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_IS_MISSING=Seam Runtime ''{0}''
templates directory doesn't exist
VALIDATOR_FACTORY_SEAM_RT_VIE_TEMPLATE_DIR_DOES_NOT_EXIST=Seam Runtime
''{0}'' view templates directory doesn't exist for selected Seam Web
Project
@@ -141,6 +141,7 @@
VALIDATOR_FACTORY_PROJECT=Project '
VALIDATOR_FACTORY_DOES_NOT_EXIST=' doesn't exist.
VALIDATOR_FACTORY_SELECTED_PROJECT=Selected project '
+VALIDATOR_FACTORY_SELECTED_PRJ_IS_CLOSED=Selected project ''{0}'' is
closed
VALIDATOR_FACTORY_PRJ_NOT_SELECTED=Project is not selected
VALIDATOR_FACTORY_IS_NOT_A_SEAM_WEB_PROJECT=' is not a Seam Web Project
VALIDATOR_FACTORY_CONNECTION_PROFILE_IS_NOT_SELECTED=Connection profile is not selected
@@ -192,5 +193,5 @@
SEAM_FORM_WIZARD_PAGE1_JAVA_INTERFACE_SLSB_AND_KEY_SEAMEJB3_ANNOTATIONS_WILL_BE_CREATED=Java
Interface, SLSB and key Seam/EJB3 annotations will be created.
SEAM_TARGET_SERVER=Target Server
RUNTIME_DELETE_CONFIRM_TITLE=Confirm Runtime Delete
-RUNTIME_DELETE_NOT_USED_CONFIRM=Are you sure you want to delete runtime {0}?
-RUNTIME_DELETE_USED_CONFIRM=Runtime {0} is used by seam projects. Are you sure you want
to delete it?
\ No newline at end of file
+RUNTIME_DELETE_NOT_USED_CONFIRM=Are you sure you want to delete runtime
''{0}''?
+RUNTIME_DELETE_USED_CONFIRM=Runtime ''{0}'' is used by seam projects. Are
you sure you want to delete it?
\ No newline at end of file