From: Andy D. <an...@ma...> - 2004-06-03 18:02:43
|
I'm not sure if this is a bug, or if I am just using spring-rcp wrong, but it appears that if you place a DefaultVisualAction that defines an icon and a Mnemonic on a toolbar you will get an IllegalArgumentException. In my case, I used a DefaultVisualAction in my spring xml and the ApplicationObjectConfigurer to actually set the icon and text. I'm not sure yet exactly which one of my visual actions is causing the error, I'm assuming it is the first one encountered. Here is the definition: <bean id="editAction" class="org.springframework.rcp.action.DefaultVisualAction"> </bean> Here are the appropriate lines from my resource .properties files: editAction.label=Ed&it Entity...@ctrl E editAction.caption=Edits the currently selected entity editAction.icon=misc/edtsrclkup_co.gif Here is the stack trace from the error: Exception in thread "main" java.lang.IllegalArgumentException: index == 2 at javax.swing.AbstractButton.setDisplayedMnemonicIndex(AbstractButton.java:1450) at org.springframework.rcp.action.AbstractVisualAction.createToolBarButton(AbstractVisualAction.java:196) at org.springframework.rcp.action.contribution.ActionContributionItem.createToolBarControl(ActionContributionItem.java:55) at org.springframework.rcp.action.contribution.ToolBar.update(ToolBar.java:71) at org.springframework.rcp.action.contribution.ToolBar.createToolBar(ToolBar.java:49) at org.springframework.rcp.action.contribution.ToolBar.getControl(ToolBar.java:40) at org.springframework.rcp.application.ApplicationWindow.buildToolBarPanel(ApplicationWindow.java:171) at org.springframework.rcp.application.ApplicationWindow.createWindowControl(ApplicationWindow.java:153) at org.springframework.rcp.application.ApplicationWindow.openPage(ApplicationWindow.java:127) at org.springframework.rcp.application.Application.openMainConsoleWindow(Application.java:372) ... |