egovconcepts / jacp

Automatically exported from code.google.com/p/jacp
0 stars 0 forks source link

check duplicate children added in AFXComponentWorker #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
For handleAdd() in AFXComponentWorker, I suggest should check "duplicate 
children add" to prevent Runtime Exception. Such as addComponentByType() in 
FXWorkbenchHander does. 

    private void handleAdd(final Node validContainer, final Node uiComponent,
            final String name) {
        if (validContainer != null && uiComponent != null) {
            this.handleViewState(uiComponent, true);
            final ObservableList<Node> children = FXUtil
                    .getChildren(validContainer);
            children.add(uiComponent); // some time will Throw  "duplicate children add" Exception
        }

    }

Original issue reported on code.google.com by markench...@gmail.com on 9 May 2012 at 6:18