本文整理汇总了Java中java.beans.PropertyDescriptor.setPropertyEditorClass方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyDescriptor.setPropertyEditorClass方法的具体用法?Java PropertyDescriptor.setPropertyEditorClass怎么用?Java PropertyDescriptor.setPropertyEditorClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.PropertyDescriptor
的用法示例。
在下文中一共展示了PropertyDescriptor.setPropertyEditorClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CryptoWSSecurityPostProcessorBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public CryptoWSSecurityPostProcessorBeanInfo(Class<? extends CryptoWSSecurityPostProcessor> clazz) {
super(clazz);
createPropertyGroup("Certificate", new String[]{
"keystoreFile", "keystorePassword", "certPassword"
});
PropertyDescriptor p;
p = property("keystoreFile");
p.setPropertyEditorClass(FileEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("keystorePassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("certPassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
}
示例2: PlainTextConfigElementBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
/**
* Constructor which creates property group and creates UI for PlainTextConfigElement.
*/
public PlainTextConfigElementBeanInfo() {
super(PlainTextConfigElement.class);
//Create property group
createPropertyGroup("plain_text_load_generator", new String[] {
PLACE_HOLDER, JSON_SCHEMA
});
PropertyDescriptor placeHolderProps = property(PLACE_HOLDER);
placeHolderProps.setValue(NOT_UNDEFINED, Boolean.TRUE);
placeHolderProps.setValue(DEFAULT, PropsKeys.MSG_PLACEHOLDER);
placeHolderProps.setValue(NOT_EXPRESSION, Boolean.TRUE);
//Create inout Text Area
PropertyDescriptor p = property(JSON_SCHEMA);
p.setPropertyEditorClass(TextAreaEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
}
示例3: ExceptionStatementBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public ExceptionStatementBeanInfo() {
try {
beanClass = ExceptionStatement.class;
additionalBeanClass = com.twinsoft.convertigo.beans.statements.SimpleStatement.class;
iconNameC16 = "/com/twinsoft/convertigo/beans/statements/images/exception_16x16.png";
iconNameC32 = "/com/twinsoft/convertigo/beans/statements/images/exception_32x32.png";
resourceBundle = getResourceBundle("res/ExceptionStatement");
displayName = resourceBundle.getString("display_name");
shortDescription = resourceBundle.getString("short_description");
PropertyDescriptor property = getPropertyDescriptor("expression");
property.setPropertyEditorClass(getEditorClass("ScriptCellEditor"));
}
catch(Exception e) {
com.twinsoft.convertigo.engine.Engine.logBeans.error("Exception with bean info; beanClass=" + beanClass.toString(), e);
}
}
示例4: ReturnStatementBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public ReturnStatementBeanInfo() {
try {
beanClass = ReturnStatement.class;
additionalBeanClass = com.twinsoft.convertigo.beans.statements.SimpleStatement.class;
iconNameC16 = "/com/twinsoft/convertigo/beans/statements/images/return_16x16.png";
iconNameC32 = "/com/twinsoft/convertigo/beans/statements/images/return_32x32.png";
resourceBundle = getResourceBundle("res/ReturnStatement");
displayName = resourceBundle.getString("display_name");
shortDescription = resourceBundle.getString("short_description");
PropertyDescriptor property = getPropertyDescriptor("expression");
property.setPropertyEditorClass(getEditorClass("ScriptCellEditor"));
}
catch(Exception e) {
com.twinsoft.convertigo.engine.Engine.logBeans.error("Exception with bean info; beanClass=" + beanClass.toString(), e);
}
}
示例5: TransactionBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public TransactionBeanInfo() {
try {
beanClass = Transaction.class;
additionalBeanClass = com.twinsoft.convertigo.beans.core.RequestableObject.class;
resourceBundle = getResourceBundle("res/Transaction");
properties = new PropertyDescriptor[0];
PropertyDescriptor property = getPropertyDescriptor("sheetLocation");
property.setPropertyEditorClass(getEditorClass("TransactionSheetLocationEditor"));
}
catch(Exception e) {
com.twinsoft.convertigo.engine.Engine.logBeans.error("Exception with bean info; beanClass=" + beanClass.toString(), e);
}
}
示例6: getPropertyDescriptor
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
protected PropertyDescriptor getPropertyDescriptor(String name) throws IntrospectionException {
checkAdditionalProperties();
for (int i = 0 ; i < properties.length ; i++) {
PropertyDescriptor property = properties[i];
if (name.equals(property.getName())) {
PropertyDescriptor clone = new PropertyDescriptor(name, property.getReadMethod(), property.getWriteMethod());
clone.setDisplayName(property.getDisplayName());
clone.setShortDescription(property.getShortDescription());
clone.setPropertyEditorClass(property.getPropertyEditorClass());
clone.setBound(property.isBound());
clone.setConstrained(property.isConstrained());
clone.setExpert(property.isExpert());
clone.setHidden(property.isHidden());
clone.setPreferred(property.isPreferred());
for (String attributeName : Collections.list(property.attributeNames())) {
clone.setValue(attributeName, property.getValue(attributeName));
}
return properties[i] = clone;
}
}
return null;
}
示例7: copyNonMethodProperties
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target)
throws IntrospectionException {
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());
}
示例8: disabled_testPropertyPanelShallGCEvenIfEditorExists
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public void disabled_testPropertyPanelShallGCEvenIfEditorExists () throws Exception {
PropertyDescriptor feature = new PropertyDescriptor ("prop", this.getClass ());
feature.setPropertyEditorClass (Ed.class);
DefaultPropertyModel model = new DefaultPropertyModel (
this, feature
);
PropertyPanel pp = new PropertyPanel (model, PropertyPanel.PREF_CUSTOM_EDITOR);
addToPanel(pp);
assertTrue ("Ed editor created", pp.getPropertyEditor() instanceof Ed);
Ed ed = (Ed)pp.getPropertyEditor ();
assertNotNull ("Environment has been attached", ed.env);
//
// Make sure that the panel listens on changes in env
//
Listener panelListener = new Listener ();
pp.addPropertyChangeListener (panelListener);
ed.env.setState (PropertyEnv.STATE_INVALID);
panelListener.assertChanges ("Change notified in panel", 1, 0);
removeFromPanel(pp);
pp.removePropertyChangeListener(panelListener);
WeakReference weak = new WeakReference (pp);
pp = null;
model = null;
feature = null;
assertGC ("Panel should disappear even if we have reference to property editor", weak);
}
示例9: WSSUsernameTokenPreProcessorBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public WSSUsernameTokenPreProcessorBeanInfo() {
super(WSSUsernameTokenPreProcessor.class);
createPropertyGroup("UsernameToken", new String[]{
"username", "password", "passwordType", "addNonce", "addCreated", "precisionInMilliSeconds"
});
PropertyDescriptor p;
p = property("username");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("password");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("passwordType");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSUsernameTokenPreProcessor.passwordTypes[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSUsernameTokenPreProcessor.passwordTypes);
p = property("addNonce");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
p = property("addCreated");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
p = property("precisionInMilliSeconds");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
}
示例10: CryptoWSSecurityPreProcessorBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public CryptoWSSecurityPreProcessorBeanInfo(Class<? extends CryptoWSSecurityPreProcessor> clazz) {
super(clazz);
createPropertyGroup("Certificate", new String[]{
"keystoreFile", "keystorePassword", "certAlias", "certPassword"
});
PropertyDescriptor p;
p = property("keystoreFile");
p.setPropertyEditorClass(FileEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("keystorePassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("certAlias");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("certPassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property(PARTSTOSECURE); // this is expected to be added to a property group by subclasses
p.setPropertyEditorClass(TableEditor.class);
p.setValue(TableEditor.CLASSNAME, SecurityPart.class.getName());
p.setValue(TableEditor.HEADERS, new String[]{"Name", "Namespace", "Encode"});
p.setValue(TableEditor.OBJECT_PROPERTIES, new String[]{"name", "namespace", "modifier"});
}
示例11: SerializedConfigElementBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
/**
* Constructor which creates property group and creates UI for SerializedConfigElement.
*/
public SerializedConfigElementBeanInfo() {
super(SerializedConfigElement.class);
//Create Property group
createPropertyGroup("serialized_load_generator", new String[] {
PLACE_HOLDER, CLASS_NAME, OBJ_PROPERTIES
});
PropertyDescriptor placeHolderProps = property(PLACE_HOLDER);
placeHolderProps.setValue(NOT_UNDEFINED, Boolean.TRUE);
placeHolderProps.setValue(DEFAULT, PropsKeys.MSG_PLACEHOLDER);
placeHolderProps.setValue(NOT_EXPRESSION, Boolean.TRUE);
//Create table editor component of jmeter for class field and expression mapping
TypeEditor tableEditor = TypeEditor.TableEditor;
PropertyDescriptor tableProperties = property(OBJ_PROPERTIES, tableEditor);
tableProperties.setValue(TableEditor.CLASSNAME, FieldExpressionMapping.class.getName());
tableProperties.setValue(TableEditor.HEADERS, new String[]{ "Field Name", "Field Expression" } );
tableProperties.setValue(TableEditor.OBJECT_PROPERTIES, new String[]{ FieldExpressionMapping.FIELD_NAME, FieldExpressionMapping.FIELD_EXPRESSION } );
tableProperties.setValue(DEFAULT, new ArrayList<>());
tableProperties.setValue(NOT_UNDEFINED, Boolean.TRUE);
//Create class name input textfield
PropertyDescriptor classNameProps = property(CLASS_NAME);
classNameProps.setPropertyEditorClass(ClassPropertyEditor.class);
classNameProps.setValue(NOT_UNDEFINED, Boolean.TRUE);
classNameProps.setValue(DEFAULT, "<POJO class name>");
}
示例12: _mergePropertyDescriptors
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
/**
* Merge information from two PropertyDescriptors into a third
* PropertyDescriptor.
* In the event of other conflicts, the second argument
* <code>primaryDescriptor</code> is given priority over the first argument
* <code>secondaryDescriptor</code>.
* <p>
* @param secondaryDescriptor The lower priority PropertyDescriptor
* @param primaryDescriptor The higher priority PropertyDescriptor
* @param mergedDescriptor The PropertyDescriptor to merge the information
* into.
*/
private static void _mergePropertyDescriptors(
PropertyDescriptor secondaryDescriptor,
PropertyDescriptor primaryDescriptor,
PropertyDescriptor mergedDescriptor
)
{
// merge the superclasses
_mergeFeatureDescriptors(secondaryDescriptor,
primaryDescriptor,
mergedDescriptor);
//
// merge the property editor class
//
Class<?> editorClass = primaryDescriptor.getPropertyEditorClass();
// Give priority to the primary propertyEditor.
if (editorClass == null)
{
editorClass = secondaryDescriptor.getPropertyEditorClass();
}
mergedDescriptor.setPropertyEditorClass(editorClass);
// merge the bound property
mergedDescriptor.setBound(secondaryDescriptor.isBound() |
primaryDescriptor.isBound());
// merge the constrained property
mergedDescriptor.setConstrained(secondaryDescriptor.isConstrained() |
primaryDescriptor.isConstrained());
}
示例13: _copyPropertyDescriptor
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static void _copyPropertyDescriptor(
PropertyDescriptor oldDescriptor,
PropertyDescriptor newDescriptor
)
{
newDescriptor.setBound(oldDescriptor.isBound());
newDescriptor.setConstrained(oldDescriptor.isConstrained());
newDescriptor.setPropertyEditorClass(
oldDescriptor.getPropertyEditorClass());
// copy in superclass
_copyFeatureDescriptor(oldDescriptor, newDescriptor);
}
示例14: SequenceBeanInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public SequenceBeanInfo() {
try {
beanClass = Sequence.class;
additionalBeanClass = com.twinsoft.convertigo.beans.core.RequestableObject.class;
resourceBundle = getResourceBundle("res/Sequence");
properties = new PropertyDescriptor[3];
properties[0] = new PropertyDescriptor("orderedVariables", beanClass, "getOrderedVariables", "setOrderedVariables");
properties[0].setDisplayName(getExternalizedString("property.orderedVariables.display_name"));
properties[0].setShortDescription(getExternalizedString("property.orderedVariables.short_description"));
//properties[0].setPropertyEditorClass(getEditorClass("SequenceVariablesEditor"));
//properties[0].setExpert(true);
properties[0].setHidden(true);
properties[1] = new PropertyDescriptor("orderedSteps", beanClass, "getOrderedSteps", "setOrderedSteps");
properties[1].setDisplayName(getExternalizedString("property.orderedSteps.display_name"));
properties[1].setShortDescription(getExternalizedString("property.orderedSteps.short_description"));
properties[1].setHidden(true);
properties[2] = new PropertyDescriptor("includeResponseElement", beanClass, "isIncludeResponseElement", "setIncludeResponseElement");
properties[2].setDisplayName(getExternalizedString("property.includeResponseElement.display_name"));
properties[2].setShortDescription(getExternalizedString("property.includeResponseElement.short_description"));
properties[2].setExpert(true);
PropertyDescriptor property = getPropertyDescriptor("sheetLocation");
property.setPropertyEditorClass(getEditorClass("SequenceSheetLocationEditor"));
}
catch(Exception e) {
com.twinsoft.convertigo.engine.Engine.logBeans.error("Exception with bean info; beanClass=" + beanClass.toString(), e);
}
}
示例15: main
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public static void main(String[] args) throws IntrospectionException {
PropertyDescriptor pd = new PropertyDescriptor("value", Bean.class);
pd.setPropertyEditorClass(Editor.class);
pd.createPropertyEditor(new Bean());
}