Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Adding a command to view's tool bar throws java.lang.IllegalArgumentException: Index out of bounds
Adding a command to view's tool bar throws java.lang.IllegalArgumentException: Index out of bounds [message #527032] Tue, 13 April 2010 19:02 Go to next message
Raj Saini is currently offline Raj SainiFriend
Messages: 53
Registered: July 2009
Member
Hi,

I have problem adding a command to view's tool bar. Same command works
fine when I add it to the main tool bar and menu. Stack trace and
relevant part of the plugin.xml are below


==================plugin.xml================================
<extension
point="org.eclipse.ui.views">
<view
name="Example List"
icon="icons/sample3.gif"
class="com.viithiisys.example.views.ExampleListView"
id="com.viithiisys.example.views.exampleListView">
</view>
</extension>

<extension
point="org.eclipse.ui.commands">
<category
name="Example"
id="com.viithiisys.example.category">
</category>
<command
name="Edit Example"
description="Opens Example editor"
categoryId="com.viithiisys.example.category"
id="com.viithiisys.example.commands.openExampleEditor"

defaultHandler="com.viithiisys.example.actions.OpenEditorHandler ">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution

locationURI="toolbar:com.viithiisys.example.views.exampleListView ">
<toolbar
id="menu-contribution.toolbars.sampleToolbar">
<command

commandId="com.viithiisys.example.commands.openExampleEditor "
icon="icons/sample.gif"
tooltip="Say hello world"
id="menu-contribution.toolbars.sampleCommand">
</command>
</toolbar>
</menuContribution>
</extension>

=======================stack trace==========================
!STACK 0
java.lang.IllegalArgumentException: Index out of bounds
at org.eclipse.swt.SWT.error(SWT.java:3084)
at org.eclipse.swt.SWT.error(SWT.java:3018)
at org.eclipse.swt.SWT.error(SWT.java:2989)
at org.eclipse.swt.internal.widgets.ItemHolder.getItem(ItemHold er.java:102)
at org.eclipse.swt.widgets.ToolBar.getItem(ToolBar.java:132)
at
org.eclipse.rap.internal.design.example.managers.ViewToolBar Manager.update(ViewToolBarManager.java:161)
at org.eclipse.ui.internal.ViewPane.updateActionBars(ViewPane.j ava:462)
at
org.eclipse.ui.internal.ViewActionBars.updateActionBars(View ActionBars.java:59)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:419)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:31 2)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:54 4)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:185)
at
org.eclipse.rap.internal.design.example.stacks.ViewStackPres entation.selectPart(ViewStackPresentation.java:957)
at
org.eclipse.rap.ui.interactiondesign.internal.ConfigurableSt ackProxy.selectPart(ConfigurableStackProxy.java:425)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1267)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1220)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 19)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:659)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:585)
at
org.eclipse.ui.internal.PartSashContainer.createControl(Part SashContainer.java:569)
at
org.eclipse.ui.internal.PerspectiveHelper.activate(Perspecti veHelper.java:267)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.j ava:930)
at
org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPa ge.java:2494)
at
org.eclipse.ui.internal.WorkbenchWindow$22.run(WorkbenchWind ow.java:2926)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:66)
at
org.eclipse.ui.internal.WorkbenchWindow.setActivePage(Workbe nchWindow.java:2907)
at
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:720)
at
org.eclipse.ui.internal.Workbench$18.runWithException(Workbe nch.java:976)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:32)
at
org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:115)
at org.eclipse.swt.widgets.Display$2.run(Display.java:931)
at
org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 460)
at
org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:929)
at
org.eclipse.ui.internal.StartupThreading.runWithWorkbenchExc eptions(StartupThreading.java:55)
at
org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Wo rkbench.java:972)
at
org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Work bench.java:1799)
at
org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbe nch.java:1735)
at
org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWin dow(WorkbenchConfigurer.java:188)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:790)
at
org.eclipse.ui.internal.Workbench$25.runWithException(Workbe nch.java:1341)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:32)
at
org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:115)
at org.eclipse.swt.widgets.Display$2.run(Display.java:931)
at
org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 460)
at
org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:929)
at
org.eclipse.ui.internal.StartupThreading.runWithoutException s(StartupThreading.java:110)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1336)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2317)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 06)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.jface.internal.databinding.realmadapter.RealmAda pter.run(RealmAdapter.java:44)
at
org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault( RealmAdapterHook.java:48)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:427)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:157)
at com.viithiisys.example.Application.start(Application.java:20 )
at
org.eclipse.rap.ui.internal.application.EntrypointApplicatio nWrapper.createUI(EntrypointApplicationWrapper.java:27)
at
org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:253)
at
org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:117)
at java.lang.Thread.run(Thread.java:619)
at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.jav a:80)
Re: Adding a command to view's tool bar throws java.lang.IllegalArgumentException: Index out of bou [message #527048 is a reply to message #527032] Tue, 13 April 2010 19:44 Go to previous messageGo to next message
Raj Saini is currently offline Raj SainiFriend
Messages: 53
Registered: July 2009
Member
I am using RAP 1.4M6.

