@Override protected void onDetach() { getTarget().children().clear(); myPopupManager.dispose(); myContext.unregister(this); super.onDetach(); }
@Override protected void onAttach(MappingContext ctx) { super.onAttach(ctx); myContext.register(this); if (isAutoChildManagement()) { myChildMappers = createChildList(); ObservableList<Cell> children = getSource().children(); for (int i = 0; i < children.size(); i++) { childAdded(i, children.get(i)); } } myPopupManager = createPopupManager(); myPopupManager.attach(getSource()); refreshProperties(); }
void childAdded(int index, Cell child) { if (!isAutoChildManagement()) return; BaseCellMapper<? extends Cell, ? extends View> mapper = myContext.apply(child); getTarget().children().add(index, mapper.getTarget()); myChildMappers.add(index, mapper); }