@Override public void setPropertyValue(Object value) { if (value != null && value instanceof JRLineBox) { ModelUtils.applyBoxProperties(container.getLineBox(), (JRLineBox)value); // Check if we are able to fire an event.... try { Method m = container.getClass().getMethod("getEventSupport", new Class[]{}); if (m != null) { JRPropertyChangeSupport support = (JRPropertyChangeSupport) m.invoke(container, new Object[]{}); support.firePropertyChange("linebox", null, value); } } catch (Exception ex) { ex.printStackTrace(); } } }
@Override public void propertyChange(final PropertyChangeEvent evt) { final AMCollection section = getSection(); if (section != null) { if (evt.getPropertyName().equals(section.getCellEvent())) { if (evt.getSource() == this.getValue()) { final StandardBaseColumn bc = (StandardBaseColumn) evt .getSource(); final ANode parent = (ANode) getParent(); final MColumn child = this; final int newIndex = parent.getChildren().indexOf(this); parent.removeChild(child); section.createColumn(parent, bc, 122, newIndex); MTable mtable = (MTable) section.getParent(); if (mtable == null){ ((JRPropertyChangeSupport)evt.getSource()).removePropertyChangeListener(child); } else { mtable.getTableManager().refresh(); TableColumnNumerator.renumerateColumnNames(mtable); parent.propertyChange(evt); } } } } super.propertyChange(evt); }
private JRPropertyChangeSupport getEventSupport(JRElementGroup container) { if (container instanceof JRDesignElementGroup) { return ((JRDesignElementGroup)container).getEventSupport(); } else if (container instanceof JRDesignFrame) { return ((JRDesignFrame)container).getEventSupport(); } return null; }