Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Create tag transform operation in jsf tools
Create tag transform operation in jsf tools [message #231761] Thu, 21 May 2009 22:24
Ronaldo is currently offline Ronaldo
Messages: 1
Registered: July 2009
Junior Member
Hi for all.
Sorry for my english.
I'm using extension point pageDesignExtension to create a new
TransformOperation for my tags. But don't work, I create the class
extending AbstractTransformOperation and create in my DTI file the
reference for this operation, and make the inclusion of extesion point in
plugin.xml but don’t work. IŽm forgot something?
Above the source code.
please help me.

Class
package com.mytag.test;

import org.eclipse.core.runtime.Assert;
import
org.eclipse.jst.pagedesigner.dtmanager.converter.operations. AbstractTransformOperation;
import org.w3c.dom.Element;

/**
* ITransformOperation implementation that creates a new Element.
*
* <br><b>Note:</b> requires
ITransformOperation.setTagConverterContext(...) to
* have been called to provide a valid ITagConverterContext instance prior
to
* a call to the transform(...) method.
*
* @author Ian Trimble - Oracle
*/
public class CreateElementOperation extends AbstractAWBTransformOperation {

private String tagName;
private String x;
/*
* (non-Javadoc)
* @see
org.eclipse.jst.pagedesigner.dtmanager.converter.operations. internal.provisional.AbstractTransformOperation#transform(or g.w3c.dom.Element,
org.w3c.dom.Element)
*/
public Element transform(Element srcElement, Element curElement) {

if (getParameters().length < 1) {
//getLog().error("Warning.TransformOperationFactory.TooFewParameters ",
getTransformOperationID()); //$NON-NLS-1$
return null;
}

tagName = getParameters()[0];
Assert.isNotNull(tagName);

Element element = null;
if (tagConverterContext != null && tagName != null && tagName.length() >
0) {
element = tagConverterContext.createElement(tagName);
}
return element;
}

}

Dti

<entity id="CommandButton" type="tag">
<trait id="dt-info">
<value xsi:type="dti:DTInfo">
<tag-convert-info>
<operation id="com.mytag.test.CreateElementOperation">
<parameter value="input"/>
</operation>
....

plugin.xml
...
<tagTransformOperation
id="com.mytag.test.CreateElementOperation"
class="com.mytag.test.CreateElementOperation">
</tagTransformOperation>
...
Previous Topic:WTP headless build issues...
Next Topic:Debugging the EE Module Dependencies property page
Goto Forum:
  


Current Time: Mon Sep 15 02:15:46 GMT 2014

Powered by FUDForum. Page generated in 0.02062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software