On 14/04/10 00:32, Raj Saini wrote:
> Hi,
>
> I have problem adding a command to view's tool bar. Same command works
> fine when I add it to the main tool bar and menu. Stack trace and
> relevant part of the plugin.xml are below
>
>
> ==================plugin.xml================================
> <extension
> point="org.eclipse.ui.views">
> <view
> name="Example List"
> icon="icons/sample3.gif"
> class="com.viithiisys.example.views.ExampleListView"
> id="com.viithiisys.example.views.exampleListView">
> </view>
> </extension>
>
> <extension
> point="org.eclipse.ui.commands">
> <category
> name="Example"
> id="com.viithiisys.example.category">
> </category>
> <command
> name="Edit Example"
> description="Opens Example editor"
> categoryId="com.viithiisys.example.category"
> id="com.viithiisys.example.commands.openExampleEditor"
>
> defaultHandler="com.viithiisys.example.actions.OpenEditorHandler ">
> </command>
> </extension>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
>
> locationURI="toolbar:com.viithiisys.example.views.exampleListView ">
> <toolbar
> id="menu-contribution.toolbars.sampleToolbar">
> <command
>
> commandId="com.viithiisys.example.commands.openExampleEditor "
> icon="icons/sample.gif"
> tooltip="Say hello world"
> id="menu-contribution.toolbars.sampleCommand">
> </command>
> </toolbar>
> </menuContribution>
> </extension>
>
> =======================stack trace==========================
> !STACK 0
> java.lang.IllegalArgumentException: Index out of bounds
> at org.eclipse.swt.SWT.error(SWT.java:3084)
> at org.eclipse.swt.SWT.error(SWT.java:3018)
> at org.eclipse.swt.SWT.error(SWT.java:2989)
> at org.eclipse.swt.internal.widgets.ItemHolder.getItem(ItemHold er.java:102)
> at org.eclipse.swt.widgets.ToolBar.getItem(ToolBar.java:132)
> at
> org.eclipse.rap.internal.design.example.managers.ViewToolBar Manager.update(ViewToolBarManager.java:161)
>
> at org.eclipse.ui.internal.ViewPane.updateActionBars(ViewPane.j ava:462)
> at
> org.eclipse.ui.internal.ViewActionBars.updateActionBars(View ActionBars.java:59)
>
> at
> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:419)
>
> at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>
> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:31 2)
> at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:54 4)
> at
> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:185)
>
> at
> org.eclipse.rap.internal.design.example.stacks.ViewStackPres entation.selectPart(ViewStackPresentation.java:957)
>
> at
> org.eclipse.rap.ui.interactiondesign.internal.ConfigurableSt ackProxy.selectPart(ConfigurableStackProxy.java:425)
>
> at
> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1267)
>
> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1220)
> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 19)
> at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:659)
> at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:585)
> at
> org.eclipse.ui.internal.PartSashContainer.createControl(Part SashContainer.java:569)
>
> at
> org.eclipse.ui.internal.PerspectiveHelper.activate(Perspecti veHelper.java:267)
>
> at org.eclipse.ui.internal.Perspective.onActivate(Perspective.j ava:930)
> at
> org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPa ge.java:2494)
> at
> org.eclipse.ui.internal.WorkbenchWindow$22.run(WorkbenchWind ow.java:2926)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:66)
> at
> org.eclipse.ui.internal.WorkbenchWindow.setActivePage(Workbe nchWindow.java:2907)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:720)
>
> at
> org.eclipse.ui.internal.Workbench$18.runWithException(Workbe nch.java:976)
> at
> org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:32)
>
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:115)
>
> at org.eclipse.swt.widgets.Display$2.run(Display.java:931)
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 460)
>
> at
> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>
> at org.eclipse.swt.widgets.Display.syncExec(Display.java:929)
> at
> org.eclipse.ui.internal.StartupThreading.runWithWorkbenchExc eptions(StartupThreading.java:55)
>
> at
> org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Wo rkbench.java:972)
>
> at
> org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Work bench.java:1799)
>
> at
> org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbe nch.java:1735)
> at
> org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWin dow(WorkbenchConfigurer.java:188)
>
> at
> org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:790)
>
> at
> org.eclipse.ui.internal.Workbench$25.runWithException(Workbe nch.java:1341)
> at
> org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:32)
>
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync (UICallBackManager.java:115)
>
> at org.eclipse.swt.widgets.Display$2.run(Display.java:931)
> at
> org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. runNonUIThreadWithFakeContext(UICallBackServiceHandler.java: 460)
>
> at
> org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeC ontext(UICallBack.java:44)
>
> at org.eclipse.swt.widgets.Display.syncExec(Display.java:929)
> at
> org.eclipse.ui.internal.StartupThreading.runWithoutException s(StartupThreading.java:110)
>
> at org.eclipse.ui.internal.Workbench.init(Workbench.java:1336)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2317)
> at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 06)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.jface.internal.databinding.realmadapter.RealmAda pter.run(RealmAdapter.java:44)
>
> at
> org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault( RealmAdapterHook.java:48)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:427)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:157)
> at com.viithiisys.example.Application.start(Application.java:20 )
> at
> org.eclipse.rap.ui.internal.application.EntrypointApplicatio nWrapper.createUI(EntrypointApplicationWrapper.java:27)
>
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:253)
>
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:117)
>
> at java.lang.Thread.run(Thread.java:619)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.jav a:80)
Re: Adding a command to view's tool bar throws java.lang.IllegalArgumentException: Index out of bou [message #527073 is a reply to message #527048] Tue, 13 April 2010 21:10 Go to previous messageGo to next message
Raj Saini is currently offline Raj SainiFriend
Messages: 53
Registered: July 2009
Member
Sorry, I mean RAP 1.3M6

