Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » VariableInsertion with snippets
VariableInsertion with snippets [message #130005] Fri, 05 August 2005 02:23 Go to next message
Eclipse UserFriend
Originally posted by: denmei.de.ibm.com

Hello,

I'm about to write a plug-in that provide some "code snippets" as a new
category in the snippet view. I'm using Rational Webdeveloper 6. In my
plug-in I'm using the extension point
"com.ibm.sse.snippets.SnippetContributions" which has moved to
"org.eclipse.wst.common.snippets.SnippetContributions".

When I start RAD my category appears in the snippet view and also my
snippet is there. As long as I don't use any variables the insertion of
the snippet works. When I use the <variable>-tags to specify which
variables the user is to be asked about, the dialog opens in which the
user is supposed to edit these variables. As soon as one of the lines
which contains the variables is selected an exception is thrown. Maybe the
declaration of the variable-tag is wrong?

I've been trying to fix this now for hours and I'm getting desperated ^^

What follows is the exception that is thrown and after that the content of
my plugin.xml


------------ Exception ----
Error Aug 05, 2005 08:16:33.55 Problems occurred when invoking code from
plug-in: "org.eclipse.core.runtime".
java.lang.IllegalArgumentException: Argument cannot be null
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.custom.StyledText.setText(Unknown Source)
at
com.ibm.sse.snippets.insertions.VariableInsertionDialog$1.se lectionChanged(Unknown
Source)
at
com.ibm.sse.snippets.viewer.StringPropertyTableViewer.fireSe lectionChanged(Unknown
Source)
at
com.ibm.sse.snippets.viewer.StringPropertyTableViewer$MultiC astingSelectionChangedListener.selectionChanged(Unknown
Source)
at org.eclipse.jface.viewers.Viewer$2.run(Unknown Source)
at org.eclipse.core.internal.runtime.InternalPlatform.run(Unkno wn Source)
at org.eclipse.core.runtime.Platform.run(Unknown Source)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Unknow n Source)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(U nknown
Source)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(Unkn own Source)
at com.ibm.sse.snippets.util.AccessibleTableViewer.access$0(Unk nown
Source)
at
com.ibm.sse.snippets.util.AccessibleTableViewer$2.widgetSele cted(Unknown
Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.jface.window.Window.runEventLoop(Unknown Source)
at org.eclipse.jface.window.Window.open(Unknown Source)
at
com.ibm.sse.snippets.insertions.VariableItemHelper.getInsert String(Unknown
Source)
at
com.ibm.sse.snippets.insertions.VariableItemHelper.getInsert String(Unknown
Source)
at
com.ibm.sse.snippets.insertions.VariableInsertion.getInsertS tring(Unknown
Source)
at com.ibm.sse.snippets.insertions.PrependInsertion.insert(Unkn own Source)
at com.ibm.sse.snippets.views.SnippetsView$InsertionHelper.inse rt(Unknown
Source)
at com.ibm.sse.snippets.views.SnippetsView.insert(Unknown Source)
at
com.ibm.sse.snippets.views.SnippetsView$InsertMouseListener. mouseDoubleClick(Unknown
Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unkn own Source)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
at org.eclipse.ui.internal.ide.IDEApplication.run(Unknown Source)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Un known
Source)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)


--------- Content of plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="foo"
name="fooName"
version="1.0.21"
provider-name="fooProv"
>

<requires>
<import plugin="org.eclipse.core.runtime.compatibility"/>
</requires>


<extension
point="com.ibm.sse.snippets.SnippetContributions">
<category
label="fooCatName"
id="fooCategory"
contenttypes="com.ibm.sse.model.jsp.jspsource" />

<item
category="fooCategory"
class="com.ibm.sse.snippets.insertions.PrependInsertion"
id="fooitemId"
label="fooSnippetName">

<description>
<![CDATA[fooSnippetDescription]]>
</description>

<content><![CDATA

content of the snippet
this is a ${fooVarName}.

]]></content>

<variable id="fooVarName" />

</item>

</extension>
</plugin>

-----------------

Any help is greatly appreciated,

Dennis Meier
Re: VariableInsertion with snippets [message #130838 is a reply to message #130005] Mon, 08 August 2005 10:55 Go to previous message
Eclipse UserFriend
Dennis Meier wrote:
> I'm about to write a plug-in that provide some "code snippets" as a new
> category in the snippet view. I'm using Rational Webdeveloper 6. In my
> plug-in I'm using the extension point
> "com.ibm.sse.snippets.SnippetContributions" which has moved to
> "org.eclipse.wst.common.snippets.SnippetContributions".

> <content><![CDATA
>
> content of the snippet
> this is a ${fooVarName}.
>
> ]]></content>

Questions like this should be directed at IBM support, but it looks
like you have a malformed plugin.xml file. I wasn't able to
reproduce the problem you're seeing after correcting it.

--
- Nitin
Previous Topic:Generate->XML File... from XML Schema problems
Next Topic:Slow JSP Editor for taglib lines
Goto Forum:
  


Current Time: Thu May 08 14:02:26 EDT 2025

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

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

Back to the top