* the GUI to indicate its presence
*/
private void addComponent(CellComponentFactorySPI spi) {
// Fetch the default server state for the factory, and cell id. Make
// sure we make it dynamically added
CellComponentServerState state = spi.getDefaultCellComponentServerState();
CellID cellID = selectedCell.getCellID();
// Send a ADD component message on the cell channel. Wait for a
// response. If OK, then update the GUI with the new component.
// Otherwise, display an error dialog box.
CellServerComponentMessage message =
CellServerComponentMessage.newAddMessage(cellID, state);
ResponseMessage response = selectedCell.sendCellMessageAndWait(message);
if (response == null) {
// log and error and post a dialog box
LOGGER.warning("Received a null reply from cell with id " +
selectedCell.getCellID() + " with name " +
selectedCell.getName() + " adding component.");
return;
}
if (response instanceof CellServerComponentResponseMessage) {
// If successful, add the component to the GUI by refreshing the
// Cell that is selected.
setSelectedCell(selectedCell);
PropertiesManager manager = PropertiesManager.getPropertiesManager();
PropertiesFactorySPI prop = manager.getPropertiesByClass(state.getClass());
capabilityList.setSelectedValue(prop.getDisplayName(),true);
}
else if (response instanceof ErrorMessage) {
// Log an error. Eventually we should display a dialog
LOGGER.log(Level.WARNING, "Unable to add component to the server: " +