summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-03-22 21:45:09 (EST)
committerpelder2006-03-22 21:45:09 (EST)
commiteda319e7e116d647fa944d5d4de14917dcf9ccec (patch)
tree8090d8e367c32acdbee32d8528a36f18dcc98fd3
parent297c270c1bf87912918522b13f989543c67cc93c (diff)
downloadorg.eclipse.jet-eda319e7e116d647fa944d5d4de14917dcf9ccec.zip
org.eclipse.jet-eda319e7e116d647fa944d5d4de14917dcf9ccec.tar.gz
org.eclipse.jet-eda319e7e116d647fa944d5d4de14917dcf9ccec.tar.bz2
[131380] Add whitespace stripping control to function tags, too.
-rw-r--r--plugins/org.eclipse.jet/plugin.xml3
-rw-r--r--plugins/org.eclipse.jet/schema/tagLibraries.exsd18
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java2
3 files changed, 21 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jet/plugin.xml b/plugins/org.eclipse.jet/plugin.xml
index ead2042..75f1d5a 100644
--- a/plugins/org.eclipse.jet/plugin.xml
+++ b/plugins/org.eclipse.jet/plugin.xml
@@ -278,7 +278,8 @@ The 'restoreNames' attribute is useful in recursive transforms. It cau
</emptyTag>
<functionTag
class="org.eclipse.jet.internal.taglib.control.LogTag"
- name="log">
+ name="log"
+ whenContainingLineIsEmpty="remove">
<description>
Write a message to the transformation log. The contents of the tag are written to the log. Nothing is written the template output.
diff --git a/plugins/org.eclipse.jet/schema/tagLibraries.exsd b/plugins/org.eclipse.jet/schema/tagLibraries.exsd
index c395605..4c0ff57 100644
--- a/plugins/org.eclipse.jet/schema/tagLibraries.exsd
+++ b/plugins/org.eclipse.jet/schema/tagLibraries.exsd
@@ -167,6 +167,24 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="whenContainingLineIsEmpty" use="default" value="preserve">
+ <annotation>
+ <documentation>
+ Defines the compiler behavior when the tag occurs on an otherwise empty line. If &apos;remove&apos; is selected, the whitespace and trailing new line are not included in the templates output. In general, if a tag writes content, then this attribute should be set to &apos;preserve&apos;.
+&lt;p&gt;
+The default for function tags is &apos;preserve&apos;.
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="preserve">
+ </enumeration>
+ <enumeration value="remove">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
</complexType>
</element>
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java
index 6617834..a4ce72e 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java
@@ -111,7 +111,7 @@ final class TagDefinitionImpl implements TagDefinition
if(removeWhenEmpty == null)
{
removeWhenContainingLineIsEmpty =
- kind == CustomTagKind.EMPTY || kind == CustomTagKind.FUNCTION ? false : true;
+ kind != CustomTagKind.EMPTY && kind != CustomTagKind.FUNCTION;
}
else
{