/** * See {@link java.beans.FeatureDescriptor}. */ public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) { target.setExpert(source.isExpert()); target.setHidden(source.isHidden()); target.setPreferred(source.isPreferred()); target.setName(source.getName()); target.setShortDescription(source.getShortDescription()); target.setDisplayName(source.getDisplayName()); // Copy all attributes (emulating behavior of private FeatureDescriptor#addTable) Enumeration<String> keys = source.attributeNames(); while (keys.hasMoreElements()) { String key = keys.nextElement(); target.setValue(key, source.getValue(key)); } // See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor) target.setPropertyEditorClass(source.getPropertyEditorClass()); target.setBound(source.isBound()); target.setConstrained(source.isConstrained()); }
/** * See {@link java.beans.FeatureDescriptor}. */ public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) { target.setExpert(source.isExpert()); target.setHidden(source.isHidden()); target.setPreferred(source.isPreferred()); target.setName(source.getName()); target.setShortDescription(source.getShortDescription()); target.setDisplayName(source.getDisplayName()); // Copy all attributes (emulating behavior of private FeatureDescriptor#addTable) Enumeration<String> keys = source.attributeNames(); while (keys.hasMoreElements()) { String key = keys.nextElement(); target.setValue(key, source.getValue(key)); } // See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor) target.setPropertyEditorClass(source.getPropertyEditorClass()); target.setBound(source.isBound()); target.setConstrained(source.isConstrained()); }
/** * @return the default value as designated by the composite component * author if no attribute was specified by the composite component * consumer. This value may be a ValueExpression, or a literal. */ public Object getDefault() { return pd.getValue("default"); }
/** * @return the default value as designated by the composite component * author if no attribute was specified by the composite component * consumer. This value may be a ValueExpression, or a literal. */ public Object getDefault() { return pd.getValue("default"); }
/** * @return the default value as designated by the composite component * author if no attribute was specified by the composite component * consumer. This value may be a ValueExpression, or a literal. */ public Object getDefault() { return pd.getValue("default"); }
/** * @return the default value as designated by the composite component * author if no attribute was specified by the composite component * consumer. This value may be a ValueExpression, or a literal. */ public Object getDefault() { return pd.getValue("default"); }
/** * Returns true if the property disallows constant values different from the provided tags. * * @param descriptor the property descriptor * @return true if the attribute {@link #NOT_OTHER} is defined and equal to Boolean.TRUE; * otherwise the default is false */ static boolean notOther(PropertyDescriptor descriptor) { return Boolean.TRUE.equals(descriptor.getValue(NOT_OTHER)); }
/** * Returns true if the property must be defined (i.e. is required); * * @param descriptor the property descriptor * @return true if the attribute {@link #NOT_UNDEFINED} is defined and equal to Boolean.TRUE; * otherwise the default is false */ static boolean notNull(PropertyDescriptor descriptor) { return Boolean.TRUE.equals(descriptor.getValue(NOT_UNDEFINED)); }
/** * Returns true if the property default value is not saved * * @param descriptor the property descriptor * @return true if the attribute {@link #DEFAULT_NOT_SAVED} is defined and equal to Boolean.TRUE; * otherwise the default is false */ static boolean noSaveDefault(PropertyDescriptor descriptor) { return Boolean.TRUE.equals(descriptor.getValue(DEFAULT_NOT_SAVED)); }
public Object getValue(String key) { Object result = descriptor.getValue(key); if (result == null) { result = super.getValue(key); } return result; }
public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(descriptor.getBeanClass()); if (propertyDescriptors != null && propertyDescriptors.size() > 0) { out.writeObject(propertyDescriptors.size()); for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { out.writeObject(propertyDescriptor.getName()); out.writeObject(propertyDescriptor.getValue("type")); } } else { out.writeObject(0); } }
/** * @param ctx the <code>FacesContext</code> for the current request * @return <code>true<code> if this attribute is required to be present, * otherwise, returns <code>false</code> */ public boolean isRequired(FacesContext ctx) { ValueExpression rd = (ValueExpression) pd.getValue("required"); return ((rd != null) ? Boolean.valueOf(rd.getValue(ctx.getELContext()).toString()) : false); }
/** * @param ctx the <code>FacesContext</code> for the current request * @return the <code>method-signature</code> for this attribute */ public String getMethodSignature(FacesContext ctx) { ValueExpression ms = (ValueExpression) pd.getValue("method-signature"); if (ms != null) { return (String) ms.getValue(ctx.getELContext()); } return null; }
/** * @param ctx the <code>FacesContext</code> for the current request * @return <code>true<code> if this attribute is required to be present, * otherwise, returns <code>false</code> */ public boolean isRequired(FacesContext ctx) { ValueExpression rd = (ValueExpression) pd.getValue("required"); return ((rd != null) ? Boolean.valueOf(rd.getValue(ctx.getELContext()).toString()) : false); }
/** * @param ctx the <code>FacesContext</code> for the current request * @return <code>true<code> if this attribute is required to be present, * otherwise, returns <code>false</code> */ public boolean isRequired(FacesContext ctx) { ValueExpression rd = (ValueExpression) pd.getValue("required"); return ((rd != null) ? Boolean.valueOf(rd.getValue(ctx.getELContext()).toString()) : false); }
/** * @param ctx the <code>FacesContext</code> for the current request * @return the <code>method-signature</code> for this attribute */ public String getMethodSignature(FacesContext ctx) { ValueExpression ms = (ValueExpression) pd.getValue("method-signature"); if (ms != null) { return (String) ms.getValue(ctx.getELContext()); } return null; }
public Object getValue (String key) { Object result = descriptor.getValue(key); if (result == null) { result = super.getValue(key); } return result; }
public void attachEnv(PropertyEnv env){ // Add the help button String name = (String)getDesignProperty().getPropertyDescriptor().getValue(REFERENCE_DATA_NAME); if (name.equals(ReferenceDataManager.STYLE_CLASSES)){ FeatureDescriptor desc = env.getFeatureDescriptor(); desc.setValue(ExPropertyEditor.PROPERTY_HELP_ID, "projrave_ui_elements_propeditors_styleclass_prop_ed"); } }
/** {@inheritDoc} */ @Override public String getCategory() { String category = (String) this.beanPropertyDescriptor.getValue(BeanProperty.CATEGORY_LABEL_KEY); // fall back to default behavior if there is no category provided. if (category == null) { category = Localization.localize(Localization.asKey(this.beanPropertyDescriptor.isExpert() ? "bean.property.category.expert" : "bean.property.category.basic")); //$NON-NLS-1$ //$NON-NLS-2$ } return category; }