本文整理汇总了Java中java.beans.PropertyDescriptor.getShortDescription方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyDescriptor.getShortDescription方法的具体用法?Java PropertyDescriptor.getShortDescription怎么用?Java PropertyDescriptor.getShortDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.PropertyDescriptor
的用法示例。
在下文中一共展示了PropertyDescriptor.getShortDescription方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataItem
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private void createDataItem ( final PropertyDescriptor pd )
{
final String name = pd.getName ();
final Map<String, Variant> properties = new HashMap<String, Variant> ();
if ( pd.getShortDescription () != null )
{
properties.put ( "description", Variant.valueOf ( pd.getShortDescription () ) );
}
else
{
properties.put ( "description", Variant.valueOf ( "Field: " + pd.getName () ) );
}
final DataItemInputChained item = this.factory.createInput ( this.prefix + "." + name, properties );
ChainCreator.applyDefaultInputChain ( item );
this.itemMap.put ( name, item );
}
示例2: setPropertyDescriptor
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
public void setPropertyDescriptor(AbstractCouchDbTransaction couchDbTransaction, PropertyDescriptor[] propertyDescriptors, DatabaseObject parentObject) {
cleanGroups();
/* Fill the Group widget */
for (PropertyDescriptor property : propertyDescriptors) {
final String name = property.getName();
final String description = property.getShortDescription();
if (!parametersCouch.contains(name) ){
if ( (name.startsWith("q_") || name.startsWith("p_")) ) {
if (!parentObject.getClass().getCanonicalName().equals(property.getValue(
MySimpleBeanInfo.BLACK_LIST_PARENT_CLASS))) {
Group choosenGroup = name.startsWith("q_") ? groupQueries : groupParameters;
addToComposite(choosenGroup, name, description, false);
}
}
}
}
if (groupQueries.getChildren().length == 0) {
groupQueries.dispose();
}
if (groupParameters.getChildren().length == 0) {
groupParameters.dispose();
}
/* */
Collection<CouchExtraVariable> extraVariables = null;
if (couchDbTransaction instanceof PostBulkDocumentsTransaction){
extraVariables = ((PostBulkDocumentsTransaction) couchDbTransaction).getCouchParametersExtra();
}
if (couchDbTransaction instanceof PostDocumentTransaction) {
extraVariables = ((PostDocumentTransaction) couchDbTransaction).getCouchParametersExtra();
}
if (couchDbTransaction instanceof PostUpdateTransaction) {
extraVariables = ((PostUpdateTransaction) couchDbTransaction).getCouchParametersExtra();
}
if (couchDbTransaction instanceof PutUpdateTransaction) {
extraVariables = ((PutUpdateTransaction) couchDbTransaction).getCouchParametersExtra();
}
if (extraVariables != null ){
for (CouchExtraVariable extraVariable : extraVariables) {
addToComposite(groupData, extraVariable.getVariableName(), extraVariable.getVariableDescription(), extraVariable.isMultiValued());
}
}
if (groupData.getChildren().length == 0){
groupData.dispose();
}
setContent(globalComposite);
globalComposite.pack(true);
// Fix text no displayed in C8oBrowser
LinkedList<Control> controls = new LinkedList<>();
controls.add(globalComposite);
Control c;
while ((c = controls.pollFirst()) != null) {
if (c instanceof C8oBrowser) {
((C8oBrowser) c).reloadText();
} else if (c instanceof Composite) {
controls.addAll(Arrays.asList(((Composite) c).getChildren()));
}
}
}
示例3: getTip
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private String getTip(PropertyDescriptor p) {
String tip = null;
if (classObject instanceof HasPropertyTooltips) {
tip = ((HasPropertyTooltips) classObject).getPropertyTooltip(p.getName());
} else {
tip = p.getShortDescription();
}
return tip;
}
示例4: checkDefault
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static boolean checkDefault(BeanInfo i) {
System.out.println("checking default info...");
PropertyDescriptor descriptors[] = i.getPropertyDescriptors();
int nd = descriptors.length;
if (nd != 1) {
System.out.println("invalid number of descriptors: " + nd);
return false;
}
PropertyDescriptor d = descriptors[0];
String descr = d.getShortDescription();
boolean ok = descr.equals("x");
if (!ok) { System.out.println("invalid description: " + descr +
", expected: x"); }
ok &= check("isBound", d.isBound(), false);
ok &= check("isExpert", d.isExpert(), false);
ok &= check("isHidden", d.isHidden(), false);
ok &= check("isPreferred", d.isPreferred(), false);
ok &= check("required", (boolean) d.getValue("required"), false);
ok &= check("visualUpdate",
(boolean) d.getValue("visualUpdate"), false);
Object vals[] = (Object[]) d.getValue("enumerationValues");
if (vals != null && vals.length > 0) {
System.out.println("non-empty enumerationValues");
ok = false;
}
return ok;
}
示例5: checkAlternativeInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static boolean checkAlternativeInfo(BeanInfo i) {
System.out.println("checking alternative info...");
PropertyDescriptor descriptors[] = i.getPropertyDescriptors();
int nd = descriptors.length;
if (nd != 1) {
System.out.println("invalid number of descriptors: " + nd);
return false;
}
PropertyDescriptor d = descriptors[0];
String descr = d.getShortDescription();
boolean ok = descr.equals(DESCRIPTION_2);
if (!ok) { System.out.println("invalid alternative description: " +
descr + ", expected: " + DESCRIPTION_2); }
ok &= check("isBound", d.isBound(), !BOUND);
ok &= check("isExpert", d.isExpert(), !EXPERT);
ok &= check("isHidden", d.isHidden(), !HIDDEN);
ok &= check("isPreferred", d.isPreferred(), !PREFERRED);
ok &= check("required", (boolean) d.getValue("required"), !REQUIRED);
ok &= check("visualUpdate",
(boolean) d.getValue("visualUpdate"), !UPDATE);
Object vals[] = (Object[]) d.getValue("enumerationValues");
if (vals != null || vals.length > 0) {
System.out.println("non-null enumerationValues");
return false;
}
return ok;
}
示例6: checkAlternativeInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static boolean checkAlternativeInfo(Class<?> c, String what) {
BeanInfo i;
try { i = Introspector.getBeanInfo(c, Object.class); }
catch (IntrospectionException e) { throw new RuntimeException(e); }
System.out.println("checking alternative info for " + what);
PropertyDescriptor descriptors[] = i.getPropertyDescriptors();
int nd = descriptors.length;
if (nd != 1) {
System.out.println("invalid number of descriptors: " + nd);
return false;
}
PropertyDescriptor d = descriptors[0];
String descr = d.getShortDescription();
boolean ok = descr.equals(DESCRIPTION_2);
if (!ok) { System.out.println("invalid alternative description: " +
descr + ", expected: " + DESCRIPTION_2); }
ok &= check("isBound", d.isBound(), !BOUND);
ok &= check("isExpert", d.isExpert(), !EXPERT);
ok &= check("isHidden", d.isHidden(), !HIDDEN);
ok &= check("isPreferred", d.isPreferred(), !PREFERRED);
ok &= check("required", (boolean) d.getValue("required"), !REQUIRED);
ok &= check("visualUpdate",
(boolean) d.getValue("visualUpdate"), !UPDATE);
Object vals[] = (Object[]) d.getValue("enumerationValues");
if (vals != null && vals.length > 0) {
System.out.println("non-empty enumerationValues:");
for (Object v: vals) { System.out.print(v.toString()); }
System.out.println();
return false;
}
return ok;
}
示例7: checkInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static boolean checkInfo(BeanInfo i, boolean ignoreValsCheck) {
System.out.println("checking info...");
PropertyDescriptor descriptors[] = i.getPropertyDescriptors();
int nd = descriptors.length;
if (nd != 1) {
System.out.println("invalid number of descriptors: " + nd);
return false;
}
PropertyDescriptor d = descriptors[0];
String descr = d.getShortDescription();
boolean ok = descr.equals(DESCRIPTION);
if (!ok) { System.out.println("invalid description: " + descr +
", expected: " + DESCRIPTION); }
ok &= check("isBound", d.isBound(), BOUND);
ok &= check("isExpert", d.isExpert(), EXPERT);
ok &= check("isHidden", d.isHidden(), HIDDEN);
ok &= check("isPreferred", d.isPreferred(), PREFERRED);
ok &= check("required", (boolean) d.getValue("required"), REQUIRED);
ok &= check("visualUpdate",
(boolean) d.getValue("visualUpdate"), UPDATE);
if (ignoreValsCheck) { return ok; }
Object vals[] = (Object[]) d.getValue("enumerationValues");
if (vals == null) {
System.out.println("null enumerationValues");
return false;
}
boolean okVals = (
(vals.length == 3) &&
vals[0].toString().equals(V_SHORT) &&
vals[1].toString().equals(V) &&
vals[2].toString().equals(V_NAME));
if (!okVals) { System.out.println("invalid enumerationValues"); }
return (ok && okVals);
}
示例8: checkInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static boolean checkInfo(BeanInfo i, boolean checkVals) {
System.out.println("checking info...");
PropertyDescriptor descriptors[] = i.getPropertyDescriptors();
int nd = descriptors.length;
if (nd != 1) {
System.out.println("invalid number of descriptors: " + nd);
return false;
}
PropertyDescriptor d = descriptors[0];
String descr = d.getShortDescription();
boolean ok = descr.equals(DESCRIPTION);
if (!ok) { System.out.println("invalid description: " + descr +
", expected: " + DESCRIPTION); }
ok &= check("isBound", d.isBound(), BOUND);
ok &= check("isExpert", d.isExpert(), EXPERT);
ok &= check("isHidden", d.isHidden(), HIDDEN);
ok &= check("isPreferred", d.isPreferred(), PREFERRED);
ok &= check("required", (boolean) d.getValue("required"), REQUIRED);
ok &= check("visualUpdate",
(boolean) d.getValue("visualUpdate"), UPDATE);
if (!checkVals) { return ok; }
Object vals[] = (Object[]) d.getValue("enumerationValues");
if (vals == null) {
System.out.println("null enumerationValues");
return false;
}
boolean okVals = (
(vals.length == 3) &&
vals[0].toString().equals(V_SHORT) &&
vals[1].toString().equals(V) &&
vals[2].toString().equals(V_NAME));
if (!okVals) { System.out.println("invalid enumerationValues"); }
return (ok && okVals);
}
示例9: checkInfo
import java.beans.PropertyDescriptor; //导入方法依赖的package包/类
private static boolean checkInfo(Class<?> c, String what, boolean checkVals) {
BeanInfo i;
try { i = Introspector.getBeanInfo(c, Object.class); }
catch (IntrospectionException e) { throw new RuntimeException(e); }
System.out.println("\nchecking info for " + what);
PropertyDescriptor descriptors[] = i.getPropertyDescriptors();
int nd = descriptors.length;
if (nd != 1) {
System.out.println("invalid number of descriptors: " + nd);
return false;
}
PropertyDescriptor d = descriptors[0];
String descr = d.getShortDescription();
boolean ok = descr.equals(DESCRIPTION);
if (!ok) { System.out.println("invalid description: " + descr +
", expected: " + DESCRIPTION); }
ok &= check("isBound", d.isBound(), BOUND);
ok &= check("isExpert", d.isExpert(), EXPERT);
ok &= check("isHidden", d.isHidden(), HIDDEN);
ok &= check("isPreferred", d.isPreferred(), PREFERRED);
ok &= check("required", (boolean) d.getValue("required"), REQUIRED);
ok &= check("visualUpdate",
(boolean) d.getValue("visualUpdate"), UPDATE);
if (!checkVals) { return ok; }
Object vals[] = (Object[]) d.getValue("enumerationValues");
if (vals == null) {
System.out.println("null enumerationValues");
return false;
}
if (vals.length == 0) {
System.out.println("empty enumerationValues");
return false;
}
boolean okVals = (
(vals.length == 3) &&
vals[0].toString().equals(V_SHORT) &&
vals[1].toString().equals(V) &&
vals[2].toString().equals(V_NAME));
if (!okVals) {
System.out.println("invalid enumerationValues:");
for (Object v: vals) { System.out.println(v.toString()); }
}
return (ok && okVals);
}