JBoss Tools SVN: r7361 - tags/jbosstools-2.1.0.Beta1.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-04-04 15:59:05 -0400 (Fri, 04 Apr 2008)
New Revision: 7361
Added:
tags/jbosstools-2.1.0.Beta1/esb/
Log:
tagging for 2.1.0.Beta1
Copied: tags/jbosstools-2.1.0.Beta1/esb (from rev 7360, trunk/esb)
18 years
JBoss Tools SVN: r7360 - tags/jbosstools-2.1.0.Beta1.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-04-04 15:58:41 -0400 (Fri, 04 Apr 2008)
New Revision: 7360
Added:
tags/jbosstools-2.1.0.Beta1/core/
Log:
tagging for 2.1.0.Beta1
Copied: tags/jbosstools-2.1.0.Beta1/core (from rev 7359, trunk/core)
18 years
JBoss Tools SVN: r7359 - tags/jbosstools-2.1.0.Beta1.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-04-04 15:58:31 -0400 (Fri, 04 Apr 2008)
New Revision: 7359
Added:
tags/jbosstools-2.1.0.Beta1/common/
Log:
tagging for 2.1.0.Beta1
Copied: tags/jbosstools-2.1.0.Beta1/common (from rev 7358, trunk/common)
18 years
JBoss Tools SVN: r7358 - tags/jbosstools-2.1.0.Beta1.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-04-04 15:58:00 -0400 (Fri, 04 Apr 2008)
New Revision: 7358
Added:
tags/jbosstools-2.1.0.Beta1/as/
Log:
tagging for 2.1.0.Beta1
Copied: tags/jbosstools-2.1.0.Beta1/as (from rev 7357, trunk/as)
18 years
JBoss Tools SVN: r7357 - tags.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-04-04 15:57:29 -0400 (Fri, 04 Apr 2008)
New Revision: 7357
Added:
tags/jbosstools-2.1.0.Beta1/
Log:
tagging for 2.1.0.Beta1
18 years
JBoss Tools SVN: r7356 - trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-04-04 15:03:26 -0400 (Fri, 04 Apr 2008)
New Revision: 7356
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java
Log:
JBIDE-1771 OpenOn for xsi:schemaLocation attribute value doesn't work in faces-config.xml
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java 2008-04-04 18:01:52 UTC (rev 7355)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java 2008-04-04 19:03:26 UTC (rev 7356)
@@ -15,6 +15,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.StringTokenizer;
import java.util.zip.ZipFile;
import org.eclipse.core.resources.IStorage;
@@ -33,18 +34,18 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
import org.jboss.tools.common.text.ext.ExtensionsPlugin;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-
/**
* @author Jeremy
*/
@@ -150,8 +151,22 @@
openFileFailed();
} else if (mappedSystemId != null) {
openFileInEditor(mappedSystemId);
- } else
- openFileFailed();
+ } else {
+ String uri = getURI(region);
+ if (uri != null && uri.toLowerCase().startsWith("http:")) {
+ URL url = null;
+ try {
+ url = new URL(uri);
+ IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
+ IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, null, null, null);
+ browser.openURL(url);
+ } catch (Exception e) {
+ openFileFailed();
+ }
+
+ } else
+ openFileFailed();
+ }
} catch (Exception x) {
// could not open editor
@@ -185,6 +200,8 @@
protected final String JAR_FILE_PROTOCOL = "jar:file:/";//$NON-NLS-1$
protected final String JAR_FILE = "jar:file:";//$NON-NLS-1$
+ private int taglibLength;
+ private int taglibOffset;
/* (non-Javadoc)
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlink#openFileInEditor(java.lang.String)
@@ -245,7 +262,7 @@
if (text == null) return null;
int spacer = text.indexOf(" ");
if (spacer == -1) spacer = text.indexOf("\t");
- return (spacer == -1 ? null : text.substring(0, spacer));
+ return (spacer == -1 ? text : text.substring(0, spacer));
} catch (Exception x) {
//ignore
return null;
@@ -325,9 +342,29 @@
String value = Utils.trimQuotes(xmlnsAttr.getNodeValue());
int start = xmlnsAttr.getValueRegionStartOffset();
- final int taglibLength = value.length();
- final int taglibOffset = start + text.indexOf(value);
+ taglibLength = value.length();
+ taglibOffset = start + text.indexOf(value);
+ StringTokenizer tokenizer = new StringTokenizer(value);
+
+ int newOffset = -1;
+ int newLength = -1;
+ if (tokenizer.countTokens() > 1) {
+ while (tokenizer.hasMoreTokens()) {
+ String next = tokenizer.nextToken();
+ int nextStart = taglibOffset + value.indexOf(next);
+ if (offset >= nextStart
+ && offset <= nextStart + next.length()) {
+ newOffset = nextStart;
+ newLength = next.length();
+ break;
+ }
+ }
+ }
+ if (newOffset != -1) {
+ taglibLength = newLength;
+ taglibOffset = newOffset;
+ }
IRegion region = new IRegion () {
public int getLength() {
return taglibLength;
18 years
JBoss Tools SVN: r7355 - in trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages: jsf and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-04 14:01:52 -0400 (Fri, 04 Apr 2008)
New Revision: 7355
Added:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletBlank.xhtml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletCommon.xhtml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletForm.xhtml
Removed:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletBlank.xhtml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletCommon.xhtml
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletForm.xhtml
Log:
JBIDE-2009
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletBlank.xhtml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletBlank.xhtml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletBlank.xhtml 2008-04-04 18:01:52 UTC (rev 7355)
@@ -0,0 +1,11 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:composition template="">
+
+ </ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletCommon.xhtml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletCommon.xhtml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletCommon.xhtml 2008-04-04 18:01:52 UTC (rev 7355)
@@ -0,0 +1,65 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <f:loadBundle basename="resources" var="msg" />
+ <head>
+ <title><ui:insert name="pageTitle">Page Title</ui:insert></title>
+ <style type="text/css">
+ body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ }
+ .header {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 18px;
+ }
+ .bottom {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ text-align: center;
+ vertical-align: middle;
+ color: #8E969D;
+ }
+ </style>
+ </head>
+
+<body bgcolor="#ffffff">
+<table style="border:1px solid #CAD6E0" align="center" cellpadding="0" cellspacing="0" border="0" width="400">
+<tbody>
+
+ <tr>
+ <td class="header" height="42" align="center" valign="middle" width="100%" bgcolor="#E4EBEB">
+ <ui:insert name="pageHeader">Page Header</ui:insert>
+ </td>
+ </tr>
+ <tr>
+ <td height="1" width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+
+ <tr>
+ <td width="100%" colspan="2">
+ <table width="100%" style="height:150px" align="left" cellpadding="0" cellspacing="0" border="0">
+ <tbody>
+ <tr>
+ <td align="center" width="100%" valign="middle">
+
+ <ui:insert name="body">Page Body</ui:insert>
+
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="bottom" height="1" width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+</tbody>
+</table>
+</body>
+
+</html>
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletForm.xhtml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletForm.xhtml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/FaceletForm.xhtml 2008-04-04 18:01:52 UTC (rev 7355)
@@ -0,0 +1,21 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <!--
+ Replace path to template, title, header and body
+ with actual data.
+ -->
+ <ui:composition template="/templates/common.xhtml">
+ <ui:define name="pageTitle">Title</ui:define>
+ <ui:define name="pageHeader">Header</ui:define>
+ <ui:define name="body">
+ <form jsfc="h:form" id="Form">
+
+ </form>
+ </ui:define>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletBlank.xhtml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletBlank.xhtml 2008-04-04 17:28:45 UTC (rev 7354)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletBlank.xhtml 2008-04-04 18:01:52 UTC (rev 7355)
@@ -1,11 +0,0 @@
-<!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:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html">
-
- <ui:composition template="">
-
- </ui:composition>
-
-</html>
\ No newline at end of file
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletCommon.xhtml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletCommon.xhtml 2008-04-04 17:28:45 UTC (rev 7354)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletCommon.xhtml 2008-04-04 18:01:52 UTC (rev 7355)
@@ -1,65 +0,0 @@
-<!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:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core">
-
- <f:loadBundle basename="resources" var="msg" />
- <head>
- <title><ui:insert name="pageTitle">Page Title</ui:insert></title>
- <style type="text/css">
- body {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 14px;
- }
- .header {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 18px;
- }
- .bottom {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 9px;
- text-align: center;
- vertical-align: middle;
- color: #8E969D;
- }
- </style>
- </head>
-
-<body bgcolor="#ffffff">
-<table style="border:1px solid #CAD6E0" align="center" cellpadding="0" cellspacing="0" border="0" width="400">
-<tbody>
-
- <tr>
- <td class="header" height="42" align="center" valign="middle" width="100%" bgcolor="#E4EBEB">
- <ui:insert name="pageHeader">Page Header</ui:insert>
- </td>
- </tr>
- <tr>
- <td height="1" width="100%" bgcolor="#CAD6E0"></td>
- </tr>
-
- <tr>
- <td width="100%" colspan="2">
- <table width="100%" style="height:150px" align="left" cellpadding="0" cellspacing="0" border="0">
- <tbody>
- <tr>
- <td align="center" width="100%" valign="middle">
-
- <ui:insert name="body">Page Body</ui:insert>
-
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2" valign="bottom" height="1" width="100%" bgcolor="#CAD6E0"></td>
- </tr>
-</tbody>
-</table>
-</body>
-
-</html>
\ No newline at end of file
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletForm.xhtml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletForm.xhtml 2008-04-04 17:28:45 UTC (rev 7354)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/pages/jsf/FaceletForm.xhtml 2008-04-04 18:01:52 UTC (rev 7355)
@@ -1,21 +0,0 @@
-<!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:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html">
-
- <!--
- Replace path to template, title, header and body
- with actual data.
- -->
- <ui:composition template="/templates/common.xhtml">
- <ui:define name="pageTitle">Title</ui:define>
- <ui:define name="pageHeader">Header</ui:define>
- <ui:define name="body">
- <form jsfc="h:form" id="Form">
-
- </form>
- </ui:define>
- </ui:composition>
-
-</html>
\ No newline at end of file
18 years
JBoss Tools SVN: r7354 - trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-04-04 13:28:45 -0400 (Fri, 04 Apr 2008)
New Revision: 7354
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/FaceletsHtml.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1796 Fixed
Modified: trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/FaceletsHtml.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/FaceletsHtml.xml 2008-04-04 17:23:03 UTC (rev 7353)
+++ trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/FaceletsHtml.xml 2008-04-04 17:28:45 UTC (rev 7354)
@@ -12897,6 +12897,14 @@
<proposal type="jsfVariables"/>
</attribute-type>
<attribute-type default="" name="media" required="false">
+ <proposal type="enumeration">
+ <param value="all"/>
+ <param value="screen"/>
+ <param value="print"/>
+ <param value="projection"/>
+ <param value="braille"/>
+ <param value="speech"/>
+ </proposal>
<proposal type="beanProperty"/>
<proposal type="bundleProperty"/>
<proposal type="jsfVariables"/>
18 years
JBoss Tools SVN: r7353 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-04-04 13:23:03 -0400 (Fri, 04 Apr 2008)
New Revision: 7353
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1950
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-04-04 17:23:03 UTC (rev 7353)
@@ -273,7 +273,7 @@
</validator>
</extension>
- <extension
+ <!--extension
point="org.eclipse.wst.validation.validator"
id="SeamProjectPropertyValidator"
name="Seam Project Property Validator">
@@ -281,14 +281,14 @@
<filter objectClass="org.eclipse.core.resources.IFolder" nameFilter="*"/>
<filter objectClass="org.eclipse.core.resources.IProject" nameFilter="*"/>
<helper class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper"/>
- <markerId markerIdValue="seamProblem"/>
+ <markerId markerIdValue="seamProjectProblem"/>
<run
class="org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator"
incremental="true"
fullBuild="true"
/>
</validator>
- </extension>
+ </extension-->
<extension
id="seamProblem"
@@ -300,6 +300,17 @@
value="true">
</persistent>
</extension>
+
+ <extension
+ id="seamProjectProblem"
+ name="Seam Project Problem"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.wst.validation.problemmarker"/>
+ <attribute name="kind"/>
+ <persistent
+ value="true">
+ </persistent>
+ </extension>
<extension point="org.jboss.tools.common.model.classes">
<xclass id="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -34,7 +34,7 @@
* where %name% is produced from constant name in SeamPreferences like AAA_BBB_CCC -> aaaBbbCcc.
* Put these entries under relevant section. For a new section add constant and property
* SeamValidatorConfigurationBlock_section_%newSectionName%
- * 4) In class org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages
+ * 4) In class org.jboss.tools.seam.ui.preferences.SeamValidatorConfigurationBlock
* modify SectionDescription constants, according to instruction there.
*
* @author Viacheslav Kabanovich
@@ -119,6 +119,11 @@
// If Expression use property of component and this property has only setter(getter) without getter(setter) then mark it.
public static final String UNPAIRED_GETTER_OR_SETTER = createSeverityOption("unpairedGetterOrSetter"); //$NON-NLS-1$
+ // Seam project settings
+
+ // Mark seam project if it has any invalid seam setting.
+ public static final String INVALID_PROJECT_SETTINGS = createSeverityOption("invalidProjectSettings"); //$NON-NLS-1$
+
private static String createSeverityOption(String shortName) {
String name = SeamCorePlugin.PLUGIN_ID + ".validator.problem." + shortName; //$NON-NLS-1$
severityOptionNames.add(name);
@@ -162,7 +167,7 @@
return p.get(key, null);
}
- public static boolean isValidateCore(ISeamProject project) {
+ public static boolean shouldValidateCore(ISeamProject project) {
return !(SeamPreferences.IGNORE.equals(getProjectPreference(project, NONUNIQUE_COMPONENT_NAME)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY)) &&
@@ -185,9 +190,13 @@
SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_VARIABLE_NAME)));
}
- public static boolean isValidateEL(ISeamProject project) {
+ public static boolean shouldValidateEL(ISeamProject project) {
return !(SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_EL_VARIABLE_NAME)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_EL_VARIABLE_PROPERTY_NAME)) &&
SeamPreferences.IGNORE.equals(getProjectPreference(project, UNPAIRED_GETTER_OR_SETTER)));
}
+
+ public static boolean shouldValidateSettings(ISeamProject project) {
+ return !SeamPreferences.IGNORE.equals(getProjectPreference(project, INVALID_PROJECT_SETTINGS));
+ }
}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -0,0 +1,95 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 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.seam.internal.core.validation;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.ISeamTextSourceReference;
+
+/**
+ * @author Alexey Kazakov
+ *
+ */
+public interface IValidationErrorManager {
+
+ /**
+ * Adds a marker to the resource
+ * @param messageId
+ * @param preferenceKey
+ * @param messageArguments
+ * @param location
+ * @param target
+ */
+ void addError(String messageId, String preferenceKey,
+ String[] messageArguments, ISeamTextSourceReference location,
+ IResource target);
+
+ /**
+ * Adds a marker to the resource
+ * @param messageId
+ * @param preferenceKey
+ * @param messageArguments
+ * @param target
+ */
+ void addError(String messageId, String preferenceKey,
+ String[] messageArguments,
+ IResource target);
+
+ /**
+ * Adds a marker to the resource
+ * @param messageId
+ * @param preferenceKey
+ * @param location
+ * @param target
+ */
+ void addError(String messageId, String preferenceKey,
+ ISeamTextSourceReference location, IResource target);
+
+ /**
+ * Adds a marker to the resource
+ * @param messageId
+ * @param preferenceKey
+ * @param messageArguments
+ * @param length
+ * @param offset
+ * @param target
+ */
+ void addError(String messageId, String preferenceKey,
+ String[] messageArguments, int length, int offset, IResource target);
+
+ /**
+ * Displays a subtask in the progress view.
+ * @param messageId
+ */
+ void displaySubtask(String messageId);
+
+ /**
+ * Displays a subtask in the progress view.
+ * @param messageId
+ * @param messageArguments
+ */
+ void displaySubtask(String messageId, String[] messageArguments);
+
+ /**
+ * Removes all markers for the resources
+ * @param resources
+ * @param messageGroup
+ */
+ void removeMessagesFromResources(Set<IResource> resources, String messageGroup);
+
+ /**
+ * Sets seam project
+ * @param project
+ */
+ void setProject(ISeamProject project);
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -103,7 +103,7 @@
* @see org.jboss.tools.seam.internal.core.validation.ISeamValidator#isEnabled()
*/
public boolean isEnabled() {
- return SeamPreferences.isValidateCore(project);
+ return SeamPreferences.shouldValidateCore(project);
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -86,7 +86,7 @@
* @see org.jboss.tools.seam.internal.core.validation.ISeamValidator#isEnabled()
*/
public boolean isEnabled() {
- return SeamPreferences.isValidateEL(project);
+ return SeamPreferences.shouldValidateEL(project);
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.validation;
+import java.util.HashSet;
+import java.util.Set;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -18,6 +21,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.wst.validation.internal.core.ValidationException;
@@ -26,6 +31,7 @@
import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
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.SeamRuntimeManager;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange;
@@ -36,6 +42,24 @@
*/
public class SeamProjectPropertyValidator implements IValidatorJob {
+ private static final String markerId = "seamProjectProblem";
+ protected static final String VALIDATING_PROJECT = "VALIDATING_PROJECT";
+ protected static final String INVALID_RUNTIME = "INVALID_RUNTIME";
+ protected static final String INVALID_WEBFOLDER = "INVALID_WEBFOLDER";
+ protected static final String INVALID_PARENT_PROJECT = "INVALID_PARENT_PROJECT";
+ protected static final String INVALID_EJB_PROJECT = "INVALID_EJB_PROJECT";
+ protected static final String INVALID_TEST_PROJECT = "INVALID_TEST_PROJECT";
+ protected static final String INVALID_MODEL_SRC = "INVALID_MODEL_SRC";
+ protected static final String INVALID_ACTION_SRC = "INVALID_ACTION_SRC";
+ protected static final String INVALID_TEST_SRC = "INVALID_TEST_SRC";
+ protected static final String INVALID_MODEL_PACKAGE_NAME = "INVALID_MODEL_PACKAGE_NAME";
+ protected static final String INVALID_ACTION_PACKAGE_NAME = "INVALID_ACTION_PACKAGE_NAME";
+ protected static final String INVALID_TEST_PACKAGE_NAME = "INVALID_TEST_PACKAGE_NAME";
+ protected static final String INVALID_CONNECTION_NAME = "INVALID_CONNECTION_NAME";
+
+ private IValidationErrorManager errorManager;
+ private Set<String> validatedProjects = new HashSet<String>();
+
/* (non-Javadoc)
* @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#getSchedulingRule(org.eclipse.wst.validation.internal.provisional.core.IValidationContext)
*/
@@ -47,11 +71,16 @@
* @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#validateInJob(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
*/
public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
+ validatedProjects.clear();
SeamValidationHelper seamHelper = (SeamValidationHelper)helper;
IProject project = seamHelper.getProject();
+ if(!project.isAccessible()) {
+ return OK_STATUS;
+ }
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
+ errorManager = new ValidationErrorManager(this, null, reporter, null);
if(seamProject!=null) {
- validateSeamProject(project);
+ validateSeamProject(seamProject);
}
IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
@@ -73,31 +102,48 @@
IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(checkingProject);
for (int i = 0; i < SeamProjectChange.PROJECT_NAME_PROPERTIES.length; i++) {
if(nameOfChangedProject.equals(pref.get(SeamProjectChange.PROJECT_NAME_PROPERTIES[i], null))) {
- validateSeamProject(checkingProject);
+ validateSeamProject(seamProject);
return;
}
}
for (int i = 0; i < SeamProjectChange.FOLDER_PROPERTIES.length; i++) {
if(pref.get(SeamProjectChange.FOLDER_PROPERTIES[i], "").startsWith("/" + nameOfChangedProject + "/")) {
- validateSeamProject(checkingProject);
+ validateSeamProject(seamProject);
return;
}
}
}
- private void validateProjectName(String projectName, boolean canBeEmpty) {
- if((canBeEmpty || (projectName!=null && projectName.length()==0)) && new Path("/").isValidSegment(projectName)) {
+ /**
+ * Returns true if the project with this name exists.
+ * @param projectName
+ * @param canBeEmpty if "true" and the project name is empty (null or "") then it is valid.
+ * @return
+ */
+ public static boolean isProjectNameValid(String projectName, boolean canBeEmpty) {
+ if(projectName==null || projectName.length()==0) {
+ return canBeEmpty;
+ }
+ if(new Path("/").isValidSegment(projectName)) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if(project.exists()) {
- return;
+ return true;
}
}
- // Mark invalid project name
- // TODO
+ return false;
}
- private boolean isFolderPathValid(String folderPath, boolean canBeEmpty) {
- if((canBeEmpty || (folderPath!=null && folderPath.length()==0)) && new Path("/").isValidSegment(folderPath)) {
+ /**
+ * Returns true if the folder with this name exists.
+ * @param folderPath
+ * @param canBeEmpty if "true" and the folder path is empty (null or "") then it is valid.
+ * @return
+ */
+ public static boolean isFolderPathValid(String folderPath, boolean canBeEmpty) {
+ if(folderPath==null || folderPath.length()==0) {
+ return canBeEmpty;
+ }
+ if(new Path("/").isValidPath(folderPath)) {
IResource folder = ResourcesPlugin.getWorkspace().getRoot().findMember(folderPath);
if(folder!=null && (folder instanceof IContainer) && folder.exists()) {
return true;
@@ -106,68 +152,126 @@
return false;
}
- private void validateSorceFolder(String folderPath, String packageName) {
+ /**
+ * Returns true if the package name is valid (it does not have to exist).
+ * @param packageName
+ * @param canBeEmpty if "true" and the package name is empty (null or "") then it is valid.
+ * @return
+ */
+ public static boolean isPackageNameValid(String packageName, boolean canBeEmpty) {
+ if(packageName==null || packageName.length()==0) {
+ return canBeEmpty;
+ }
+ IStatus status = JavaConventions.validatePackageName(packageName, CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5);
+ if(status.getSeverity()==IStatus.ERROR) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns true if the profiler exists.
+ * @param profilerName
+ * @param canBeEmpty if "true" and the profiler name is empty (null or "") then it is valid.
+ * @return
+ */
+ public static boolean isConnectionProfileValid(String profilerName, boolean canBeEmpty) {
+ if(profilerName==null || profilerName.length()==0) {
+ return canBeEmpty;
+ }
+ IConnectionProfile[] profiles = ProfileManager.getInstance().getProfilesByCategory("org.eclipse.datatools.connectivity.db.category"); //$NON-NLS-1$
+ for (IConnectionProfile connectionProfile : profiles) {
+ if(profilerName.equals(connectionProfile.getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void validateProjectName(IProject targetProject, String projectName, boolean canBeEmpty, String messageId) {
+ if(!isProjectNameValid(projectName, canBeEmpty)) {
+ // Mark invalid project name
+ errorManager.addError(messageId, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{targetProject.getName()}, targetProject);
+ }
+ }
+
+ private void validateSorceFolder(IProject targetProject, String folderPath, String packageName, String srcFolderMessageID, String packageMessageId) {
if(isFolderPathValid(folderPath, true)) {
- if(!isPackageNameValid(packageName)) {
+ if(!isPackageNameValid(packageName, true)) {
// Mark invalid source folder path
- // TODO
+ errorManager.addError(packageMessageId, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{targetProject.getName()}, targetProject);
}
return;
}
// Mark invalid source folder path
- // TODO
+ errorManager.addError(srcFolderMessageID, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{targetProject.getName()}, targetProject);
}
- private boolean isPackageNameValid(String packageName) {
- if(packageName==null || packageName.length()==0) {
- return false;
+ private void validateSeamProject(ISeamProject seamProject) {
+ errorManager.setProject(seamProject);
+ IProject project = seamProject.getProject();
+ if(!project.isAccessible()) {
+ return;
}
- IStatus status = JavaConventions.validatePackageName(packageName, CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5);
- if(status.getSeverity()==IStatus.ERROR) {
- return false;
+ if(validatedProjects.contains(project.getName())) {
+ return;
}
- return true;
- }
+ validatedProjects.add(project.getName());
+ Set<IResource> set = new HashSet<IResource>();
+ set.add(project);
+ errorManager.removeMessagesFromResources(set, markerId);
+ if(!SeamPreferences.shouldValidateSettings(seamProject)) {
+ return;
+ }
+ errorManager.displaySubtask(VALIDATING_PROJECT, new String[]{project.getName()});
- private boolean validateSeamProject(IProject project) {
IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(project);
String parentProject = pref.get(ISeamFacetDataModelProperties.SEAM_PARENT_PROJECT, null);
if(parentProject!=null) {
// EJB or Test project
- validateProjectName(parentProject, false);
+ validateProjectName(project, parentProject, false, INVALID_PARENT_PROJECT);
} else {
// War project
String settingVersion = pref.get(ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION, ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION_1_0);
String seamRuntimeName = pref.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, null);
- if(seamRuntimeName==null || seamRuntimeName.length()==0 || (SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName) == null)) {
+ if(seamRuntimeName!=null && seamRuntimeName.length()>0 && (SeamRuntimeManager.getInstance().findRuntimeByName(seamRuntimeName) == null)) {
// Mark unknown runtime
- // TODO
+ errorManager.addError(INVALID_RUNTIME, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{project.getName()}, project);
}
if(ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(pref.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, null))) {
- validateProjectName(pref.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, null), true);
+ validateProjectName(project, pref.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, null), true, INVALID_EJB_PROJECT);
}
String viewFolder = pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, null);
- if(isFolderPathValid(viewFolder, true)) {
+ if(!isFolderPathValid(viewFolder, true)) {
// Mark unknown View folder
- // TODO
+ errorManager.addError(INVALID_WEBFOLDER, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{project.getName()}, project);
}
- validateSorceFolder(pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, null),
- pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, null));
+ validateSorceFolder(project, pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, null),
+ pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, null),
+ INVALID_MODEL_SRC,
+ INVALID_MODEL_PACKAGE_NAME);
- validateSorceFolder(pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, null),
- pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, null));
+ validateSorceFolder(project, pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, null),
+ pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, null),
+ INVALID_ACTION_SRC,
+ INVALID_ACTION_PACKAGE_NAME);
String createTestString = pref.get(ISeamFacetDataModelProperties.TEST_CREATING, null);
if(settingVersion.equals(ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION_1_0) ||
"true".equals(createTestString)) {
- validateProjectName(pref.get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, null), true);
- validateSorceFolder(pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, null),
- pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, null));
+ validateProjectName(project, pref.get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, null), true, INVALID_TEST_PROJECT);
+ validateSorceFolder(project, pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, null),
+ pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, null),
+ INVALID_TEST_SRC,
+ INVALID_TEST_PACKAGE_NAME);
}
+ if(!isConnectionProfileValid(pref.get(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, null), true)) {
+ errorManager.addError(INVALID_CONNECTION_NAME, SeamPreferences.INVALID_PROJECT_SETTINGS, new String[]{project.getName()}, project);
+ }
}
- return true;
+ return;
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -10,119 +10,43 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.validation;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.SeamPreferences;
/**
- * Abstract implementation of ISeamvalidator
+ * Abstract implementation of ISeamValidator
*
* @author Alexey Kazakov
*/
-public abstract class SeamValidator implements ISeamValidator {
+public abstract class SeamValidator extends ValidationErrorManager implements ISeamValidator {
- public static final String BASE_NAME
- = "org.jboss.tools.seam.internal.core.validation.messages"; //$NON-NLS-1$
-
- IStatus OK_STATUS = new Status(IStatus.OK,
- "org.eclipse.wst.validation", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
-
- protected SeamValidatorManager validationManager;
- protected SeamContextValidationHelper coreHelper;
- protected IReporter reporter;
protected SeamValidationContext validationContext;
- protected ISeamProject project;
protected String projectName;
- public SeamValidator(SeamValidatorManager validatorManager,
+ /**
+ * Constructor
+ * @param validatorManager
+ * @param coreHelper
+ * @param reporter
+ * @param validationContext
+ * @param project must not be null
+ */
+ public SeamValidator(IValidator validatorManager,
SeamContextValidationHelper coreHelper, IReporter reporter,
SeamValidationContext validationContext, ISeamProject project) {
- this.validationManager = validatorManager;
- this.coreHelper = coreHelper;
- this.project = project;
- this.reporter = reporter;
+ super(validatorManager, coreHelper, reporter, project);
this.validationContext = validationContext;
this.projectName = project.getProject().getName();
}
- protected String getBaseName() {
- return BASE_NAME;
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ValidationErrorManager#setProject(org.jboss.tools.seam.core.ISeamProject)
+ */
+ @Override
+ public void setProject(ISeamProject project) {
+ super.setProject(project);
+ this.projectName = project.getProject().getName();
}
-
- protected void addError(String messageId, String preferenceKey,
- String[] messageArguments, ISeamTextSourceReference location,
- IResource target) {
- addError(messageId, preferenceKey, messageArguments, location
- .getLength(), location.getStartPosition(), target);
- }
-
- protected void addError(String messageId, String preferenceKey,
- ISeamTextSourceReference location, IResource target) {
- addError(messageId, preferenceKey, new String[0], location, target);
- }
-
- protected void addError(String messageId, String preferenceKey,
- String[] messageArguments, int length, int offset, IResource target) {
- String preferenceValue = SeamPreferences.getProjectPreference(project,
- preferenceKey);
- boolean ignore = false;
- int messageSeverity = IMessage.HIGH_SEVERITY;
- if (SeamPreferences.WARNING.equals(preferenceValue)) {
- messageSeverity = IMessage.NORMAL_SEVERITY;
- } else if (SeamPreferences.IGNORE.equals(preferenceValue)) {
- ignore = true;
- }
-
- IMessage message = new Message(getBaseName(), messageSeverity,
- messageId, messageArguments, target,
- ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
- message.setLength(length);
- message.setOffset(offset);
- try {
- coreHelper.getDocumentProvider().connect(target);
-
- message.setLineNo(coreHelper.getDocumentProvider().getDocument(
- target).getLineOfOffset(offset) + 1);
-
- } catch (BadLocationException e) {
- SeamCorePlugin.getPluginLog().logError(
- "Exception occurred during error line number calculation",e);
- return;
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(
- "Exception occurred during error line number calculation",e);
- return;
- }
- if (!ignore) {
- reporter.addMessage(validationManager, message);
- }
- }
-
- protected void displaySubtask(String messageId) {
- displaySubtask(messageId, null);
- }
-
- protected void displaySubtask(String messageId, String[] messageArguments) {
- IMessage message = new Message(getBaseName(), IMessage.NORMAL_SEVERITY,
- messageId, messageArguments);
- reporter.displaySubtask(validationManager, message);
- }
-
- protected void removeMessagesFromResources(Set<IResource> resources,
- String messageGroup) {
- for (IResource r : resources) {
- reporter.removeMessageSubset(validationManager, r, messageGroup);
- }
- }
}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.seam.internal.core.validation;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.ISeamTextSourceReference;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamPreferences;
+
+/**
+ * @author Alexey Kazakov
+ *
+ */
+public class ValidationErrorManager implements IValidationErrorManager {
+
+ public static final String BASE_NAME = "org.jboss.tools.seam.internal.core.validation.messages"; //$NON-NLS-1$
+
+ IStatus OK_STATUS = new Status(IStatus.OK,
+ "org.eclipse.wst.validation", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
+
+ protected IValidator validationManager;
+ protected SeamContextValidationHelper coreHelper;
+ protected IReporter reporter;
+ protected ISeamProject project;
+
+ /**
+ * Constructor
+ * @param validatorManager
+ * @param coreHelper can be null
+ * @param reporter
+ * @param project
+ */
+ public ValidationErrorManager(IValidator validatorManager,
+ SeamContextValidationHelper coreHelper, IReporter reporter,
+ ISeamProject project) {
+ this.validationManager = validatorManager;
+ this.coreHelper = coreHelper;
+ this.project = project;
+ this.reporter = reporter;
+ }
+
+ protected String getBaseName() {
+ return BASE_NAME;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String,
+ * java.lang.String, java.lang.String[],
+ * org.jboss.tools.seam.core.ISeamTextSourceReference,
+ * org.eclipse.core.resources.IResource)
+ */
+ public void addError(String messageId, String preferenceKey,
+ String[] messageArguments, ISeamTextSourceReference location,
+ IResource target) {
+ addError(messageId, preferenceKey, messageArguments, location
+ .getLength(), location.getStartPosition(), target);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String,
+ * java.lang.String,
+ * org.jboss.tools.seam.core.ISeamTextSourceReference,
+ * org.eclipse.core.resources.IResource)
+ */
+ public void addError(String messageId, String preferenceKey,
+ ISeamTextSourceReference location, IResource target) {
+ addError(messageId, preferenceKey, new String[0], location, target);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String, java.lang.String, java.lang.String[], org.eclipse.core.resources.IResource)
+ */
+ public void addError(String messageId, String preferenceKey,
+ String[] messageArguments, IResource target) {
+ addError(messageId, preferenceKey, messageArguments, 0, 0, target);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String,
+ * java.lang.String, java.lang.String[], int, int,
+ * org.eclipse.core.resources.IResource)
+ */
+ public void addError(String messageId, String preferenceKey,
+ String[] messageArguments, int length, int offset, IResource target) {
+ String preferenceValue = SeamPreferences.getProjectPreference(project,
+ preferenceKey);
+ boolean ignore = false;
+ int messageSeverity = IMessage.HIGH_SEVERITY;
+ if (SeamPreferences.WARNING.equals(preferenceValue)) {
+ messageSeverity = IMessage.NORMAL_SEVERITY;
+ } else if (SeamPreferences.IGNORE.equals(preferenceValue)) {
+ ignore = true;
+ }
+
+ IMessage message = new Message(getBaseName(), messageSeverity,
+ messageId, messageArguments, target,
+ ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
+ message.setLength(length);
+ message.setOffset(offset);
+ try {
+ if (coreHelper != null) {
+ coreHelper.getDocumentProvider().connect(target);
+ message.setLineNo(coreHelper.getDocumentProvider().getDocument(
+ target).getLineOfOffset(offset) + 1);
+ }
+ } catch (BadLocationException e) {
+ SeamCorePlugin.getPluginLog().logError(
+ "Exception occurred during error line number calculation",
+ e);
+ return;
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(
+ "Exception occurred during error line number calculation",
+ e);
+ return;
+ }
+ if (!ignore) {
+ reporter.addMessage(validationManager, message);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#displaySubtask(java.lang.String)
+ */
+ public void displaySubtask(String messageId) {
+ displaySubtask(messageId, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#displaySubtask(java.lang.String,
+ * java.lang.String[])
+ */
+ public void displaySubtask(String messageId, String[] messageArguments) {
+ IMessage message = new Message(getBaseName(), IMessage.NORMAL_SEVERITY,
+ messageId, messageArguments);
+ reporter.displaySubtask(validationManager, message);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#removeMessagesFromResources(java.util.Set,
+ * java.lang.String)
+ */
+ public void removeMessagesFromResources(Set<IResource> resources, String messageGroup) {
+ for (IResource r : resources) {
+ reporter.removeMessageSubset(validationManager, r, messageGroup);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#setProject(org.jboss.tools.seam.core.ISeamProject)
+ */
+ public void setProject(ISeamProject project) {
+ this.project = project;
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2008-04-04 17:23:03 UTC (rev 7353)
@@ -45,10 +45,25 @@
UNKNOWN_EL_VARIABLE_PROPERTY_NAME="{0}" cannot be resolved
UNPAIRED_GETTER_OR_SETTER=Property "{0}" has only {1}. {2} is missing.
+#Invalid seam project settings
+INVALID_PARENT_PROJECT=Main Seam project specified for Seam project "{0}" does not exist.
+INVALID_RUNTIME=Seam Runtime specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_WEBFOLDER=View Folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_EJB_PROJECT=EJB project specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_TEST_PROJECT=Test EJB project specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_MODEL_SRC=Model source folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_ACTION_SRC=Action / Form / Conversation source folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_TEST_SRC=Test source folder specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_MODEL_PACKAGE_NAME=Model package name specified for Seam project "{0}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_ACTION_PACKAGE_NAME=Action / Form / Conversation package name specified for Seam project "{0}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_TEST_PACKAGE_NAME=Test package name specified for Seam project "{0}" is not valid. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+INVALID_CONNECTION_NAME=Connection profiler specified for Seam project "{0}" does not exist. Please correct this property in "Seam settings" page (Project->Properties->Seam Settings).
+
#Messages for Progress Monitor
SEARCHING_RESOURCES=project "{0}"; searching resources for validation.
VALIDATING_COMPONENT=project "{0}"; component "{1}"
VALIDATING_FACTORY=project "{0}"; factory "{1}"
VALIDATING_RESOURCE=project "{0}"; resource "{1}"
VALIDATING_CLASS=project "{0}"; class "{1}"
-VALIDATING_EL_FILE=project "{0}"; EL in "{1}"
\ No newline at end of file
+VALIDATING_EL_FILE=project "{0}"; EL in "{1}"
+VALIDATING_PROJECT=project "{0}"
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -141,6 +141,10 @@
public static String SeamValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label;
public static String SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label;
+ //Invalid seam project settings
+ public static String SeamValidatorConfigurationBlock_section_settings;
+ public static String SeamValidatorConfigurationBlock_pb_invalidSeamProjectSettings_label;
+
static {
NLS.initializeMessages(BUNDLE_NAME, SeamPreferencesMessages.class);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2008-04-04 17:23:03 UTC (rev 7353)
@@ -60,6 +60,11 @@
SeamValidatorConfigurationBlock_pb_checkVars_label=Recognize "var" attributes
SeamValidatorConfigurationBlock_pb_unknownElVariablePropertyName_label=Property cannot be resolved:
SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label=Unpaired Getter/Setter:
+
+##Invalid seam project settings
+SeamValidatorConfigurationBlock_section_settings=Project Settings
+SeamValidatorConfigurationBlock_pb_invalidSeamProjectSettings_label=Invalid seam project settings:
+
SEAM_VALIDATOR_CONFIGURATION_BLOCK_SEAM_VALIDATOR_CONFIGURATION_BLOCK=SeamValidatorConfigurationBlock
SEAM_VALIDATOR_CONFIGURATION_BLOCK_ERROR=Error
SEAM_VALIDATOR_CONFIGURATION_BLOCK_WARNING=Warning
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -424,7 +424,6 @@
private boolean error;
private void validate() {
-
warning = false;
error = false;
@@ -449,9 +448,9 @@
}
boolean deployAsEar = ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(getValue(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS));
- if(deployAsEar && !validateProjectName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_EJB_PROJECT_DOES_NOT_EXIST,
- ISeamFacetDataModelProperties.SEAM_EJB_PROJECT)) {
-// return;
+ if(deployAsEar) {
+ validateProjectName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_EJB_PROJECT_DOES_NOT_EXIST,
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT);
}
String viewFolder = getValue(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER).trim();
@@ -463,46 +462,31 @@
}
error = true;
setValid(false);
-// return;
}
}
- if(!validateSourceFolder(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_MODEL_SOURCE_FOLDER_DOES_NOT_EXIST,
+ validateSourceFolder(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_MODEL_SOURCE_FOLDER_DOES_NOT_EXIST,
ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER,
- ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME)) {
-// return;
- }
- if(!validateJavaPackageName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_MODEL_PACKAGE_IS_NOT_VALID,
+ ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME);
+ validateJavaPackageName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_MODEL_PACKAGE_IS_NOT_VALID,
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_MODEL_PACKAGE_HAS_WARNING,
- ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME)) {
-// return;
- }
+ ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME);
- if(!validateSourceFolder(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_ACTION_SOURCE_FOLDER_DOES_NOT_EXIST,
+ validateSourceFolder(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_ACTION_SOURCE_FOLDER_DOES_NOT_EXIST,
ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER,
- ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME)) {
-// return;
- }
- if(!validateJavaPackageName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_ACTION_PACKAGE_IS_NOT_VALID,
+ ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME);
+ validateJavaPackageName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_ACTION_PACKAGE_IS_NOT_VALID,
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_ACTION_PACKAGE_HAS_WARNING,
- ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME)) {
-// return;
- }
+ ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME);
if(isTestEnabled()) {
- if(!validateSourceFolder(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_SOURCE_FOLDER_DOES_NOT_EXIST,
+ validateSourceFolder(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_SOURCE_FOLDER_DOES_NOT_EXIST,
ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER,
- ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME)){
-// return;
- }
- if(!validateProjectName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_PROJECT_DOES_NOT_EXIST, ISeamFacetDataModelProperties.SEAM_TEST_PROJECT)) {
-// return;
- }
- if(!validateJavaPackageName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_PACKAGE_IS_NOT_VALID,
+ ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME);
+ validateProjectName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_PROJECT_DOES_NOT_EXIST, ISeamFacetDataModelProperties.SEAM_TEST_PROJECT);
+ validateJavaPackageName(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_PACKAGE_IS_NOT_VALID,
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_TEST_PACKAGE_HAS_WARNING,
- ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME)) {
-// return;
- }
+ ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME);
}
if(error) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2008-04-04 16:38:58 UTC (rev 7352)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2008-04-04 17:23:03 UTC (rev 7353)
@@ -35,7 +35,6 @@
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
-import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
/**
* Find in SeamPreferences the instruction to Framework for Severity preferences
@@ -129,6 +128,13 @@
}
);
+ private static SectionDescription SECTION_SETTINGS = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_settings,
+ new String[][]{
+ {SeamPreferences.INVALID_PROJECT_SETTINGS, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_invalidSeamProjectSettings_label}
+ }
+ );
+
private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
SECTION_COMPONENT,
SECTION_ENTITY,
@@ -136,7 +142,8 @@
SECTION_FACTORY,
SECTION_BIJECTION,
SECTION_VARIABLE,
- SECTION_EL
+ SECTION_EL,
+ SECTION_SETTINGS
};
private static final String ERROR = SeamPreferences.ERROR;
18 years
JBoss Tools SVN: r7352 - in trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui: global and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-04 12:38:58 -0400 (Fri, 04 Apr 2008)
New Revision: 7352
Modified:
trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FConstantsEditor.java
trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldDataEditor.java
trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldEditor.java
trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FormsetsBar.java
trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/global/ValidatorEditor.java
Log:
JBIDE-893
Modified: trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FConstantsEditor.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FConstantsEditor.java 2008-04-04 16:33:09 UTC (rev 7351)
+++ trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FConstantsEditor.java 2008-04-04 16:38:58 UTC (rev 7352)
@@ -1,13 +1,3 @@
-/*******************************************************************************
- * 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.struts.validator.ui.formset;
import java.util.*;
@@ -102,7 +92,13 @@
if(o == null) return;
if(name.equals(ActionNames.DELETE)) callAction(o, "DeleteActions.Delete");
else if(name.equals(ActionNames.EDIT)) callAction(o, "Properties.Properties");
- else if(name.equals(OVERWRITE)) executeOverwrite();
+ else if(name.equals(OVERWRITE)) {
+ try {
+ executeOverwrite();
+ } catch (XModelException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
else if(name.equals(DEFAULT)) callAction(o, "DeleteActions.ResetDefault");
}
}
@@ -117,7 +113,7 @@
if(i >= 0) xtable.setSelection(i);
}
- protected void executeOverwrite() {
+ protected void executeOverwrite() throws XModelException {
if(helper == null || fmodel == null) return;
XModelObject o = helper.getModelObject(xtable.getSelectionIndex());
if(o == null) return;
Modified: trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldDataEditor.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldDataEditor.java 2008-04-04 16:33:09 UTC (rev 7351)
+++ trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldDataEditor.java 2008-04-04 16:38:58 UTC (rev 7352)
@@ -1,18 +1,9 @@
-/*******************************************************************************
- * 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.struts.validator.ui.formset;
import java.util.Properties;
import java.util.Set;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.objecteditor.*;
import org.jboss.tools.struts.validator.ui.formset.model.DependencyModel;
import org.jboss.tools.struts.validator.ui.formset.model.FModel;
@@ -20,6 +11,7 @@
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.FindObjectHelper;
@@ -82,7 +74,13 @@
XModelObject o = helper.getModelObject(xtable.getSelectionIndex());
if(o == null) return;
if(name.equals(ActionNames.EDIT)) executeEdit(o);
- else if(name.equals(OVERWRITE)) executeOverwrite();
+ else if(name.equals(OVERWRITE)) {
+ try {
+ executeOverwrite();
+ } catch (XModelException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
else if(name.equals(ActionNames.DELETE)) callAction(o, "DeleteActions.Delete");
else if(name.equals(DEFAULT)) callAction(o, "DeleteActions.ResetDefault");
}
@@ -102,7 +100,7 @@
callAction(o, "Properties.Properties");
}
- protected void executeOverwrite() {
+ protected void executeOverwrite() throws XModelException {
if(helper == null || fmodel == null) return;
XModelObject o = helper.getModelObject(xtable.getSelectionIndex());
if(o == null) return;
@@ -140,8 +138,13 @@
XActionInvoker.invoke(actionpath, target, p);
}
if(ts == target.getTimeStamp()) return;
- if(po != null && co != null)
- DefaultCreateHandler.addCreatedObject(po, co, FindObjectHelper.IN_EDITOR_ONLY);
+ if(po != null && co != null) {
+ try {
+ DefaultCreateHandler.addCreatedObject(po, co, FindObjectHelper.IN_EDITOR_ONLY);
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ }
}
static XModelObject[] getTarget(FModel pf) {
Modified: trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldEditor.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldEditor.java 2008-04-04 16:33:09 UTC (rev 7351)
+++ trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FieldEditor.java 2008-04-04 16:38:58 UTC (rev 7352)
@@ -1,19 +1,10 @@
-/*******************************************************************************
- * 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.struts.validator.ui.formset;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.swt.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.util.FindObjectHelper;
@@ -184,7 +175,13 @@
protected void setDefault() {
XModelObject o = getModelObject();
- if(o != null) o.getModel().changeObjectAttribute(o, "page", "");
+ if(o != null) {
+ try {
+ o.getModel().changeObjectAttribute(o, "page", "");
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ }
}
protected void overwrite() {
@@ -195,7 +192,11 @@
invoke("EditActions.EditPage", ts[0]);
if(t != ts[0].getTimeStamp() && ts[1] != null) {
ts[0].setAttributeValue("indexedListProperty", "");
- DefaultCreateHandler.addCreatedObject(ts[1], ts[2], FindObjectHelper.IN_EDITOR_ONLY);
+ try {
+ DefaultCreateHandler.addCreatedObject(ts[1], ts[2], FindObjectHelper.IN_EDITOR_ONLY);
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
}
}
@@ -217,7 +218,13 @@
protected void setDefault() {
XModelObject o = getModelObject();
- if(o != null) o.getModel().changeObjectAttribute(o, "indexedListProperty", "");
+ if(o != null) {
+ try {
+ o.getModel().changeObjectAttribute(o, "indexedListProperty", "");
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ }
}
protected void overwrite() {
@@ -228,7 +235,11 @@
invoke("EditActions.EditIndex", ts[0]);
if(t != ts[0].getTimeStamp() && ts[1] != null) {
ts[0].setAttributeValue("page", "");
- DefaultCreateHandler.addCreatedObject(ts[1], ts[2], FindObjectHelper.IN_EDITOR_ONLY);
+ try {
+ DefaultCreateHandler.addCreatedObject(ts[1], ts[2], FindObjectHelper.IN_EDITOR_ONLY);
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
}
}
Modified: trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FormsetsBar.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FormsetsBar.java 2008-04-04 16:33:09 UTC (rev 7351)
+++ trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/formset/FormsetsBar.java 2008-04-04 16:38:58 UTC (rev 7352)
@@ -1,13 +1,3 @@
-/*******************************************************************************
- * 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.struts.validator.ui.formset;
import java.util.ArrayList;
@@ -23,7 +13,9 @@
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultRemoveHandler;
import org.jboss.tools.common.meta.help.HelpUtil;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.action.CommandBar;
import org.jboss.tools.common.model.ui.action.CommandBarLayout;
import org.jboss.tools.common.model.ui.action.CommandBarListener;
@@ -321,8 +313,13 @@
private void overwriteObject() {
XModelObject[] targets = FieldDataEditor.getTarget(selected);
- if(targets != null && targets[1] != null)
- DefaultCreateHandler.addCreatedObject(targets[1], targets[2], FindObjectHelper.IN_EDITOR_ONLY);
+ if(targets != null && targets[1] != null) {
+ try {
+ DefaultCreateHandler.addCreatedObject(targets[1], targets[2], FindObjectHelper.IN_EDITOR_ONLY);
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ }
updateInheritance();
}
Modified: trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/global/ValidatorEditor.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/global/ValidatorEditor.java 2008-04-04 16:33:09 UTC (rev 7351)
+++ trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/global/ValidatorEditor.java 2008-04-04 16:38:58 UTC (rev 7352)
@@ -1,13 +1,3 @@
-/*******************************************************************************
- * 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.struts.validator.ui.global;
import java.util.Properties;
@@ -16,6 +6,7 @@
import org.eclipse.swt.layout.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.swt.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.ui.editor.DefaultEditorPart;
@@ -213,8 +204,13 @@
}
public void save() {
- if(object != null && text != null)
- object.getModel().changeObjectAttribute(object, name, "" + text.getText()); //$NON-NLS-1$
+ if(object != null && text != null) {
+ try {
+ object.getModel().changeObjectAttribute(object, name, "" + text.getText()); //$NON-NLS-1$
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ }
}
public void setEnabled(boolean enabled) {
@@ -275,6 +271,8 @@
lock++;
try {
object.getModel().changeObjectAttribute(object, name, "" + text.getText()); //$NON-NLS-1$
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
} finally {
lock--;
}
18 years