use of de.janrufmonitor.ui.jface.application.rendering.ITableAttributeCellEditorRenderer in project janrufmonitor by tbrandt77.
the class TableCellModifier method modify.
public void modify(Object element, String column, Object value) {
if (element instanceof Item)
element = ((Item) element).getData();
ITableCellRenderer r = RendererRegistry.getInstance().getRenderer(column);
if (r instanceof ITableAttributeCellEditorRenderer && ((ITableAttributeCellEditorRenderer) r).getAttribute() != null) {
if (element instanceof ICall) {
ICall c = ((ICall) element);
IAttribute cAtt = c.getAttribute(((ITableAttributeCellEditorRenderer) r).getAttribute().getName());
if (cAtt != null && value instanceof String) {
if (cAtt.getValue().equalsIgnoreCase((String) value)) {
return;
}
}
IAttribute att = ((ITableAttributeCellEditorRenderer) r).getAttribute();
((ITableAttributeCellEditorRenderer) r).applyAttributeChanges(c, att, value);
if (this.m_ac.getController() instanceof IExtendedApplicationController) {
((IExtendedApplicationController) this.m_ac.getController()).updateElement(c, false);
} else {
this.m_ac.getController().updateElement(c);
}
}
if (element instanceof ICaller) {
ICaller c = ((ICaller) element);
IAttribute cAtt = c.getAttribute(((ITableAttributeCellEditorRenderer) r).getAttribute().getName());
if (cAtt != null && value instanceof String) {
if (cAtt.getValue().equalsIgnoreCase((String) value)) {
return;
}
}
IAttribute att = ((ITableAttributeCellEditorRenderer) r).getAttribute();
((ITableAttributeCellEditorRenderer) r).applyAttributeChanges(c, att, value);
if (this.m_ac.getController() instanceof IExtendedApplicationController) {
((IExtendedApplicationController) this.m_ac.getController()).updateElement(c, false);
} else {
this.m_ac.getController().updateElement(c);
}
}
}
this.m_v.refresh();
}
Aggregations