Hi Janak + Marco
Thank you very much for your answers. They inspired me to go a bit further. I
studied the archive of the developer list a bit more and I think I identified
and solved the problem. It was caused by the following:
I have two visual classes: OuterPanel and InnerPanel, where InnerPanel is
embedded on OuterPanel and responsible for the error. InnerPanel contains some
radio buttons that are connected by a ButtonGroup. The radio buttons we add are
already subclasses of the ULCRadioButton that register a listener fetched from
a static method:
IEventDispatchAction eventHandler;
eventHandler = ActionFactory.getEventDispatchAction();
addActionListener(eventHandler);
Although we made RichDialogActionFactory class available to the remote VM
classpath, it was not initialized properly. As a result the EventDispatchAction
was null.
If I set the SELECTED-property of a RadioButton this seemed to trigger the
registered Action, resulting in a warning on the selected RadioButton. The
warning seemed to be the reason, that OuterPanel could not instantiate
InnerPanel. If I did not set the SELECTED-property on Inner, then it worked.
This must have been caused by the null EventDispatchAction. I fixed this now,
everything is fine.
---> Questions that remain:
- I still get the attached error, when opening InnerPanel. From the editor,
nothing seems to be a problem anymore (bean tree is ok, visual editor is ok,
and the OuterPanel shows the embedded Inner without any trouble just as it
should). Yet still, I HAVE NO IDEA how to interpret an error like this.
- How do I debug from code inside the remote VE (i.e. own widgets, or panel
code)? If I write to System.err or use Log4j, where does that end up?
PS: We are using ULC 6.1.1 and ULC-VE 6.0.
Cheers,
Kaspar
-----Ursprüngliche Nachricht-----
Von: Janak Mulani [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 1. Februar 2007 13:55
An: Kaspar von Gunten
Cc: [email protected]
Betreff: RE: [ULC-developer] Java Beans in Visual Editor, follow up and pictures
Hi Kaspar,
Which version of ULC and ULC VE are you using?
I tried your scenario without any problem. I created two visusal classes.
MyFrame extends ULCFrame and MyBorderLayout extends ULCBorderLayoutPane.
MyBorderLayoutPane has components like buttons, table ect. Then in MyFrame I
add an instance of MyBorderLayoutPane using Choose Beans. I can see
MyBorderlayoutPane in MyFrame without any problems.
Having said this, I do not rule out a possibility of errors. Please see
Known Issues in the release note:
"Editing a contained bean (e.g. MyPanel extends ULCBoxPane) while its
container bean (e.g. MyFrame extends ULCFrame) is open in a visual editor
could cause problems. You must close the container bean's editor while
editing contained bean."
Is something like that happeneing in your case?
Also, you can open the view Windows > Show View > Erro Log - this will show
you the errors that are logged in the .log file in workspace/.metadata/.log.
Before reproducing the error, you should clean up the .log file so that we
only have the log from latest run and not clutter from previous runs.
Can you send me the .log file and your visual classes for the outer bean and
the inner bean?
Thanks and regards,
Janak
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] Behalf Of Kaspar von
>Gunten
>Sent: Thursday, February 01, 2007 11:20 AM
>To: [email protected]
>Subject: [ULC-developer] Java Beans in Visual Editor, follow up and
>pictures
>
>
>Hi this is a follow up on my previous message.
>
>@Alberto: Thanks for your answer, but using empty panels is not an
>option for us, as our clients, who are not programmers, are using the VE
>to create application screens, partially reusing other masks that they
>created before.
>So I still need to resolve this.
>
>@Janak:
>I discovered that an error message is displayed, if I click on the
>erroneous panel in the Beans view, it shows in the status bar.
>
>Problem is: The error message is way too long to fit in there. The mouse
>pointer shows a tool tip, but the text is still to long. How do I get
>the full text of this error and how do I interpret it correctly?
>
>Maybe I should add, that we use an own base template for the creation of
>the panels, which is also attached. It has a few own methods, but none
>of them should be a problem - or is there one?
>
>Earlier I forgot to attach a picture of the encountered error, it is
>attached now. I also attach a picture of the error in the status bar, as
>I cannot get a text output somewhere.
>
>Thanks again for help,
>Kaspar
>
!ENTRY org.eclipse.ve.java.core 4 0 2007-02-01 17:55:38.567
!MESSAGE Exception thrown.
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:514)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObjectForURIFragmentRootSegment(ResourceImpl.java:642)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:692)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:671)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2511)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2439)
at
org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:74)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:1929)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:1833)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:1768)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1576)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:876)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:854)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:626)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:179)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:179)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1089)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:895)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:249)
at
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.demandLoad(ProjectResourceSetImpl.java:83)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:264)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:390)
at
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.getResource(ProjectResourceSetImpl.java:262)
at
org.eclipse.ve.internal.java.codegen.util.VEModelCacheUtility.doLoadFromCache(VEModelCacheUtility.java:103)
at
org.eclipse.ve.internal.java.codegen.core.VEModelInstance.createComposition(VEModelInstance.java:100)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslator.reConnect(JavaSourceTranslator.java:1134)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslator.decodeDocument(JavaSourceTranslator.java:910)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslator.loadModel(JavaSourceTranslator.java:597)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEditorPart$Setup.run(JavaVisualEditorPart.java:1978)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)