Index out of bounds error editing properties of custom bean

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Index out of bounds error editing properties of custom bean

Postby markm » Fri Jul 01, 2005 12:06 pm

I added a custom bean to the Custom palette. I can drop the bean on the design surface with no problem. But when I edit any property of the bean, I get an "internal error" popup message. The log has the following error. I am using Swing designer 3.0.1 with WSAD 5.1.2. I also noticed tons of "java.lang.NoClassDefFoundError: javax.swing.JSpinner' in the log, but that does not appear to be the problem with my custom bean.

!ENTRY org.eclipse.jface 4 2 Jul 01, 2005 16:01:19.64
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java)
at java.util.ArrayList.RangeCheck(ArrayList.java)
at java.util.ArrayList.get(ArrayList.java)
at org.eclipse.jdt.core.dom.DesignerAST.parseExpression(DesignerAST.java:208)
at com.swtdesigner.model.util.ast.ASTEditor.replaceExpression(ASTEditor.java:1852)
at com.swtdesigner.model.util.ast.ASTEditor.replaceExpression(ASTEditor.java:1824)
at com.swtdesigner.model.accessor.ArgumentOfConstructorAccessor.setExpression(ArgumentOfConstructorAccessor.java:109)
at com.swtdesigner.model.properties.GenericProperty.changeValueUsingAccessor(GenericProperty.java:319)
at com.swtdesigner.model.properties.GenericProperty.setValue(GenericProperty.java:275)
at com.swtdesigner.properties.editors.StringComboPropertyEditor.setPropertyValue(StringComboPropertyEditor.java:16)
at com.swtdesigner.properties.editors.AbstractComboPropertyEditor.setPropertyValue(AbstractComboPropertyEditor.java:127)
at com.swtdesigner.properties.editors.AbstractComboPropertyEditor.deactivate(AbstractComboPropertyEditor.java:74)
at com.swtdesigner.properties.table.PropertyTable.hideEditor(PropertyTable.java:547)
at com.swtdesigner.properties.table.PropertyTable.hideEditor(PropertyTable.java:536)
at com.swtdesigner.properties.table.PropertyTable.init(PropertyTable.java)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.refreshSelectedWidget(DesignerEditorPropertyComposite.java)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite$2.selectionChanged(DesignerEditorPropertyComposite.java:208)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java)
at org.eclipse.core.runtime.Platform.run(Platform.java)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1290)
at org.eclipse.jface.viewers.StructuredViewer.handleInvalidSelection(StructuredViewer.java:625)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:813)
at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:721)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:238)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:991)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.updatePropertyComposite(DesignerEditorPropertyComposite.java:666)
at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(DesignerEditor.java:967)
at com.swtdesigner.gef.DesignerEditor.editsDiscarded(DesignerEditor.java:1825)
at com.swtdesigner.model.util.ast.ASTEditor.fireEditsDiscarded(ASTEditor.java:2477)
at com.swtdesigner.model.util.ast.ASTEditor.endEdit(ASTEditor.java)
at com.swtdesigner.model.util.ast.ASTEditor.endEdit(ASTEditor.java)
at com.swtdesigner.model.util.ast.ASTEditor.endEdit(ASTEditor.java)
at com.swtdesigner.model.JavaInfo.endEdit(JavaInfo.java:830)
at com.swtdesigner.model.properties.GenericProperty.setValue(GenericProperty.java:284)
at com.swtdesigner.properties.editors.StringComboPropertyEditor.setPropertyValue(StringComboPropertyEditor.java:16)
at com.swtdesigner.properties.editors.AbstractComboPropertyEditor.setPropertyValue(AbstractComboPropertyEditor.java:127)
at com.swtdesigner.properties.editors.AbstractComboPropertyEditor.handleEnter(AbstractComboPropertyEditor.java:115)
at com.swtdesigner.properties.editors.AbstractComboPropertyEditor$1.widgetSelected(AbstractComboPropertyEditor.java:29)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java)
at com.swtdesigner.controls.CCombo.listEvent(CCombo.java:763)
at com.swtdesigner.controls.CCombo$1.handleEvent(CCombo.java:110)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:207)
at java.lang.reflect.Method.invoke(Method.java:271)
at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
markm
 

Opps, I meant 4.0.1

Postby markm » Fri Jul 01, 2005 12:09 pm

Using designer 4.0.1 with WSAD 5.1.2 (not 3.0.1). Should I back up and try the 4.0.0 version?
markm
 

More details

Postby markm » Fri Jul 01, 2005 12:29 pm

OK, after some more experimentation I find:

1. Same problem with the 4.0.0 release.
2. Error happens only if I drop the custom bean into a GridBagLayout panel and then try to change a layout constraint (e.g. set fill to "both"). If I drop into a panel with Border layout, it seems to work fine.

Side note: The 4.0.1 release is missing a lot of the Swing layouts. The Layouts pallet only shows 3 or 4 (it is missing GridBag, for example). The 4.0.0 Layouts palette shows many more. I got a GridBag in the 4.0.1 by altering my source code.
markm
 

Re: More details

Postby Eric Clayberg » Fri Jul 01, 2005 5:01 pm

markm wrote:1. Same problem with the 4.0.0 release.
2. Error happens only if I drop the custom bean into a GridBagLayout panel and then try to change a layout constraint (e.g. set fill to "both"). If I drop into a panel with Border layout, it seems to work fine.

Can you send us a test case? The exception seems to indicate a problem unique to the custom component you are using or the window you are editing.

markm wrote:Side note: The 4.0.1 release is missing a lot of the Swing layouts. The Layouts pallet only shows 3 or 4 (it is missing GridBag, for example). The 4.0.0 Layouts palette shows many more. I got a GridBag in the 4.0.1 by altering my source code.

The 4.0.1 release is not missing any Swing layouts. What you describe above indicates that you are using the free edition of Swing Designer rather than the pro edition. The free edition does indeed surface a limited set of Swing layout managers.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby markm » Tue Jul 05, 2005 6:01 am

I'll see if I can produce a test case. This particular bean has tons of app-specific code I will need to strip out to make a standalone test case.

As for the layout managers, maybe I picked the wrong choices when I installed, but I did get and use an evaluation activation code.

-Mark
markm
 

Postby Eric Clayberg » Tue Jul 05, 2005 6:45 am

markm wrote:As for the layout managers, maybe I picked the wrong choices when I installed, but I did get and use an evaluation activation code.

Which product did you activate - Swing Designer or SWT Designer? What was your activation key?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby mcmillan » Fri Jul 22, 2005 5:57 am

All these problems seem to have gone away with the latest 4.1.1 build..

Thanks!
mcmillan
 


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest