use of com.ramussoft.gui.qualifier.table.TableNode in project ramus by Vitaliy-Yakovchuk.
the class ElementAttributesEditor method reload.
protected void reload() {
CloseEvent event = new CloseEvent(this);
CloseListener[] listeners = getCloseListeners();
for (CloseListener listener : listeners) {
listener.closed(event);
removeCloseListener(listener);
}
loadCurrentQualifierAttributes();
Engine engine = framework.getEngine();
AccessRules rules = framework.getAccessRules();
getters = new ValueGetter[attributes.size()];
renderers = new TableCellRenderer[attributes.size()];
values = new Object[attributes.size()];
saveValues = new boolean[attributes.size()];
Arrays.fill(saveValues, true);
Arrays.fill(getters, new ValueGetter() {
@Override
public Object getValue(TableNode node, int index) {
return node.getValueAt(index);
}
});
for (int i = 0; i < attributes.size(); i++) {
Attribute attr = attributes.get(i).attribute;
AttributePlugin plugin = framework.findAttributePlugin(attr);
if (plugin instanceof TabledAttributePlugin) {
ValueGetter getter = ((TabledAttributePlugin) plugin).getValueGetter(attr, engine, framework, this);
if (getter != null)
getters[i] = getter;
}
renderers[i] = plugin.getTableCellRenderer(engine, rules, attr);
}
loadElement();
}
Aggregations