/** * {@inheritDoc} */ @Override public boolean isCellEditable(Object node, int columnIndex) { if (node instanceof ICompositeValueConnector && !(node instanceof ICollectionConnector)) { ((ICompositeValueConnector) node).getChildConnector(columnConnectorKeys .get(columnIndex)); } return false; }
private void checkListenerRegistrationForConnector(IValueConnector connector) { if (connector != null) { // we can add the listener many times since the backing store listener // collection is a Set. connector.addConnectorValueChangeListener(connectorsListener); if (connector instanceof ICompositeValueConnector) { for (String childConnectorId : ((ICompositeValueConnector) connector) .getChildConnectorKeys()) { checkListenerRegistrationForConnector(((ICompositeValueConnector) connector) .getChildConnector(childConnectorId)); } } } }
/** * {@inheritDoc} */ @Override public void register(IRemotePeer remotePeer) { remotePeerRegistry.register(remotePeer); if (remotePeer instanceof ICompositeValueConnector) { for (String childKey : ((ICompositeValueConnector) remotePeer).getChildConnectorKeys()) { IValueConnector childConnector = ((ICompositeValueConnector) remotePeer).getChildConnector(childKey); register((IRemotePeer) childConnector); } } }
private IValueConnector getConnectorAt(int rowIndex, int columnIndex) { return ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(columnConnectorKeys .get(columnIndex)); }
private void checkListenerRegistrationForConnector(IValueConnector connector) { if (connector != null) { // we can add the listener many times since the backing store listener // collection is a Set. connector.addConnectorValueChangeListener(connectorsListener); if (connector instanceof ICompositeValueConnector) { for (String childConnectorId : ((ICompositeValueConnector) connector) .getChildConnectorKeys()) { checkListenerRegistrationForConnector(((ICompositeValueConnector) connector) .getChildConnector(childConnectorId)); } } } }
/** * Gets the value connector backing the table cell. * * @param rowIndex * the row index of the cell. * @param columnIndex * the column index of the cell. * @return the value connector behind the cell. */ private IValueConnector getConnectorAt(int rowIndex, int columnIndex) { return ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(columnConnectorKeys .get(columnIndex)); }
private void checkListenerRegistrationForConnector(IValueConnector connector) { if (connector != null) { // we can add the listener many times since the backing store listener // collection is a Set. connector.addConnectorValueChangeListener(connectorsListener); if (connector instanceof ICompositeValueConnector) { for (String childConnectorId : ((ICompositeValueConnector) connector) .getChildConnectorKeys()) { checkListenerRegistrationForConnector(((ICompositeValueConnector) connector) .getChildConnector(childConnectorId)); } } } }
/** * Gets the value connector backing the table cell. * * @param rowIndex * the row index of the cell. * @param columnIndex * the column index of the cell. * @return the value connector behind the cell. */ private IValueConnector getConnectorAt(int rowIndex, int columnIndex) { return ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(columnConnectorKeys .get(columnIndex)); }
private void checkListenerRegistrationForConnector(IValueConnector connector) { if (connector != null) { // we can add the listener many times since the backing store listener // collection is a Set. connector.addValueChangeListener(connectorsListener); if (connector instanceof ICompositeValueConnector) { for (String childConnectorId : ((ICompositeValueConnector) connector) .getChildConnectorKeys()) { checkListenerRegistrationForConnector(((ICompositeValueConnector) connector) .getChildConnector(childConnectorId)); } } } }
/** * Gets the value connector backing the table cell. * * @param rowIndex * the row index of the cell. * @param columnIndex * the column index of the cell. * @return the value connector behind the cell. */ private IValueConnector getConnectorAt(int rowIndex, int columnIndex) { return ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(columnConnectorKeys .get(columnIndex)); }
private void checkListenerRegistrationForConnector(IValueConnector connector) { if (connector != null) { // we can add the listener many times since the backing store listener // collection is a Set. connector.addValueChangeListener(connectorsListener); if (connector instanceof ICompositeValueConnector) { for (String childConnectorId : ((ICompositeValueConnector) connector) .getChildConnectorKeys()) { checkListenerRegistrationForConnector(((ICompositeValueConnector) connector) .getChildConnector(childConnectorId)); } } } }
/** * Gets the value connector backing the table cell. * * @param rowIndex * the row index of the cell. * @param columnIndex * the column index of the cell. * @return the value connector behind the cell. */ private IValueConnector getConnectorAt(int rowIndex, int columnIndex) { return ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(columnConnectorKeys .get(columnIndex)); }
private void bindChildren(ICompositeValueConnector viewConnector, ICompositeValueConnector modelConnector) { for (String nextChildConnectorKey : viewConnector.getChildConnectorKeys()) { IValueConnector nextChildViewConnector = viewConnector.getChildConnector(nextChildConnectorKey); if (modelConnector != null) { IValueConnector nextChildModelConnector = modelConnector.getChildConnector(nextChildConnectorKey); if (nextChildModelConnector == null) { throw new MissingConnectorException("Missing model connector for key " + nextChildConnectorKey); } bind(nextChildViewConnector, nextChildModelConnector); } else { bind(nextChildViewConnector, null); } } } }
/** * {@inheritDoc} */ public Object getValueAt(Object node, int column) { if (node instanceof ICompositeValueConnector && !(node instanceof ICollectionConnector)) { IValueConnector cellConnector = ((ICompositeValueConnector) node) .getChildConnector(columnConnectorKeys.get(column)); if (cellConnector instanceof ICompositeValueConnector) { return cellConnector.toString(); } else if (cellConnector.getConnectorValue() instanceof byte[]) { return null; } return cellConnector.getConnectorValue(); } return null; }
/** * {@inheritDoc} */ @Override public void unregister(String guid) { IRemotePeer remotePeer = getRegistered(guid); remotePeerRegistry.unregister(guid); if (remotePeer instanceof ICompositeValueConnector) { for (String childKey : ((ICompositeValueConnector) remotePeer).getChildConnectorKeys()) { unregister(((IRemotePeer) ((ICompositeValueConnector) remotePeer).getChildConnector(childKey)).getGuid()); } } }
/** * Gets the value to display as cell font. * * @param rowIndex * the row index to compute the font for. * @param fontProperty * the property used to compute the font. * @return the cell font or null. */ public String getCellFont(int rowIndex, String fontProperty) { IValueConnector fontConnector = ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(fontProperty); if (fontConnector != null && fontConnector.getConnectorValue() != null) { return fontConnector.getConnectorValue().toString(); } return null; }
/** * Gets the value to display as row font. * * @param rowIndex * the row index to compute the font for. * @return the row font or null. */ public String getRowFont(int rowIndex) { if (getRowFontProperty() != null) { IValueConnector fontConnector = ((ICompositeValueConnector) collectionConnector .getChildConnector(rowIndex)).getChildConnector(getRowFontProperty()); if (fontConnector != null && fontConnector.getConnectorValue() != null) { return fontConnector.getConnectorValue().toString(); } } return null; }
private void bindChildRowConnector(int row) { ICompositeValueConnector rowConnector = (ICompositeValueConnector) collectionConnector .getChildConnector(row); rowConnector .addConnectorValueChangeListener(getChildRowConnectorListener(row)); for (int col = 0; col < columnConnectorKeys.size(); col++) { IValueConnector cellConnector = rowConnector .getChildConnector(columnConnectorKeys.get(col)); if (cellConnector instanceof IRenderableCompositeValueConnector && ((IRenderableCompositeValueConnector) cellConnector) .getRenderingConnector() != null) { ((IRenderableCompositeValueConnector) cellConnector) .getRenderingConnector().addConnectorValueChangeListener( getChildCellConnectorListener(row, col)); } else { CellConnectorListener listener = getChildCellConnectorListener(row, col); cellConnector.addConnectorValueChangeListener(listener); cellConnector.addPropertyChangeListener(listener); } } }
private void bindChildRowConnector(int row) { ICompositeValueConnector rowConnector = (ICompositeValueConnector) collectionConnector .getChildConnector(row); rowConnector .addValueChangeListener(getChildRowConnectorListener(row)); for (int col = 0; col < columnConnectorKeys.size(); col++) { IValueConnector cellConnector = rowConnector .getChildConnector(columnConnectorKeys.get(col)); if (cellConnector instanceof IRenderableCompositeValueConnector && ((IRenderableCompositeValueConnector) cellConnector) .getRenderingConnector() != null) { ((IRenderableCompositeValueConnector) cellConnector) .getRenderingConnector().addValueChangeListener( getChildCellConnectorListener(row, col)); } else { CellConnectorListener listener = getChildCellConnectorListener(row, col); cellConnector.addValueChangeListener(listener); cellConnector.addPropertyChangeListener(listener); } } }
private void bindChildRowConnector(int row) { ICompositeValueConnector rowConnector = (ICompositeValueConnector) collectionConnector .getChildConnector(row); if (rowConnector != null && !rowConnector.getValueChangeListeners().contains(rowListener)) { rowConnector.addValueChangeListener(rowListener); for (String columnConnectorKey : columnConnectorKeys) { IValueConnector cellConnector = rowConnector .getChildConnector(columnConnectorKey); if (cellConnector instanceof IRenderableCompositeValueConnector && ((IRenderableCompositeValueConnector) cellConnector) .getRenderingConnector() != null) { ((IRenderableCompositeValueConnector) cellConnector) .getRenderingConnector().addValueChangeListener(cellListener); } else { cellConnector.addValueChangeListener(cellListener); cellConnector.addPropertyChangeListener(cellListener); } } } }