setPreferredSize((!Beans.isDesignTime()) ? (GUISizeHelper.editorCardDimension) : (new Dimension(600, 600)));
Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager)manager; managerName = pmProps.getProperty("org.pentaho.packageManager.manager"); if (managerName != null && managerName.length() > 0) { Object manager = Beans.instantiate(pm.getClass().getClassLoader(), managerName); if (manager instanceof PackageManager) { pm = (PackageManager)manager;
public void setIndexedValue(int index, E val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedWrite()) { throw new IllegalAccessException(); } Object validInstance = Beans.getInstanceOf(instance, indexedSetter.getDeclaringClass()); indexedSetter.invoke(validInstance, new Object[] { new Integer(index), val }); } }
/** * Create a bean of the appropriate type for the given Entry * object, and link it to the object for immediate manipulation. * * @param ent the Entry for which to create and link a bean * @return a new bean of the right type, linked to the given Entry * @exception ClassNotFoundException no bean class of the * appropriate type could be found * @exception ClassCastException the bean class does not implement * the EntryBean interface * @exception IOException the JavaBeans component could not be instantiated */ public static EntryBean createBean(Entry ent) throws ClassNotFoundException, IOException { String beanClass = ent.getClass().getName() + "Bean"; Object obj = null; try { obj = Beans.instantiate(ent.getClass().getClassLoader(), beanClass); } catch (ClassNotFoundException e) { // Ignore any ClassNotFoundException thrown here. } // Allow the instantiate method to throw an IOException. if (obj == null) obj = Beans.instantiate(null, beanClass); EntryBean entBean = (EntryBean)Beans.getInstanceOf(obj, EntryBean.class); entBean.makeLink(ent); return entBean; }
if (Beans.isInstanceOf(m_Target, Component.class)) { ((Component) (Beans.getInstanceOf(m_Target, Component.class))).repaint();
/** * Checks the type of an element matches the underlying list type. */ private void checkType(Object element) { if (element != null) { if (!Beans.isInstanceOf(element, listObjectType)) { throw new RuntimeException("element is not of correct type."); } } }
if (Beans.isInstanceOf(m_Target, Component.class)) { ((Component) (Beans.getInstanceOf(m_Target, Component.class))).repaint();
public static void appendBeans(JComponent container, Vector<Object> beans, int tab) { if (TABBED_COMPONENTS.size() > 0 && tab < TABBED_COMPONENTS.size()) { Vector<Object> components = TABBED_COMPONENTS.get(tab); // for (int i = 0; i < beans.size(); i++) { components.add(beans.get(i)); if (container != null) { Object bean = ((BeanInstance) beans.elementAt(i)).getBean(); if (Beans.isInstanceOf(bean, JComponent.class)) { container.add((JComponent) bean); } } } if (container != null) { container.revalidate(); container.repaint(); } } }
/** Creates new form OWLOntologyMatrixPanel */ public RepoOntologyPanel() { if (!java.beans.Beans.isDesignTime()) { // Utility.makeTablePopupHandler(myGraphTable); } }
new_bean = java.beans.Beans.instantiate(loader, className);
public void setValue(T val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (setter == null) { throw new IllegalAccessException(); } Object valideInstance = Beans.getInstanceOf(instance, setter.getDeclaringClass()); try { setter.invoke(valideInstance, val); } catch (IllegalAccessException ex) { try { setter.setAccessible(true); setter.invoke(valideInstance, val); } finally { setter.setAccessible(false); } } }
public static void appendBeans(JComponent container, Vector<Object> beans, int tab) { if (TABBED_COMPONENTS.size() > 0 && tab < TABBED_COMPONENTS.size()) { Vector<Object> components = TABBED_COMPONENTS.get(tab); // for (int i = 0; i < beans.size(); i++) { components.add(beans.get(i)); if (container != null) { Object bean = ((BeanInstance) beans.elementAt(i)).getBean(); if (Beans.isInstanceOf(bean, JComponent.class)) { container.add((JComponent) bean); } } } if (container != null) { container.revalidate(); container.repaint(); } } }
if (Beans.isDesignTime()) { //Designtime [...] } else { //Runtime [...] }
new_bean = java.beans.Beans.instantiate(loader, className);
public void setValue(T val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canWrite()) { throw new IllegalAccessException(); } Object validInstance = Beans.getInstanceOf(instance, setter.getDeclaringClass()); Object value = val; if ( (val != null) && (setter.getParameterTypes()[0].getComponentType().isPrimitive()) && (!val.getClass().getComponentType().isPrimitive()) ) { value = Utilities.toPrimitiveArray((Object[]) val); } setter.invoke(validInstance, value); }
/** * Adds all beans to the supplied component * * @param container a <code>JComponent</code> value */ public static void addAllBeansToContainer(JComponent container, Integer... tab) { int index = 0; if (tab.length > 0) { index = tab[0].intValue(); } Vector<Object> components = null; if (TABBED_COMPONENTS.size() > 0 && index < TABBED_COMPONENTS.size()) { components = TABBED_COMPONENTS.get(index); } if (container != null) { if (components != null) { for (int i = 0; i < components.size(); i++) { BeanInstance tempInstance = (BeanInstance) components.elementAt(i); Object tempBean = tempInstance.getBean(); if (Beans.isInstanceOf(tempBean, JComponent.class)) { container.add((JComponent) tempBean); } } } container.revalidate(); } }
/** * Returns <code>true</code> if given "Binder" is under design now. We should * not use "design time" globally, because while one widget in under design, * it may use other widgets and we want to execute them as is, without design * time tweaks. */ public static boolean isDesignTime(String fqInterfaceName) { if (Beans.isDesignTime()) { String key = "gwt.UiBinder.isDesignTime " + fqInterfaceName; return System.getProperty(key) != null; } return false; }
public JdbcBeanInterface getDefault() { if (defaultbean == null) { Class c = getClass(); try { defaultbean = (JdbcBeanInterface) Beans.instantiate(c.getClassLoader(), c.getName()); } catch (IOException ex) { } catch (ClassNotFoundException ex) { } } return defaultbean; }
/** Detaches all listeners from the bean and destroys it. * @throws IOException if there was a problem */ @Override public void destroy() throws IOException { if (removePCLMethod != null) { try { Object o = Beans.getInstanceOf(bean, removePCLMethod.getDeclaringClass()); removePCLMethod.invoke(o, new Object[] { propertyChangeListener }); } catch (Exception e) { NodeOp.exception(e); } } super.destroy(); }
/** * Adds all beans to the supplied component * * @param container a <code>JComponent</code> value */ public static void addAllBeansToContainer(JComponent container, Integer... tab) { int index = 0; if (tab.length > 0) { index = tab[0].intValue(); } Vector<Object> components = null; if (TABBED_COMPONENTS.size() > 0 && index < TABBED_COMPONENTS.size()) { components = TABBED_COMPONENTS.get(index); } if (container != null) { if (components != null) { for (int i = 0; i < components.size(); i++) { BeanInstance tempInstance = (BeanInstance) components.elementAt(i); Object tempBean = tempInstance.getBean(); if (Beans.isInstanceOf(tempBean, JComponent.class)) { container.add((JComponent) tempBean); } } } container.revalidate(); } }