for (ComponentDescriptor descriptor : descriptorsList) { TypeDescriptor typeDescriptor = descriptor.getTypeDescriptor (); if (typeDescriptor.getSuperType () != null && descriptor.getSuperDescriptor () == null) { Debug.warning ("Unresolved super descriptor", descriptor); // NOI18N continue;
public void run () { ComponentDescriptor descriptor = document.getDescriptorRegistry ().getComponentDescriptor (getMainComponentTypeID ()); if (descriptor != null) { TypeID superTypeID = descriptor.getTypeDescriptor ().getSuperType (); if (superTypeID != null) producers[0] = DocumentSupport.getComponentProducer (document, superTypeID.toString ()); } } });
/** * Checks whether a component descriptor is compatible (descriptor analogy of instanceof operator) with a type id. * Means: Specified component descriptor or its super descriptor has the same type id as the specified one. * @param typeID the type id * @param componentDescriptor the component descriptor * @return true if compatible */ private boolean isComponentDescriptorCompatibleWithTypeID (TypeID typeID, ComponentDescriptor componentDescriptor) { assert isAccess (); if (typeID == null) return false; for (;;) { if (componentDescriptor == null) return false; TypeDescriptor typeDescriptor = componentDescriptor.getTypeDescriptor (); TypeID checked = typeDescriptor.getThisType (); if (checked == null) return false; if (checked.equals (typeID)) return true; componentDescriptor = getComponentDescriptor (typeDescriptor.getSuperType ()); } }
@Override public Result postInitialize (DesignDocument document, DesignComponent mainComponent) { ComponentDescriptor descriptor = document.getDescriptorRegistry ().getComponentDescriptor (getMainComponentTypeID ()); if (descriptor != null) { TypeID superTypeID = descriptor.getTypeDescriptor ().getSuperType (); if (superTypeID != null) { ComponentProducer producer = DocumentSupport.getComponentProducer (document, superTypeID.toString ()); if (producer != null) producer.postInitialize (document, mainComponent); } } return super.postInitialize (document, mainComponent); }
return; TypeID superType = descriptor.getTypeDescriptor ().getSuperType (); Collection<String> excludedNames = descriptor.getExcludedPropertyDescriptorNames (); List<PropertyDescriptor> declaredDescriptors = descriptor.getDeclaredPropertyDescriptors ();
if (typeDescriptor.getSuperType () != null) setAttribute (document, typeNode, XMLComponentDescriptor.SUPER_TYPEID_ATTR, typeDescriptor.getSuperType ().toString ()); setAttribute (document, typeNode, XMLComponentDescriptor.THIS_TYPEID_ATTR, typeDescriptor.getThisType ().toString ()); setAttribute (document, typeNode, XMLComponentDescriptor.CAN_DERIVE_ATTR, Boolean.toString (typeDescriptor.isCanDerive ()));