Community
Participate
Working Groups
If you specify a control property for the page book, and in the property path you use a parent lookup, "../Foo" the SapphireListControlPageBook will not be able to find the property: java.lang.RuntimeException: Could not find property ../CustomJsps in com.liferay.ide.eclipse.hook.core.model.ICustomJspDir at org.eclipse.sapphire.ui.SapphirePart.resolve(SapphirePart.java:453) at org.eclipse.sapphire.ui.SapphirePart.resolve(SapphirePart.java:437) at org.eclipse.sapphire.ui.SapphirePart.resolve(SapphirePart.java:431) at org.eclipse.sapphire.ui.SapphireListControlledPageBook.render(SapphireListControlledPageBook.java:97) at org.eclipse.sapphire.ui.SapphirePartContainer.render(SapphirePartContainer.java:82) at org.eclipse.sapphire.ui.PageBookPart.render(PageBookPart.java:117) at org.eclipse.sapphire.ui.SapphireWithDirective.render(SapphireWithDirective.java:513) at org.eclipse.sapphire.ui.SapphirePartContainer.render(SapphirePartContainer.java:82) at org.eclipse.sapphire.ui.SapphireComposite.render(SapphireComposite.java:180) at org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsEditorPage$DetailsSection.createSections(MasterDetailsEditorPage.java:1560) at org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsEditorPage$DetailsSection.selectionChanged(MasterDetailsEditorPage.java:1538) at org.eclipse.ui.forms.DetailsPart$1.run(DetailsPart.java:274)
Created attachment 207016 [details] Patch v1 First attempt at patch. Works for List property, don't yet know about Enum controlled pagebook version, haven't tested it.
Review comments on Patch v1: 1. The resolve() function that this logic replaced performed parameter substitution. The new logic must perform parameter substitution as well. 2. Probably should move this block to init() function in SapphireListControlledPageBook just like it is in SapphireEnumControlledPageBook. 3. The invalid path message text is incorrect. It makes a reference to a property editor, but a page book is not a property editor. 4. Contribution headers were not updated.
Created attachment 207075 [details] Patch v2
(In reply to comment #2) > Review comments on Patch v1: > > 1. The resolve() function that this logic replaced performed parameter > substitution. The new logic must perform parameter substitution as well. In this new logic, it eventually calls the super.resolve(...) which looks like it does param substitution. > > 2. Probably should move this block to init() function in > SapphireListControlledPageBook just like it is in > SapphireEnumControlledPageBook. Sure thing, its now moved to init(). > > 3. The invalid path message text is incorrect. It makes a reference to a > property editor, but a page book is not a property editor. Sorry I just blindly copied it, its adjusted now. > > 4. Contribution headers were not updated. Fixed.
Patch accepted with following changes: 1. Fixed logic error in parent nav for more than one parent nav in path. 2. Fixed some instances of incorrect element being used. Probably the most significant were the changes to listening logic necessary in enum controlled page book. Please verify this feature in both page books.
Forgot one more item that I had to change... > In this new logic, it eventually calls the super.resolve(...) which looks like > it does param substitution. This would preclude paths from being provided for substitution. You could only substitute a property name. I fixed the logic to do param substitution before parsing the path.
For the ListControlled pagebook its work correctly. For enum controlled, I'm getting an exception: java.lang.NullPointerException at org.eclipse.sapphire.modeling.ModelElement.read(ModelElement.java:220) at com.liferay.ide.eclipse.hook.core.model.internal.CustomJspDir.read(CustomJspDir.java:120) at org.eclipse.sapphire.modeling.ModelElement.read(ModelElement.java:228) at org.eclipse.sapphire.ui.SapphireEnumControlledPageBook.updateCurrentPage(SapphireEnumControlledPageBook.java:135) at org.eclipse.sapphire.ui.SapphireEnumControlledPageBook.init(SapphireEnumControlledPageBook.java:99) Looking at the code, in line 134, its pulling the local model element once again to find the property instead of using the element that was found when it resolved the model path during init. So if I change line 134 of SapphireEnumControlledPageBook.java to final IModelElement modelElement = this.element; then it seems to work ok.
Try it now.
Looks good.
Thanks. Closing.