Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Getting exception while trying to generate code on WTP through TagToolPaletteEntry
Getting exception while trying to generate code on WTP through TagToolPaletteEntry [message #666349] Wed, 20 April 2011 05:04
bunta Choudhary is currently offline bunta ChoudharyFriend
Messages: 39
Registered: December 2010
Member
I am using the below piece of code to generate code in WTP while dropping my custom component over the WPE-

String strbuttonTAG = input type=\"button\" value=\"Button\" /;
TagToolPaletteEntry paletteEntry = new TagToolPaletteEntry(
new CustomButtonPaletteComponent(CUSTITLDConstant.URI_HTML,strbuttonTAG,"custButton",CUSTPaletteRoot.class),
compName, "Create a MyComp",
ImageDescriptor.createFromFile(MyComponentFigure.class,"icons/MyFig.gif "),
ImageDescriptor.createFromFile(MyComponentFigure.class, "icons/MyFig.gif"));


but the above piece of code fails and throws exception -
!
Quote:
MESSAGE !!missing resource: Problem creating tag custButton at:DOMRefPosition: (after CUSTButton@[266, 276] ()) !! !STACK 0 org.w3c.dom.DOMException: null input type=\"button\" value=\"Button\" / at org.eclipse.wst.xml.core.internal.document.DocumentImpl.chec kTagNameValidity(DocumentImpl.java:259) at org.eclipse.wst.html.core.internal.document.DocumentStyleImp l.createElement(DocumentStyleImpl.java:70) at org.eclipse.jst.pagedesigner.itemcreation.AbstractTagCreator .createElement(AbstractTagCreator.java:93) at org.eclipse.jst.pagedesigner.itemcreation.AbstractTagCreator .createTag(AbstractTagCreator.java:49) at org.eclipse.jst.pagedesigner.utils.CommandUtil.executeInsert ion(CommandUtil.java:91) at org.eclipse.jst.pagedesigner.commands.CreateItemCommand.doEx ecute(CreateItemCommand.java:61) at org.eclipse.jst.pagedesigner.commands.DesignerCommand.execut e(DesignerCommand.java:124) at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:197) at org.eclipse.jst.pagedesigner.dnd.internal.PDTemplateTransfer DropTargetListener.handleDrop(PDTemplateTransferDropTargetLi stener.java:127) at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.drop( AbstractTransferDropTargetListener.java:183) at org.eclipse.jst.pagedesigner.dnd.internal.PDTemplateTransfer DropTargetListener.drop(PDTemplateTransferDropTargetListener .java:110) at org.eclipse.jface.util.DelegatingDropAdapter$3.run(Delegatin gDropAdapter.java:211) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5) at org.eclipse.jface.util.DelegatingDropAdapter.drop(Delegating DropAdapter.java:209) at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java :90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:7 74) at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:456) at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:258 ) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMOb ject.java:119) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java :172) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)



I found that, if we change the value of String to strbuttonTAG = "custComp" , it starts generate the tag as <custComp> .
But while trying to add even a space between strings , the
Quote:
checkTagNameValidity
fails.

My main motive is to generate html button tag(exactly same) while dropping my Custom Component. Is there any way to do it.
Previous Topic:Strange "deployment assembly" manifest editor behavior
Next Topic:XDEBUG & PECL
Goto Forum:
  


Current Time: Sat Nov 29 03:54:13 GMT 2014

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

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