/** * {@inheritDoc} */ @Override public void bindSelectionModel(IValueConnector rootConnector, JTree tree) { tree.getSelectionModel().addTreeSelectionListener( genericSelectionModelListener); TreeConnectorsListener connectorsListener = new TreeConnectorsListener( rootConnector, tree.getSelectionModel()); tree.getModel().addTreeModelListener(connectorsListener); }
/** * {@inheritDoc} */ public void treeStructureChanged(TreeModelEvent e) { checkListenerRegistrationForConnector((ICollectionConnectorListProvider) e .getTreePath().getLastPathComponent()); }
/** * Constructs a new <code>TreeConnectorsListener</code> instance. * * @param rootConnector * the root connector of the connector hierarchy. * @param selectionModel * the selection model of the related tree. */ public TreeConnectorsListener(IValueConnector rootConnector, TreeSelectionModel selectionModel) { connectorsSelectionListener = new CollectionConnectorsSelectionListener( rootConnector, selectionModel); checkListenerRegistrationForConnector((ICollectionConnectorListProvider) rootConnector); }
/** * Constructs a new {@code TreeConnectorsListener} instance. * * @param rootConnector * the root connector of the connector hierarchy. * @param selectionModel * the selection model of the related tree. */ public TreeConnectorsListener(IValueConnector rootConnector, TreeSelectionModel selectionModel) { connectorsSelectionListener = new CollectionConnectorsSelectionListener( rootConnector, selectionModel); checkListenerRegistrationForConnector((ICollectionConnectorListProvider) rootConnector); }
private void checkListenerRegistrationForConnector( ICollectionConnectorListProvider nodeConnector) { for (ICollectionConnector childNodeConnector : nodeConnector .getCollectionConnectors()) { childNodeConnector .addSelectionChangeListener(connectorsSelectionListener); for (int i = 0; i < childNodeConnector.getChildConnectorCount(); i++) { checkListenerRegistrationForConnector((ICollectionConnectorListProvider) childNodeConnector .getChildConnector(i)); } } }
/** * {@inheritDoc} */ @Override public void treeStructureChanged(TreeModelEvent e) { checkListenerRegistrationForConnector((ICollectionConnectorListProvider) e .getTreePath().getLastPathComponent()); }
/** * {@inheritDoc} */ public void treeNodesInserted(TreeModelEvent e) { checkListenerRegistrationForConnector((ICollectionConnectorListProvider) e .getTreePath().getLastPathComponent()); }
/** * {@inheritDoc} */ @Override public void treeNodesInserted(TreeModelEvent e) { checkListenerRegistrationForConnector((ICollectionConnectorListProvider) e .getTreePath().getLastPathComponent()); }
/** * {@inheritDoc} */ public void bindSelectionModel(IValueConnector rootConnector, JTree tree) { tree.getSelectionModel().addTreeSelectionListener( genericSelectionModelListener); TreeConnectorsListener connectorsListener = new TreeConnectorsListener( rootConnector, tree.getSelectionModel()); tree.getModel().addTreeModelListener(connectorsListener); }