public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (!initialized) { myPropComponent.setLabelVisible(false); try { initialized = true; } catch (Exception e) { logger.error("Error detected", e); } } myPropComponent.setForeground(Color.black); myPropComponent.hideBorder(); myPropComponent.setOpaque(false); MessageTable mm = (MessageTable) table; String expr = getAggregateFunction(column); if (expr == null) { setupProp(mm, new Operand(null, "String", null), column); return myPropComponent; } else { try { Operand o = myComponent.getContext().evaluate(expr, myComponent, null, mm.getMessage()); if (o == null) { setText("null"); return this; } else { setupProp(mm, o, column); aggregateValueMap.put(new Integer(column), o); myPropComponent.hideBorder(); return myPropComponent; } } catch (Exception ex) { logger.error("Error detected", ex); setForeground(Color.red); setText("error"); return this; } } }
private final void setupProp(MessageTable mm, Operand val, int column) { if (val != null) { Property p = null; try { p = NavajoFactory.getInstance() .createProperty( null, mm.getColumnId(column), val.type, "", 0, mm.getColumnName(column), Property.DIR_OUT); p.setAnyValue(val.value); } catch (NavajoException ex1) { logger.error("Error detected", ex1); } myPropComponent.setProperty(p); // myPropComponent // logger.debug("TYPE: "+p.getType()+" name: "+p.getName()+" value: "+p.getValue()); } }