[jbosstools-commits] JBoss Tools SVN: r17731 - in trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld: model/helpers and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Sep 25 08:39:23 EDT 2009


Author: scabanovich
Date: 2009-09-25 08:39:23 -0400 (Fri, 25 Sep 2009)
New Revision: 17731

Added:
   trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/URIConstants.java
Modified:
   trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/helpers/TLDToPaletteHelper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4913


Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/URIConstants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/URIConstants.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/URIConstants.java	2009-09-25 12:39:23 UTC (rev 17731)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * 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.jst.web.tld;
+
+public interface URIConstants {
+	public String LIBRARY_URI = "library uri"; //$NON-NLS-1$
+	public String LIBRARY_VERSION = "library version"; //$NON-NLS-1$
+	public String DEFAULT_PREFIX = "default prefix"; //$NON-NLS-1$
+}

Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/helpers/TLDToPaletteHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/helpers/TLDToPaletteHelper.java	2009-09-25 12:38:29 UTC (rev 17730)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/helpers/TLDToPaletteHelper.java	2009-09-25 12:39:23 UTC (rev 17731)
@@ -16,9 +16,9 @@
 import org.jboss.tools.jst.web.tld.model.TLDUtil;
 
 public class TLDToPaletteHelper {
-    public static final String START_TEXT = "start text"; //$NON-NLS-1$
-    public static final String END_TEXT = "end text"; //$NON-NLS-1$
-    public static final String REFORMAT = "automatically reformat tag body"; //$NON-NLS-1$
+    public static final String START_TEXT = XModelObjectConstants.START_TEXT;
+    public static final String END_TEXT = XModelObjectConstants.END_TEXT;
+    public static final String REFORMAT = XModelObjectConstants.REFORMAT;
     public static final String DESCRIPTION = "description"; //$NON-NLS-1$
     public static final String URI = URIConstants.LIBRARY_URI;
     public static final String DEFAULT_PREFIX = URIConstants.DEFAULT_PREFIX;
@@ -95,7 +95,7 @@
 		 }
 		 for (int i = 0; i < as.length; i++) {
 			 if(isRequired(as[i])) continue;
-			 sb.append(as[i].getAttributeValue("name")); //$NON-NLS-1$
+			 sb.append(as[i].getAttributeValue(XModelObjectConstants.ATTR_NAME));
 			 ++k;
 			 if(k < as.length) sb.append(", "); //$NON-NLS-1$
 		}
@@ -107,7 +107,7 @@
 
     private boolean isRequired(XModelObject attr) {
         String required = attr.getAttributeValue("required"); //$NON-NLS-1$
-        return ("true".equals(required) || "yes".equals(required)); //$NON-NLS-1$ //$NON-NLS-2$
+        return (XModelObjectConstants.TRUE.equals(required) || XModelObjectConstants.TRUE.equals(required));
     }
 
     public XModelObject createTabByTLD(XModelObject tld, XModel model) {
@@ -120,7 +120,7 @@
 
     private XModelObject createGroupByTLD(XModelObject tld, XModel model, String entity) {
         Properties p = new Properties();
-        p.setProperty("name", capitalize(getTldName(tld))); //$NON-NLS-1$
+        p.setProperty(XModelObjectConstants.ATTR_NAME, capitalize(getTldName(tld)));
         p.setProperty(DESCRIPTION, TLDUtil.getTagDescription(tld));
         p.setProperty(DEFAULT_PREFIX, getTldName(tld));
         p.setProperty(URIConstants.LIBRARY_URI, "" + tld.getAttributeValue("uri")); //$NON-NLS-1$ //$NON-NLS-2$



More information about the jbosstools-commits mailing list