Community
Participate
Working Groups
Hy, the FormEditor crash's when i make an addPage(IEditorPart, IEditorInput) and IEditorPart is an FormPage. This can be Tested with the FormsExamples if you change addPage(new FreeFormPage(this)); to addPage(new FreeFormPage(this), getEditorInput()); The Problem seems to be an Missing selection check in MultiPageEditorPart.class:414. Regards Thomas StackTrace: org.eclipse.jface.util.Assert$AssertionFailedException: null argument; at org.eclipse.jface.util.Assert.isNotNull(Assert.java:139) at org.eclipse.jface.util.Assert.isNotNull(Assert.java:116) at org.eclipse.jface.viewers.SelectionChangedEvent.<init>SelectionChangedEvent.jav a:39) at org.eclipse.ui.part.MultiPageEditorPart.pageChangeMultiPageEditorPart.java:442) at org.eclipse.ui.forms.editor.FormEditor.pageChangeFormEditor.java:156) at org.eclipse.ui.forms.editor.FormEditor.setActivePageFormEditor.java:240) at org.eclipse.ui.part.MultiPageEditorPart.createPartControlMultiPageEditorPart.ja va:188) at org.eclipse.ui.internal.PartPane$1.run(PartPane.java:118) at org.eclipse.core.internal.runtime.InternalPlatform.runInternalPlatform.java:638 ) at org.eclipse.core.runtime.Platform.run(Platform.java:497) at rg.eclipse.ui.internal.PartPane.createChildControlPartPane.java:114) at org.eclipse.ui.internal.PartPane.createControl(PartPane.java:230)
We have the same problem as describted and hoped that will be fixed in the next integration build. regards frank
Note however that FormPage by itself was not designed to be a standalone editor - rather a page in the multi-page editor that is added by 'addPage (IFormPage)'. The method you are using is reserved for classes that can be standalone editors by themselves (for example, TextEditor). Can you explain why you need to call this particular method on the IFormPage class?
Because we will create an editor like the plugin.xml editor and with 'addPage (IFormPage)' we must implement all the editor propertyChange handling (isDirty,..) twice. If we can use 'addPage(IFormPage, IEditorInput)' we can write a normal IFormPage an the isDirty Handling is made by the MultiPageEditorPart.
I am afraid I still don't understand the use case. The two methods are there for a reason: addPage(IFormPage) is there to get individual form pages as in plugin.xml multi- page editor (PDE team is currently redesigning the very editor and we are using addPage(IFormPage) for all pages except source). addPage(IEditorPart, IEditorInput) is there for complete standalone editors that need to be added as pages. We use this method to add TextEditor for source pages. I still don't understand why adding IFormPage using the second method?
hy dejan, when i make addPage(IEditorPart, IEditorInput) the MultiPageEditorPart ads an propertyChange Listener to ervery part. When a property is changed in a part the MultiPageEditorPart notifys the workbench for events e.g. isDirty. I will use these logic for my own editors an don't understand the reason to make addPage(IEditorPart) and implement these by self. i will use a formpage as an editorpart with all advantages and not implement the isDirty notification logic in all formpages. if this is not the logic what is the solution for these problem? regards thomas
OK, that's a different story. PDE is now redesigning editors based on Eclipse Forms (you can find the code in CVS HEAD under 'org.eclipse.pde.ui' project in 'srcForms' source folder). You can see there that we fire property changes on the multi-page editor itself, not on the page. The concept was always that form pages are not editors by themselves and they simply reach up to the multi-page editor to notify that they are dirty. If you check the new PDE implementation, you will see that forms mark themselves as dirty, turn around and mark the page dirty, which turns around and marks the editor dirty. No need for property editors. The method 'addPage(IEditorPart, IEditorInput)' is reserved for cases where you take an entire editor written by somebody else and add it as-is. Here it is important that the editor 'feels' normal inside the multi-page editor i.e. all the expected context is there. Form pages, on the other hand, know that they are in the multi-page editor and can always delegate notification to the editor itself.
This defect is fairly old - do you still have a problem with a more recent code?
Closing due to the defect's age.