On 14/04/10 01:14, Raj Saini wrote:
> I am using RAP 1.4M6.
>
>
Re: Adding a command to view's tool bar throws java.lang.IllegalArgumentException: Index out of bou [message #527134 is a reply to message #527073] Wed, 14 April 2010 08:24 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi Raj,
sounds like a bug to me. I filed a bugzilla and will adress the problem soon.

309076: [design] java.lang.IllegalArgumentException when adding
commands to view toolbar
https://bugs.eclipse.org/bugs/show_bug.cgi?id=309076

Thanks for reporting.

Regards Holger


On 2010-04-13 23:40:45 +0200, Raj Saini <rajsaini@gmail.com> said:

> Sorry, I mean RAP 1.3M6
>
> On 14/04/10 01:14, Raj Saini wrote:
>> I am using RAP 1.4M6.


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

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: Adding a command to view's tool bar throws java.lang.IllegalArgumentException: Index out of bou [message #527313 is a reply to message #527134] Wed, 14 April 2010 18:37 Go to previous message
Raj Saini is currently offline Raj SainiFriend
Messages: 53
Registered: July 2009
Member
Thanks Holger. Looking forward to the fix.

On 14/04/10 13:54, Holger Staudacher wrote:
> Hi Raj,
> sounds like a bug to me. I filed a bugzilla and will adress the problem
> soon.
>
> 309076: [design] java.lang.IllegalArgumentException when adding commands
> to view toolbar
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=309076
>
> Thanks for reporting.
>
> Regards Holger
>
>
> On 2010-04-13 23:40:45 +0200, Raj Saini <rajsaini@gmail.com> said:
>
>> Sorry, I mean RAP 1.3M6
>>
>> On 14/04/10 01:14, Raj Saini wrote:
>>> I am using RAP 1.4M6.
>
>
Previous Topic:Using Draw2d canvas in RAP
Next Topic:Text widget in ToolBar
Goto Forum:
  


Current Time: Tue Nov 30 02:00:51 GMT 2021

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

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

Back to the top