@Override public FeatureDescriptor next() { Object key = keys.next(); FeatureDescriptor feature = new FeatureDescriptor(); feature.setDisplayName(key == null ? "null" : key.toString()); feature.setName(feature.getDisplayName()); feature.setShortDescription(""); feature.setExpert(true); feature.setHidden(false); feature.setPreferred(true); feature.setValue(TYPE, key == null ? "null" : key.getClass()); feature.setValue(RESOLVABLE_AT_DESIGN_TIME, true); return feature; }
propertyDescriptor.getDisplayName(); PropertyDescriptor pd = fromPd.get(fromPd .indexOf(propertyDescriptor)); if (pd.getDisplayName().equals( propertyDescriptor.getDisplayName()) && !pd.getDisplayName().equals("class")) { if(propertyDescriptor.getWriteMethod() != null) propertyDescriptor.getWriteMethod().invoke(toObj, pd.getReadMethod().invoke(fromObj, null));
/** Set the display name. Fires a property change event. * @param s the new name */ @Override public void setDisplayName(String s) { String displayName = super.getDisplayName(); if ((displayName == null) || !displayName.equals(s)) { super.setDisplayName(s); fireDisplayNameChange(displayName, s); } }
public static String getFieldName(Method method) { try { Class<?> clazz=method.getDeclaringClass(); BeanInfo info = Introspector.getBeanInfo(clazz); PropertyDescriptor[] props = info.getPropertyDescriptors(); for (PropertyDescriptor pd : props) { if(method.equals(pd.getWriteMethod()) || method.equals(pd.getReadMethod())) { System.out.println(pd.getDisplayName()); return pd.getName(); } } } catch (IntrospectionException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; }
public FeatureDescriptor next() { Object key = keys.next(); FeatureDescriptor feature = new FeatureDescriptor(); feature.setDisplayName(key == null ? "null" : key.toString()); feature.setName(feature.getDisplayName()); feature.setShortDescription(""); feature.setExpert(true); feature.setHidden(false); feature.setPreferred(true); feature.setValue(TYPE, key == null ? null : key.getClass()); feature.setValue(RESOLVABLE_AT_DESIGN_TIME, true); return feature; } public void remove() {
public FeatureDescriptor next() { Object key = keys.next(); FeatureDescriptor feature = new FeatureDescriptor(); feature.setDisplayName(key == null ? "null" : key.toString()); feature.setName(feature.getDisplayName()); feature.setShortDescription(""); feature.setExpert(true); feature.setHidden(false); feature.setPreferred(true); feature.setValue(TYPE, key == null ? null : key.getClass()); feature.setValue(RESOLVABLE_AT_DESIGN_TIME, true); return feature; } public void remove() {
public FeatureDescriptor next() { FeatureDescriptor feature = new FeatureDescriptor(); feature.setDisplayName(keys.nextElement()); feature.setName(feature.getDisplayName()); feature.setShortDescription(""); feature.setExpert(true); feature.setHidden(false); feature.setPreferred(true); feature.setValue(TYPE, String.class); feature.setValue(RESOLVABLE_AT_DESIGN_TIME, true); return feature; } public void remove() {
public FeatureDescriptor next() { FeatureDescriptor feature = new FeatureDescriptor(); feature.setDisplayName(keys.nextElement()); feature.setName(feature.getDisplayName()); feature.setShortDescription(""); feature.setExpert(true); feature.setHidden(false); feature.setPreferred(true); feature.setValue(TYPE, String.class); feature.setValue(RESOLVABLE_AT_DESIGN_TIME, true); return feature; } public void remove() {
public int compare(Object o1, Object o2) { FeatureDescriptor f1 = (FeatureDescriptor) o1; FeatureDescriptor f2 = (FeatureDescriptor) o2; return f1.getDisplayName().compareTo(f2.getDisplayName()); } }
BeanInfo beanInfo = Introspector.getBeanInfo(beanClass, Object.class); PropertyDescriptor descriptors[] = beanInfo.getPropertyDescriptors(); for (PropertyDescriptor d : descriptors) { final Type type = d.getReadMethod().getGenericReturnType(); if (type instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) type; System.out.println(d.getDisplayName()); for (Type atp : pt.getActualTypeArguments()) { System.out.println(" " + atp); } } }
/** * Returns the FeatureDescriptor's shortDescription or "" if the * shortDescription is the same as the displayName. */ public String getDescription(FeatureDescriptor feature) { String description = feature.getShortDescription(); if (description == null || description.equals(feature.getDisplayName())) { description = ""; } return description; }
public String getAccessibleName() { String name = super.getAccessibleName(); if (name == null && model instanceof ExPropertyModel) { FeatureDescriptor fd = ((ExPropertyModel)model).getFeatureDescriptor(); name = NbBundle.getMessage(PropertyPanel.class, "ACS_PropertyPanel", fd.getDisplayName()); //NOI18N } return name; }
public void setUseTitle(boolean val) { if (useTitle != val) { useTitle = val; if (env != null) { setBorder (new TitledBorder( env.getFeatureDescriptor().getDisplayName())); } } }
/** Set the display name. Fires a property change event. * @param s the new name */ public void setDisplayName (String s) { String displayName = super.getDisplayName (); if (displayName == null || !displayName.equals (s)) { super.setDisplayName (s); fireDisplayNameChange (displayName, s); } }
public void setUseTitle(boolean val) { if (useTitle != val) { useTitle = val; text = null; if (env != null) { setText(env.getFeatureDescriptor().getDisplayName()); } } }
public String getAccessibleName() { FeatureDescriptor fd = ((ExPropertyModel)getModel()).getFeatureDescriptor(); PropertyEditor editor = getPropertyEditor(); return MessageFormat.format( getString("ACS_PropertyPanelRenderer"), new Object[] { fd.getDisplayName(), (editor == null) ? getString("CTL_No_value") : editor.getAsText() } ); }
public String getAccessibleName() { FeatureDescriptor fd = ((ExPropertyModel)getModel()).getFeatureDescriptor(); PropertyEditor editor = getPropertyEditor(); return MessageFormat.format( getString("ACS_PropertyPanelRenderer"), new Object[] { fd.getDisplayName(), (editor == null) ? getString("CTL_No_value") : editor.getAsText() } ); }
public String getBeanName() { if (modelRef != null) { PropertyModel pm = modelRef.get(); if (pm instanceof NodePropertyModel) { return ((NodePropertyModel) pm).getBeanName(); } } if (getProperty() instanceof ModelProperty.DPMWrapper) { return ((ModelProperty.DPMWrapper) getProperty()).getBeanName(); } return findFeatureDescriptor(EditablePropertyDisplayer.this).getDisplayName(); }
public String getBeanName() { if (modelRef != null) { PropertyModel pm = (PropertyModel)modelRef.get(); if (pm instanceof NodePropertyModel) { return ((NodePropertyModel)pm).getBeanName(); } } if (getProperty() instanceof ModelProperty.DPMWrapper) { return ((ModelProperty.DPMWrapper) getProperty()).getBeanName(); } return findFeatureDescriptor(EditablePropertyDisplayer.this).getDisplayName(); }
protected Descriptor doGetDescriptor(FeatureDescriptor info, String descriptorType) { Descriptor descriptor = new DescriptorSupport(); descriptor.setField("name", info.getName()); descriptor.setField("displayName", info.getDisplayName()); descriptor.setField("description", info.getShortDescription()); descriptor.setField("descriptorType", descriptorType); return descriptor; }