public void run() { propertyValue = component.get().getComponentDescriptor().getPropertyDescriptor(propertyName).getDefaultValue(); } });
private static TypeID getComponentTypeID(DesignComponent component, String propertyName) { return component.getComponentDescriptor().getPropertyDescriptor(propertyName).getType(); }
public void run() { for (String propertyName : propertyNames) { PropertyDescriptor propertyDescriptor = component.get().getComponentDescriptor().getPropertyDescriptor(propertyName); if (!(propertyDescriptor.getDefaultValue().getKind() != PropertyValue.Kind.NULL || propertyDescriptor.isAllowNull())) { supportsDefaultValue[0] = false; break; } } } });
/** * Writes a property value. * @param propertyName the property name * @param propertyValue the property value */ public void writeProperty(String propertyName, PropertyValue propertyValue) { assert document.getTransactionManager().isWriteAccess(); assert propertyValue != null : "Null property value"; // NOI18N assert componentDescriptor != null; PropertyValue oldValue = properties.get(propertyName); assert oldValue != null : "Missing old value in " + this + "." + propertyName; // NOI18N if (oldValue == propertyValue) return; PropertyDescriptor propertyDescriptor = componentDescriptor.getPropertyDescriptor(propertyName); assert propertyDescriptor != null : "Missing property descriptor in " + this + "." + propertyName; // NOI18N assert ! propertyDescriptor.isReadOnly() : "Cannot write read-only property " + this + "." + propertyName; // NOI18N // TODO - allow writing during deserialization assert propertyValue.isCompatible(propertyDescriptor); properties.put(propertyName, propertyValue); document.getTransactionManager().writePropertyHappened(this, propertyName, oldValue, propertyValue); }
public void run() { List<String> propertyNames = element.getPropertyValueNames(); for (String propertyName : propertyNames) { PropertyValue pv = component.readProperty(propertyName); if (PropertyValue.Kind.USERCODE.equals(pv.getKind())) { component.writeProperty(propertyName, component.getComponentDescriptor().getPropertyDescriptor(propertyName).getDefaultValue()); } } } });
@Override public boolean isAcceptable (ComponentProducer producer, AcceptSuggestion suggestion) { if (getComponent().getComponentDescriptor().getPropertyDescriptor(DisplayableCD.PROP_COMMANDS).isReadOnly()) return false; DescriptorRegistry registry = getComponent().getDocument().getDescriptorRegistry(); return registry.isInHierarchy(CommandCD.TYPEID, producer.getMainComponentTypeID ()); }
if (propertyName == null || descriptor.getPropertyDescriptor(propertyName) == null) { Debug.warning("Missing property descriptor", component, propertyName); // NOI18N errorHandler.addWarning("{0} {1} - {2}", NbBundle.getMessage(DocumentLoad.class, "MSG_MissingProperty_Error"), component, propertyName); // NOI18N