summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-03-21 13:14:27 (EST)
committer pelder2006-03-21 13:14:27 (EST)
commitba055ff43a9d1ec3c660e566698ab249a70b6f21 (patch)
tree2ec47acbd042f76237640809d37afd902c71b1e6
parent2916afaa773b72142601af76f2b71310eb9f1294 (diff)
downloadorg.eclipse.jet-ba055ff43a9d1ec3c660e566698ab249a70b6f21.zip
org.eclipse.jet-ba055ff43a9d1ec3c660e566698ab249a70b6f21.tar.gz
org.eclipse.jet-ba055ff43a9d1ec3c660e566698ab249a70b6f21.tar.bz2
[1326688">1326688] Make rules attribute optional. Use EMF Code Generator JMerge rules by default.
-rw-r--r--plugins/org.eclipse.jet/plugin.xml4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/MergeTag.java7
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/org.eclipse.jet/plugin.xml b/plugins/org.eclipse.jet/plugin.xml
index 60fa8d3..ead2042 100644
--- a/plugins/org.eclipse.jet/plugin.xml
+++ b/plugins/org.eclipse.jet/plugin.xml
@@ -925,9 +925,9 @@ This tag must be preceded by a 'importsLocation' tag.
<attribute
name="rules"
type="string"
- use="required">
+ use="optional">
<description>
- A URL to the JMerge rules file. If the path is relative, then it is relative to the location specified by the rulesContext attribute.
+ A URL to the JMerge rules file. If the path is relative, then it is relative to the location specified by the rulesContext attribute. If not specified, the default is the JMerge rules used by the EMF Code Generator.
</description>
</attribute>
<attribute
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/MergeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/MergeTag.java
index 85e9344..96d869b 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/MergeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/MergeTag.java
@@ -28,7 +28,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.codegen.jmerge.JControlModel;
import org.eclipse.emf.codegen.jmerge.JMerger;
-import org.eclipse.emf.codegen.merge.java.facade.jdom.JDOMFacadeHelper;
import org.eclipse.jdt.core.jdom.DOMFactory;
import org.eclipse.jdt.core.jdom.IDOMCompilationUnit;
import org.eclipse.jdt.core.jdom.IDOMFactory;
@@ -47,6 +46,8 @@ import org.eclipse.jface.text.Position;
public class MergeTag extends AbstractEmptyTag
{
+ private final String EMF_CODEGEN_RULES_URL = "platform:/plugin/org.eclipse.emf.codegen.ecore/templates/emf-merge.xml"; //$NON-NLS-1$
+
/**
* Position marker for JMergeable content.
*/
@@ -167,6 +168,10 @@ private static final String JMERGE_POSITION_CATEGORY = MergeTag.class.getName();
public void doAction(TagInfo td, JET2Context context, JET2Writer out) throws JET2TagException
{
String rules = getAttribute("rules"); //$NON-NLS-1$
+ if(rules == null)
+ {
+ rules = EMF_CODEGEN_RULES_URL;
+ }
String rulesContext = getAttribute("rulesContext"); //$NON-NLS-1$
if(rulesContext == null)
{