Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My solution</p> <pre><code>Apparently there is no way to directly get at the Tree structure altered by Drag and Drop. I reasoned that TreePanelView = TreePanel.getView() might have the Drag and Drop chaanges. By examining TreePanelView in the debugger after a drag and drop I devise this solution: /* * These 'My' classes are used to access the internal tree within TreePanelView. * The internal tree reflects Drag and Drop activity, * which is NOT reflected in the TreeStore. */ private class MyTreePanel&lt;M extends ModelData&gt; extends TreePanel&lt;M&gt; { public MyTreePanel(TreeStore&lt;M&gt; ts) { super(ts); view = new MyView&lt;M&gt;(); view.bind(this, store); } public MyView&lt;M&gt; getMyView() { return (MyView&lt;M&gt;) getView(); } } private class MyView&lt;M extends ModelData&gt; extends TreePanelView&lt;M&gt; { public MyTreeStore&lt;M&gt; getTreeStore() { return (MyTreeStore&lt;M&gt;) this.treeStore; } } private class MyTreeStore&lt;M extends ModelData&gt; extends TreeStore&lt;M&gt; { public MyTreeStore() { super(); } public Map&lt;M, TreeModel&gt; getModelMap() { return modelMap; } } To extract the tree altered by Drag and Drop: MyTreePanel&lt;ModelData&gt; myTree; //Initialize the TreeStore appropriately // After Drag and Drop activity, get the altered tree thusly: Map&lt;ModelData, TreeModel&gt; viewMap = myTree.getMyView().getTreeStore().getModelMap(); The TreeModel in viewMap is actually a BaseTreeModel. The ModelData are the objects I originally loaded into TreeStore. I had to: 1 - Iterate over viewMap, extract "id" from BaseTreeModel and create a reverse map, indexed by "id" and containing my ModelData objects. 2 - Fetch root BaseTreeModel node from viewMap using root ModelData of original tree. 3 - Walk the BaseTreeModel tree. At each node, fetched ModelData objects by "id" from the reverse map. In this way I reconstructed the tree altered by Drag and Drop. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload