[ 
https://issues.apache.org/jira/browse/WICKET-3112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922165#action_12922165
 ] 

Korbinian Bachl commented on WICKET-3112:
-----------------------------------------

@Mike:

dont know what happens here, just rechecked it:

svn co http://svn.apache.org/repos/asf/wicket/branches/wicket-1.4.x wicket-1.4.x

then open in IDEA and apply patch (IDEA grabs correct revision by itself from 
SVN)

then patch is applied, all well, but lines 801 - 807 want a parentItem that is 
never defined, see here (whole function):

(start-lini is: 772)

public final void treeNodesChanged(TreeModelEvent e)
        {
                if (dirtyAll)
                {
                        return;
                }
                // has root node changed?
                if (e.getChildren() == null)
                {
                        if (rootItem != null)
                        {
                                invalidateNode(rootItem.getModelObject(), true);
                        }
                }
                else
                {
                        // go through all changed nodes
                        Object[] children = e.getChildren();
                        if (children != null)
                        {
                                for (Object node : children)
                                {
                                        if (isNodeVisible(node))
                                        {
                                                // if the nodes is visible 
invalidate it
                                                invalidateNode(node, true);
                                        }
                                }
                        }

                        if (!parentItem.hasChildTreeItems())
                        {
                                // rebuild parent's icon to show it no longer 
has children
                                invalidateNode(parentNode, true);
                        }

                }
        }

> Fix of issue 2886 breaks all individual implementations of any AbstractTree
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-3112
>                 URL: https://issues.apache.org/jira/browse/WICKET-3112
>             Project: Wicket
>          Issue Type: Sub-task
>          Components: wicket
>    Affects Versions: 1.4.11, 1.4.12
>         Environment: any wicket 1.4 app
>            Reporter: Korbinian Bachl
>            Assignee: Martin Grigorov
>            Priority: Blocker
>         Attachments: WICKET-3112.patch, WICKET-3112.patch, 
> WICKET-3122-fix.patch
>
>
> AbstratTree was originally written againt pure interfaces and not relies on a 
> special Class, namely the javax.swing.tree.TreeNode. This breaks all custom 
> tree's out there like e.g. the one in the brix project. 
> A workaround to this problem I tried was unsuccessful as the problem is that 
> many parts of AbstratTree are final and can't be easily overwritten and that 
> many other projects epen on Abstrattree like the inmethod grid stuff and much 
> more. This means that any special Nodes for trees can't be implemented 
> anymore, making this a ultimate stopper for all projects rlying on some 
> special nodes. IMHO 2886 should be reverted and then looked upon a differnet 
> patch for this solution that doesn't break everything out there. 
> Example from default Brxix 1.2.3-SNAPSHOT:
> java.lang.ClassCastException: brix.plugin.menu.editor.MenuTreeNode
> cannot be cast to javax.swing.tree.TreeNode
>         at
> org.apache.wicket.markup.html.tree.AbstractTree.treeNodesInserted(AbstractTree.java:
> 823)
>         at
> brix.web.tree.AbstractTreeModel.nodeInserted(AbstractTreeModel.java:
> 138)
>         at brix.plugin.menu.editor.MenuEditor$5.onClick(MenuEditor.java:194)
>         at org.apache.wicket.ajax.markup.html.AjaxLink
> $1.onEvent(AjaxLink.java:68)
>         at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:
> 177)
>         at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:
> 300)
>         at
> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:
> 119) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to