diff options
Diffstat (limited to 'source/com')
3 files changed, 7 insertions, 1 deletions
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/AttributeList.java b/source/com/c2kernel/gui/tabs/outcome/form/AttributeList.java index 3d6cc6e..7d15452 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/AttributeList.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/AttributeList.java @@ -143,6 +143,8 @@ public class AttributeList extends JPanel { thisField = e.next();
thisDecl = content.getAttributeDecl(thisField.getName());
+ // HACK: if we don't resolve the reference, the type will be null
+ if (thisDecl.isReference()) thisDecl = thisDecl.getReference();
thisAttr = newAttribute(myElement, thisDecl);
// add into parent - fill in field
try {
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java b/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java index 45bdbc8..ac6a9f2 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/DimensionTableModel.java @@ -39,7 +39,6 @@ public class DimensionTableModel extends AbstractTableModel { public DimensionTableModel(ElementDecl model, boolean readOnly) throws StructuralException {
XMLType modelContent = model.getType();
-
this.model = model;
this.readOnly = readOnly;
// use text node for simple types
@@ -63,6 +62,10 @@ public class DimensionTableModel extends AbstractTableModel { // process attributes
for (Enumeration<?> e = elementType.getAttributeDecls(); e.hasMoreElements();) {
AttributeDecl thisAttr = (AttributeDecl)e.nextElement();
+ // HACK: if we don't resolve the reference, the type will be null
+ if (thisAttr.isReference()) thisAttr = thisAttr.getReference();
+ if (thisAttr.getSimpleType() == null)
+ throw new StructuralException("Attribute "+thisAttr.getName()+" in "+model.getName()+" has no type");
addColumn(thisAttr.getName(), thisAttr, thisAttr.getSimpleType().getTypeCode(), new Boolean(thisAttr.isFixed()));
}
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java b/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java index 5f6a384..0e5fee9 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java @@ -103,6 +103,7 @@ public class StringEditField implements FocusListener, DomainKeyConsumer { }
public static StringEditField getEditField(AttributeDecl model) throws StructuralException {
+ if (model.isReference()) model = model.getReference();
StringEditField newField = getFieldForType(model.getSimpleType());
newField.setDecl(model);
return newField;
|
