From: Keith D. <kd...@cs...> - 2004-06-04 23:25:58
|
Andy, That is indeed a bug. I just committed a fix. By default, the ToolBar contribution item manager, acting as a factory for toolbar buttons, will configure the buttons to only have text if the configured icon is null. This is generally what you want; however, the createToolBarButton() method was still trying to set the text's mnemonic even when there was an icon set, resulting in the index out of bounds exception. I changed it to only set the mnemonic if the text is configured on the button, which only happens when the action's icon is null. Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Andy Depue Sent: Thursday, June 03, 2004 2:03 PM To: spr...@li... Subject: [Springframework-rcp-dev] Possible bug 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:145 0) at org.springframework.rcp.action.AbstractVisualAction.createToolBarButton(Abst ractVisualAction.java:196) at org.springframework.rcp.action.contribution.ActionContributionItem.createToo lBarControl(ActionContributionItem.java:55) at org.springframework.rcp.action.contribution.ToolBar.update(ToolBar.java:71) at org.springframework.rcp.action.contribution.ToolBar.createToolBar(ToolBar.ja va:49) at org.springframework.rcp.action.contribution.ToolBar.getControl(ToolBar.java: 40) at org.springframework.rcp.application.ApplicationWindow.buildToolBarPanel(Appl icationWindow.java:171) at org.springframework.rcp.application.ApplicationWindow.createWindowControl(Ap plicationWindow.java:153) at org.springframework.rcp.application.ApplicationWindow.openPage(ApplicationWi ndow.java:127) at org.springframework.rcp.application.Application.openMainConsoleWindow(Applic ation.java:372) ... ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Springframework-rcp-dev mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev |