use of com.ramussoft.pb.idef.frames.SelectOwner in project ramus by Vitaliy-Yakovchuk.
the class FunctionOwnerAttributePlugin method getAttributeEditor.
@Override
public AttributeEditor getAttributeEditor(final Engine engine, final AccessRules rules, final Element element, Attribute attribute, AttributeEditor old) {
if (old != null)
old.close();
return new AbstractAttributeEditor() {
private SelectOwner component = new SelectOwner();
@Override
public Object setValue(Object value) {
DataPlugin plugin = NDataPluginFactory.getDataPlugin(engine.getQualifier(element.getQualifierId()), engine, rules);
component.setFunction((Function) plugin.findRowByGlobalId(element.getId()));
return value;
}
@Override
public Object getValue() {
Row row = component.getOwner();
if (row != null)
return row.getElement().getId();
return null;
}
@Override
public JComponent getComponent() {
return component;
}
};
}
Aggregations