[jbosstools-commits] JBoss Tools SVN: r6671 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui: META-INF and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Mar 3 11:37:48 EST 2008


Author: scabanovich
Date: 2008-03-03 11:37:48 -0500 (Mon, 03 Mar 2008)
New Revision: 6671

Added:
   trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/decorator/
   trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/decorator/TLDAttributeDecorator.java
Modified:
   trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
   trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
   trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java
Log:
JBIDE-1433 More decorators added.


Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF	2008-03-03 16:03:38 UTC (rev 6670)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF	2008-03-03 16:37:48 UTC (rev 6671)
@@ -15,6 +15,7 @@
  org.jboss.tools.jst.web.ui.editors,
  org.jboss.tools.jst.web.ui.editors.forms,
  org.jboss.tools.jst.web.ui.navigator,
+ org.jboss.tools.jst.web.ui.navigator.decorator,
  org.jboss.tools.jst.web.ui.operation,
  org.jboss.tools.jst.web.ui.wizards.appregister,
  org.jboss.tools.jst.web.ui.wizards.links,

Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml	2008-03-03 16:03:38 UTC (rev 6670)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml	2008-03-03 16:37:48 UTC (rev 6671)
@@ -585,6 +585,95 @@
                <put name="display-name" value="JSTL Core"/>
             </example>
       </labelDecorator>
+
+      <labelDecorator
+            entities="TLDTag12,TLDTag20,TLDTag21"
+            name="Tag"
+            partition="Tag Libraries"
+            defaultValue="{display-name}">
+            <variable name="display-name" description="attribute of tag node"/>
+            <example entity="TLDTag12">
+               <put name="name" value="tag1"/>
+            </example>
+            <example entity="TLDTag12">
+               <put name="name" value="tag2"/>
+               <put name="display-name" value="Second Tag"/>
+            </example>
+      </labelDecorator>
+
+      <labelDecorator
+            entities="TLDTagFile"
+            name="Tag File"
+            partition="Tag Libraries"
+            defaultValue="{display-name}">
+            <variable name="display-name" description="attribute of tag-file node"/>
+            <variable name="path" description="attribute of tag-file node"/>
+            <example entity="TLDTagFile">
+               <put name="name" value="f"/>
+               <put name="display-name" value="File"/>
+               <put name="path" value="/a/b/c.tag"/>
+            </example>
+      </labelDecorator>
+
+      <labelDecorator
+            entities="TLDAttribute,TLDAttribute12,TLDAttribute20,TLDAttribute21,TLDAttribute2F"
+            name="Attribute"
+            partition="Tag Libraries"
+            defaultValue="{name}{required( REQUIRED)}">
+            <variable name="required(value)"
+            		  class="org.jboss.tools.jst.web.ui.navigator.decorator.TLDAttributeDecorator" 
+            		  description="inserts 'value' if attribute 'required' is set to 'true'"/>
+            <example entity="TLDAttribute12">
+               <put name="name" value="attr1"/>
+               <put name="required" value="true"/>
+            </example>
+            <example entity="TLDAttribute12">
+               <put name="name" value="attr2"/>
+               <put name="required" value="false"/>
+            </example>
+      </labelDecorator>
+
+      <labelDecorator
+            entities="TLDFunction"
+            name="Function"
+            partition="Tag Libraries"
+            defaultValue="{display-name}">
+            <variable name="function-class" description="attribute of function node"/>
+            <variable name="display-name" description="attribute of function node"/>
+            <example entity="TLDFunction">
+               <put name="name" value="func"/>
+               <put name="display-name" value="Custom Function"/>
+               <put name="function-class" value="a.b.C"/>
+            </example>
+      </labelDecorator>
+
+      <labelDecorator
+            entities="TLDVariable"
+            name="Variable"
+            partition="Tag Libraries"
+            defaultValue="{name}">
+            <variable name="scope" description="attribute of variable node"/>
+            <example entity="TLDVariable">
+               <put name="name-given" value="var1"/>
+               <put name="scope" value="NESTED"/>
+            </example>
+            <example entity="TLDVariable">
+               <put name="name-from-attribute" value="var2"/>
+               <put name="scope" value="AT_BEGIN"/>
+            </example>
+      </labelDecorator>
+
+      <labelDecorator
+            entities="TLDValidator"
+            name="Validator"
+            partition="Tag Libraries"
+            defaultValue="{name}">
+            <variable name="validator-class" description="attribute of validator node"/>
+            <example entity="TLDValidator">
+               <put name="validator-class" value="a.b.C"/>
+            </example>
+      </labelDecorator>
+
    </extension>
 
 </plugin>

Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java	2008-03-03 16:03:38 UTC (rev 6670)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java	2008-03-03 16:37:48 UTC (rev 6671)
@@ -25,15 +25,16 @@
 	public String getText(Object element) {
 		if(!(element instanceof XModelObject)) return "";
 		XModelObject o = (XModelObject)element;
-		if(o.getFileType() != XModelObject.FILE) return super.getText(element);
 		String entity = o.getModelEntity().getName();
-		
+
 		XModelObjectDecorator d = DecoratorManager.getInstance().getDecoratorByEntity(entity);
 		if(d != null) {
 			String label = d.getLabel(o);
 			return applyModification(o, label);
 		}
 		
+		if(o.getFileType() != XModelObject.FILE) return super.getText(element);
+		
 		if("FilePROPERTIES".equals(entity)) {
 			XModelObject fs = o;
 			while(fs != null && fs.getFileType() != XModelObject.SYSTEM) fs = fs.getParent();

Added: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/decorator/TLDAttributeDecorator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/decorator/TLDAttributeDecorator.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/decorator/TLDAttributeDecorator.java	2008-03-03 16:37:48 UTC (rev 6671)
@@ -0,0 +1,18 @@
+package org.jboss.tools.jst.web.ui.navigator.decorator;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.navigator.decorator.ICustomVariable;
+
+public class TLDAttributeDecorator implements ICustomVariable {
+
+	public String getLabelPart(XModelObject object, String parameters) {
+		if(object == null) return "";
+		String required = object.getAttributeValue("required");
+		if(required == null || parameters == null) return "";
+		if("true".equals(required) || "yes".equals(required)) {
+			return "" + parameters;
+		}
+		return "";
+	}
+
+}




More information about the jbosstools-commits mailing list