public class ResourceFilePropertyDescriptor extends SBPropertyDescriptor
The Operator field should be of type String (representing a name/path usually to be looked up via the resource search path of the containing application).
The contents of the resource may be retrieved using Operator.getResourceContents(String), giving the value
of the String field as the argument, or you may retrieve (if available) a File using Operator.getResourceFile(String)
ResourceFilePropertyDescriptor.restrictFileHints(String[]) to improve user experience selecting a resource in Studio, 7.6.2 a ResourceFilePropertyDescriptor.TypeHint enumeration is provided to indicate to Studio the kind of selector to displaySBPropertyDescriptor| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceFilePropertyDescriptor.TypeHint |
SBPropertyDescriptor.SingleValueSetter_expressionInputPort, NOT_AN_EXPRESSION| Constructor and Description |
|---|
ResourceFilePropertyDescriptor(java.beans.PropertyDescriptor pd,
java.lang.Class<?> beanClass)
Copy a property descriptor.
|
ResourceFilePropertyDescriptor(java.lang.String propertyName,
java.lang.Class<?> beanClass)
Constructs a resource descriptor with standard read/write method names
|
ResourceFilePropertyDescriptor(java.lang.String propertyName,
java.lang.Class<?> beanClass,
java.lang.String readMethodName,
java.lang.String writeMethodName)
Construct a resource descriptor with non-standard read/write method names.
|
| Modifier and Type | Method and Description |
|---|---|
ResourceFilePropertyDescriptor.TypeHint |
getType() |
ResourceFilePropertyDescriptor |
restrictFileHints(java.lang.String[] restrictions)
Sets restrictions on the Studio UI used to display a chooser to select a resource file.
|
ResourceFilePropertyDescriptor |
typeHint(ResourceFilePropertyDescriptor.TypeHint type) |
deprecated, description, displayName, getExpressionInputPort, getMaskDisplay, getMultiLine, getUIHints, isDeprecated, isExpression, isRequired, mask, multiline, optional, setDeprecated, setMaskStringDisplay, setMultiLine, setRequired, setUIHintscreatePropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethodpublic ResourceFilePropertyDescriptor(java.lang.String propertyName,
java.lang.Class<?> beanClass)
throws java.beans.IntrospectionException
propertyName - the name of the propertybeanClass - the operator class containing the propertyjava.beans.IntrospectionException - if introspection failsResourceFilePropertyDescriptorpublic ResourceFilePropertyDescriptor(java.lang.String propertyName,
java.lang.Class<?> beanClass,
java.lang.String readMethodName,
java.lang.String writeMethodName)
throws java.beans.IntrospectionException
propertyName - the name of the propertybeanClass - the operator class containing the propertyreadMethodName - the name of the method used to read the propertywriteMethodName - the name of the method used to write the propertyjava.beans.IntrospectionException - if introspection failsResourceFilePropertyDescriptorpublic ResourceFilePropertyDescriptor(java.beans.PropertyDescriptor pd,
java.lang.Class<?> beanClass)
throws java.beans.IntrospectionException
pd - a property descriptor to copy frombeanClass - the operator class containing the propertyjava.beans.IntrospectionException - if introspection failsResourceFilePropertyDescriptorpublic ResourceFilePropertyDescriptor restrictFileHints(java.lang.String[] restrictions)
Note that this is a relaxed UI restriction, and does not prevent any value from being typed by the user, nor does it restrict resources the operator can access.
Two kinds of name restrictions are available:
.xml,
and Studio will restrict the chooser to files ending in the provided extension, case insensitively.restrictions - see method description, must not be nullpublic ResourceFilePropertyDescriptor typeHint(ResourceFilePropertyDescriptor.TypeHint type)
type - the new type hint for this descriptorResourceFilePropertyDescriptor.TypeHintpublic ResourceFilePropertyDescriptor.TypeHint getType()
ResourceFilePropertyDescriptor.TypeHint