Community
Participate
Working Groups
Created attachment 268604 [details] blank tree-view I am working on an eclipse-plugin which makes use of a custom XMLMultiPageEditor by extending XMLMultiPageEditorPart and XMLTableTreeView by extending XMLTableTreeViewer the second one as well implements a IResourceChangeListener. I provide this plugin in eclipse-mars and eclipse-neon, however the wired behavior only shows up in eclipse-neon. The editor works fine so far, the only problem is, that the tree-view at the beginning is completely blank when a related xml-document is opened with it. I can even modify the document in the source-view and save it .. the tree-view stays blank. The only events which bring the tree-view to life are: -- re-size the editor-window with the mouse -- open some other document and than switch back to the tab of the open xml-doc. After that, the tree-view works like it should. If I now change the xml in the source-view, the tree-view is updated immediately.
Please attach a self contained snippet or project demonstrating the problem. Most likely (I guess) this is layout related. If you have somewhere explicit calls to layout the tree try to play with that code a bit. May be using requestLayout() instead helps.
requestLayout() did not change anything .. however using the class "Control" was a good hint. I tried many of it's methods, and I finally found a method which allows me to fix the problem: ... public class MyXMLTableTreeViewer extends XMLTableTreeViewer implements IResourceChangeListener{ .... public MyXMLTableTreeViewer(Composite parent, IEditorPart parentEditor) { super(parent); .... Point size = getControl().getSize(); ConsoleHandler.printMessage("size.y " + Integer.toString(size.y), true); ConsoleHandler.printMessage("size.x " + Integer.toString(size.x), true); size.x = 1000; getControl().setSize(size); } ... The console-output when I run the plugin: size.y 0 size.x 0 It seems to be sufficient to only set x to some value ... 10 already gives an image, but the "node" section than looks a bit pressed So the problem seems to be, that the x/y size of the tree-view has bad init-values, which need to adjusted before use. Is that code-snippet sufficient for you ? If not, I will try to create a small demonstration project. The current one is just to big to boil it down.
(In reply to Alexander Schwinn from comment #2) > Is that code-snippet sufficient for you ? If not, I will try to create a > small demonstration project. This would be really good.
Created attachment 268628 [details] Minimal Plugin-Project to Demonstrate the bug Ok, here we go -Plugin-Project added- - The bug as well shows up if I use the eclipse "XMLTableTreeViewer" instead of extending it. - I added a file "demoTestfile.myxml" for which the editor has a contentTypeBinding ( configured in plugin.xml ) ... needs to be moved to some empty project in the runtime-workspace once it got created - Just comment/uncomment 3 lines in MyXMLTableTreeViewer.java to toggle between bug fixed/unfixed
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
reopened, since I still can reproduce