@Override public boolean hasCustomizer() { // true if we have already computed beanInfo and it has customizer class return beanInfo.getBeanDescriptor().getCustomizerClass() != null; }
@Override public java.awt.Component getCustomizer() { Class clazz = beanInfo.getBeanDescriptor().getCustomizerClass();
/** * Returns a flag indicating if the encapsulated object has a customizer. */ public boolean hasCustomizer() { if (m_beandescriptor != null) { Class cls = m_beandescriptor.getCustomizerClass(); return (cls != null); } return false; }
/** * Gets the customizer for the current object. * * @return New instance of the customizer or null if there isn't a * customizer. */ public Component getCustomizer() { Component customizer = null; if (m_beandescriptor != null) { Class cls = m_beandescriptor.getCustomizerClass(); if (cls != null) { try { customizer = (Component) cls.newInstance(); } catch (Exception ex) { // XXX - debug System.out.println("PropertyTableModel: Instantiation exception creating Customizer"); } } } return customizer; }
public boolean hasCustomizer () { // true if we have already computed beanInfo and it has customizer class return beanInfo.getBeanDescriptor ().getCustomizerClass () != null; }
public boolean hasCustomizer () { // true if we have already computed beanInfo and it has customizer class return beanInfo.getBeanDescriptor ().getCustomizerClass () != null; }
public static String toString(BeanDescriptor descriptor) { if (descriptor == null) { return String.valueOf((Object) null); } StringBuilder builder = new StringBuilder(); builder.append(descriptor.getClass().getName()); builder.append("["); builder.append("beanClass=").append(toClassName(descriptor.getBeanClass())); builder.append(",customizerClass=").append(toClassName(descriptor.getCustomizerClass())); // TODO: append FeatureDescriptor fields builder.append("]"); return builder.toString(); }
/** * */ private void getInfoCustomizer() { BeanDescriptor bd = liveBean.getBeanInfo().getBeanDescriptor(); if (bd != null) { customizer = bd.getCustomizerClass(); if (customizer != null) { if (Customizer2.class.isAssignableFrom(customizer)) { try { liveCustomizer = (Customizer2)customizer.newInstance(); } catch (Exception e) { } } if (!Customizer.class.isAssignableFrom(customizer)) customizer = null; // not a valid Customizer, throw away ref } } }
public TestBeanGUI(Class<?> testBeanClass) { super(); log.debug("testing class: {}", testBeanClass); // A quick verification, just in case: if (!TestBean.class.isAssignableFrom(testBeanClass)) { Error e = new Error(); log.error("This should never happen!", e); throw e; // Programming error: bail out. } this.testBeanClass = testBeanClass; // Get the beanInfo: try { beanInfo = Introspector.getBeanInfo(testBeanClass); } catch (IntrospectionException e) { log.error("Can't get beanInfo for {}", testBeanClass, e); throw new Error(e); // Programming error. Don't continue. } customizerClass = beanInfo.getBeanDescriptor().getCustomizerClass(); // Creation of customizer and GUI initialization // is delayed until the first configure call. // It's not needed to find the static label, menu categories, etc. initialized = false; JMeterUtils.addLocaleChangeListener(this); }
@SuppressWarnings("unchecked") public Class<RSLTCLASS> tryFirst(Class c) { BeanInfo objectInfo; try { objectInfo = Utility.getBeanInfoNoF(c, false); } catch (IntrospectionException e) { return null; } BeanDescriptor descriptor = objectInfo.getBeanDescriptor(); Class<RSLTCLASS> customizerClass = null; if (descriptor != null) { customizerClass = (Class<RSLTCLASS>) descriptor.getCustomizerClass(); } return customizerClass; }
public static boolean equals(BeanDescriptor descriptor1, BeanDescriptor descriptor2) { return equals((FeatureDescriptor) descriptor1, (FeatureDescriptor) descriptor2) && nullEquals(descriptor1.getBeanClass(), descriptor2.getBeanClass()) && nullEquals(descriptor1.getCustomizerClass(), descriptor2.getCustomizerClass()); }
public void writeExternal(ObjectOutput out) throws IOException out.writeObject(_descriptor.getCustomizerClass()); out.writeObject(_descriptor.getDisplayName()); out.writeBoolean(_descriptor.isExpert());
public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(_descriptor.getBeanClass()); out.writeObject(_descriptor.getCustomizerClass()); out.writeObject(_descriptor.getDisplayName()); out.writeBoolean(_descriptor.isExpert()); out.writeObject(_descriptor.getName()); out.writeBoolean(_descriptor.isPreferred()); out.writeObject(_descriptor.getShortDescription()); Map<String,Object> map = new HashMap<String, Object>(4,1); for (Enumeration<String> e = _descriptor.attributeNames(); e.hasMoreElements();) { String name = e.nextElement(); // It is not necessary to serialize AttachedObjectTarget list because // we only use it when VDL.retargetAttachedObjects() is called and this only // happen when the view is built. Also, try to serialize this instances could // cause unwanted exceptions. if (!AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY.equals(name)) { map.put(name, _descriptor.getValue(name)); } } out.writeObject(map); out.writeObject(_propertyDescriptors); } }
public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(_descriptor.getBeanClass()); out.writeObject(_descriptor.getCustomizerClass()); out.writeObject(_descriptor.getDisplayName()); out.writeBoolean(_descriptor.isExpert()); out.writeObject(_descriptor.getName()); out.writeBoolean(_descriptor.isPreferred()); out.writeObject(_descriptor.getShortDescription()); Map<String,Object> map = new HashMap<String, Object>(4,1); for (Enumeration<String> e = _descriptor.attributeNames(); e.hasMoreElements();) { String name = e.nextElement(); // It is not necessary to serialize AttachedObjectTarget list because // we only use it when VDL.retargetAttachedObjects() is called and this only // happen when the view is built. Also, try to serialize this instances could // cause unwanted exceptions. if (!AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY.equals(name)) { map.put(name, _descriptor.getValue(name)); } } out.writeObject(map); out.writeObject(_propertyDescriptors); } }
/** * @return the customizer for the current bean. Null is returned if the bean * does not have a customizer. */ private Class getCustomizer() { JETABean bean = getBean(); if (bean != null) { DynamicBeanInfo beaninfo = bean.getBeanInfo(); if (beaninfo != null) { BeanDescriptor bd = beaninfo.getBeanDescriptor(); if (bd != null) { return bd.getCustomizerClass(); } } } return null; }
Class<?> customizerClass = getCustomizerClass(); beanDescriptor = new BeanDescriptor(beanDescriptor.getBeanClass(), customizerClass == null ? beanDescriptor.getCustomizerClass() : customizerClass); } else {
Class<?> customizerClass = getCustomizerClass(); beanDescriptor = new BeanDescriptor(beanDescriptor.getBeanClass(), customizerClass == null ? beanDescriptor.getCustomizerClass() : customizerClass); } else {
Class<?> customizerClass = getCustomizerClass(); beanDescriptor = new BeanDescriptor(beanDescriptor.getBeanClass(), customizerClass == null ? beanDescriptor.getCustomizerClass() : customizerClass); } else {
public java.awt.Component getCustomizer () { Class clazz = beanInfo.getBeanDescriptor ().getCustomizerClass (); if (clazz == null) return null;
public java.awt.Component getCustomizer () { Class clazz = beanInfo.getBeanDescriptor ().getCustomizerClass (); if (clazz == null) return null;