Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » IllegalArgumentException selecting variable in snippet supplied in plug-in
IllegalArgumentException selecting variable in snippet supplied in plug-in [message #143266] Wed, 12 October 2005 14:16 Go to next message
Eclipse UserFriend
Originally posted by: plotnick.us.ibm.com

Using WTP version .7, the following plugin.xml supplies a snippet to
Eclipse:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.wst.common.snippets.SnippetContributions ">
<category filters="*" icon="" id="category_1129061971546"
initial_state="0" label="DonDrawer" largeicon="">
<description/>
<item category="category_1129061971546" class="" editorclass=""
icon="" id="item_1129061987484" label="DonItem" largeicon="">
<description><![CDATA[Description]]></description>
<content><![CDATA[if(${var1} > ${var2}) continue;]]></content>
<variable default="" id="name_2" name="var2">
<description/>
</variable>
<variable default="" id="name_1" name="var1">
<description/>
</variable>
</item>
</category>
</extension>
</plugin>

When I double-clicket the snippet, and click on one of the variables in the
Variables table, I get an error pop-up, with the following in the error log.
Any ideas?

!ENTRY org.eclipse.jface 4 2 2005-10-11 16:41:37.906
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.jface".
!STACK 0
java.lang.IllegalArgumentException: Argument cannot be null
at org.eclipse.swt.SWT.error(SWT.java:2926)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at org.eclipse.swt.SWT.error(SWT.java:2836)
at org.eclipse.swt.custom.StyledText.setText(StyledText.java:75 86)
at
org.eclipse.wst.common.snippets.internal.VariableInsertionDi alog$1.selection
Changed(VariableInsertionDialog.java:150)
at
org.eclipse.wst.common.snippets.internal.ui.StringPropertyTa bleViewer.fireSe
lectionChanged(StringPropertyTableViewer.java:221)
at
org.eclipse.wst.common.snippets.internal.ui.StringPropertyTa bleViewer$MultiC
astingSelectionChangedListener.selectionChanged(StringProper tyTableViewer.ja
va:51)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
(Inlined Compiled Code))
at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:14 8)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.
java:1784)
at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.jav
a:1027)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer
..java:1053)
at
org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:209
)
at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:204)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:364)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled
Code))
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled
Code))
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va(Compiled
Code))
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled
Code))
at org.eclipse.jface.window.Window.runEventLoop(Window.java(Com piled Code))
at org.eclipse.jface.window.Window.open(Window.java:787)
at
org.eclipse.wst.common.snippets.internal.VariableItemHelper. getInsertString(
VariableItemHelper.java:55)
at
org.eclipse.wst.common.snippets.internal.VariableItemHelper. getInsertString(
VariableItemHelper.java:24)
at
org.eclipse.wst.common.snippets.internal.provisional.inserti ons.VariableInse
rtion.getInsertString(VariableInsertion.java:89)
at
org.eclipse.wst.common.snippets.internal.provisional.inserti ons.AbstractInse
rtion.doInsert(AbstractInsertion.java:67)
at
org.eclipse.wst.common.snippets.internal.provisional.inserti ons.AbstractInse
rtion.insert(AbstractInsertion.java:166)
at
org.eclipse.wst.common.snippets.internal.provisional.inserti ons.VariableInse
rtion.insert(VariableInsertion.java:102)
at
org.eclipse.wst.common.snippets.internal.ui.SnippetsView$Ins ertionHelper.ins
ert(SnippetsView.java:219)
at
org.eclipse.wst.common.snippets.internal.ui.SnippetsView.ins ert(SnippetsView
..java:754)
at
org.eclipse.wst.common.snippets.internal.ui.SnippetsView$Ins ertMouseListener
..mouseDoubleClick(SnippetsView.java:237)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:141)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled
Code))
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled
Code))
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va(Compiled
Code))
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled
Code))
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a(Compiled
Code))
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
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.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Re: IllegalArgumentException selecting variable in snippet supplied in plug-in [message #143515 is a reply to message #143266] Thu, 13 October 2005 18:34 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4474
Registered: July 2009
Senior Member

exquisitus wrote:
> Using WTP version .7, the following plugin.xml supplies a snippet to
> Eclipse:
>
> <variable default="" id="name_2" name="var2">
> <description/>
> </variable>
> <variable default="" id="name_1" name="var1">
> <description/>
> </variable>
>
> When I double-clicket the snippet, and click on one of the variables in the
> Variables table, I get an error pop-up, with the following in the error log.
> Any ideas?
>
> !ENTRY org.eclipse.jface 4 2 2005-10-11 16:41:37.906
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.jface".
> !STACK 0
> java.lang.IllegalArgumentException: Argument cannot be null
> at org.eclipse.swt.SWT.error(SWT.java:2926)
> at org.eclipse.swt.SWT.error(SWT.java:2865)
> at org.eclipse.swt.SWT.error(SWT.java:2836)
> at org.eclipse.swt.custom.StyledText.setText(StyledText.java:75 86)
> at
> org.eclipse.wst.common.snippets.internal.VariableInsertionDi alog$1.selection
> Changed(VariableInsertionDialog.java:150)
> at

The insertion dialog is assuming that your variable has a
description, as an attribute, not a child configuration element, and
that there's actual text specified for it.

--
- Nitin


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: IllegalArgumentException selecting variable in snippet supplied in plug-in [message #143539 is a reply to message #143515] Thu, 13 October 2005 19:52 Go to previous message
Eclipse UserFriend
Originally posted by: plotnick.us.ibm.com

Thanks, changing the variables to the following resolved the problem. I
guess you can't just export a snippet to an XML file, and copy its contents
into the plugin.xml.

<variable default="" id="name_2" name="var2" description="this is var
2"></variable>
<variable default="" id="name_1" name="var1" description="this is var
1"></variable>
Previous Topic:Extension point to add a working set to 'Project Explorer'
Next Topic:Property view for element in schema editor
Goto Forum:
  


Current Time: Thu Jul 18 11:25:35 GMT 2024

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

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

Back to the top