/** * Constructs a new {@code ConnectorHierarchyTreeModel} instance. * * @param rootConnector * the connector being the root node of the tree. */ public ConnectorHierarchyTreeModel(ICompositeValueConnector rootConnector) { this.rootConnector = rootConnector; connectorsListener = new TreeConnectorsListener(); checkListenerRegistrationForConnector(rootConnector); addTreeModelListener(this); }
/** * 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); }
/** * Gets connectee value. * * @return the connectee value */ protected final Object getConnecteeValue() { if (getConnectedJComponent() != null) { return protectedGetConnecteeValue(); } else { return value; } }
/** * {@inheritDoc} */ @Override protected void protectedWritabilityChange() { super.protectedWritabilityChange(); getConnectedJComponent().setEditable(isWritable()); } }
/** * {@inheritDoc} */ @Override public void valueChange(ValueChangeEvent evt) { protectedSetConnecteeValue(getConnecteeValue()); } }
@Override public void run() { if (row >= 0 && row < getRowCount()) { fireTableRowsUpdated(row, row); } resetRowSelection(row); } });
private void bindConnector() { collectionConnector .addConnectorValueChangeListener(new TableConnectorListener()); for (int row = 0; row < collectionConnector.getChildConnectorCount(); row++) { bindChildRowConnector(row); } }
/** * {@inheritDoc} */ @Override protected void protectedWritabilityChange() { super.protectedWritabilityChange(); getConnectedJComponent().setEditable(isWritable()); } }
/** * {@inheritDoc} */ public void connectorValueChange(@SuppressWarnings("unused") final ConnectorValueChangeEvent evt) { updateCell(); }
/** * {@inheritDoc} */ public void stateChanged(@SuppressWarnings("unused") ChangeEvent e) { fireConnectorValueChange(); } });
private TreePath getTreePathForConnector(IValueConnector connector) { return ConnectorTreeHelper.getTreePathForConnector(rootConnector, connector); } }
/** * Constructs a new {@code DefaultTreeSelectionModelBinder} instance. */ public DefaultTreeSelectionModelBinder() { genericSelectionModelListener = new SelectionModelListener(); }
/** * {@inheritDoc} */ public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { fireConnectorValueChange(); } });
/** * {@inheritDoc} */ @Override public boolean areChildrenReadable() { return isReadable(); }
/** * {@inheritDoc} */ @Override public void run() { protectedReadabilityChange(); } });
/** * {@inheritDoc} */ @Override public void run() { protectedWritabilityChange(); } });
/** * Constructs a new <code>ConnectorHierarchyTreeModel</code> instance. * * @param rootConnector * the connector being the root node of the tree. */ public ConnectorHierarchyTreeModel(ICompositeValueConnector rootConnector) { this.rootConnector = rootConnector; connectorsListener = new TreeConnectorsListener(); checkListenerRegistrationForConnector(rootConnector); addTreeModelListener(this); }
/** * 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); }
/** * {@inheritDoc} */ public void propertyChange(@SuppressWarnings("unused") final PropertyChangeEvent evt) { updateCell(); }