Author: mareshkau
Date: 2008-10-13 09:46:05 -0400 (Mon, 13 Oct 2008)
New Revision: 10794
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
=JBIDE-2828, validation of taglibs was added
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2008-10-13
13:42:56 UTC (rev 10793)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2008-10-13
13:46:05 UTC (rev 10794)
@@ -169,3 +169,4 @@
CHECK_JVM=Check JVM
CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER=Context root cannot contain character {0}.
WEB_RESOURCES=Web Resources
+INCORRECT_URI=Incorrect URI: {0}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java 2008-10-13
13:42:56 UTC (rev 10793)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java 2008-10-13
13:46:05 UTC (rev 10794)
@@ -187,4 +187,5 @@
public static String CHECK_JVM;
public static String CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER;
public static String WEB_RESOURCES;
+ public static String INCORRECT_URI;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-13 13:42:56 UTC
(rev 10793)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-13 13:46:05 UTC
(rev 10794)
@@ -411,7 +411,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Add CSS Reference..." kind="action"
name="AddItem">
<EntityData EntityName="VPEImageReference">
<AttributeData AttributeName="location"/>
@@ -421,7 +421,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Edit CSS Reference..." kind="action"
name="EditItem">
<EntityData EntityName="VPEImageReference">
<AttributeData AttributeName="location"/>
@@ -460,7 +460,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Add CSS Reference..." kind="action"
name="AddItem">
<EntityData EntityName="VPEImageReferenceExt">
<AttributeData AttributeName="location"/>
@@ -470,7 +470,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Edit CSS Reference..." kind="action"
name="EditItem">
<EntityData EntityName="VPEImageReferenceExt">
<AttributeData AttributeName="location"/>
@@ -510,7 +510,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Add Taglib Reference..." kind="action"
name="AddItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -521,7 +521,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Edit Taglib Reference..." kind="action"
name="EditItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -561,7 +561,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Add TLD Reference..." kind="action"
name="AddItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
@@ -572,7 +572,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.VpeTaglibReferenceSupport"
displayName="Edit TLD Reference..." kind="action"
name="EditItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-13 13:42:56 UTC (rev
10793)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-13 13:46:05 UTC (rev
10794)
@@ -8,5 +8,7 @@
class="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"/>
<xclass id="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
class="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"/>
+ <xclass id="org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
+ class="org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"/>
</extension>
</plugin>
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java 2008-10-13
13:46:05 UTC (rev 10794)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* 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.vpe.resref.core;
+
+import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeTaglibReferenceSupport extends VpeAddReferenceSupport {
+
+ private WizardDataValidator wizardDataValidator;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
+ */
+ @Override
+ public WizardDataValidator getValidator(int step) {
+
+ if(this.wizardDataValidator == null) {
+
+ wizardDataValidator = new VpeTaglibValidator(this, step);
+ }
+
+ return this.wizardDataValidator;
+ }
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java 2008-10-13
13:46:05 UTC (rev 10794)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+* 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.vpe.resref.core;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Properties;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeTaglibValidator extends DefaultWizardDataValidator {
+
+ /**
+ *
+ * @param support
+ * @param step
+ */
+ public VpeTaglibValidator(SpecialWizardSupport support, int step) {
+ super.setSupport(support, step);
+ }
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
+ */
+ @Override
+ public void validate(Properties data) {
+ super.validate(data);
+ if( (getErrorMessage()!=null) ||
+ (getWarningMessage()!=null)) {
+ return;
+ }
+ String uriStr = (String) data.get("location"); //$NON-NLS-1$
+ try {
+ new URI(uriStr);
+ }catch (URISyntaxException ex) {
+ message = NLS.bind(WebUIMessages.INCORRECT_URI,uriStr);
+ }
+ }
+}