/** * 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."); } } }
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(); } } }
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(); } } }
/** * 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(); } }
/** * 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(); } }
/** * Adds the supplied collection of beans to the end of the list of collections * and to the JComponent container (if not null) * * @param beanInstances the vector of bean instances to add * @param container */ public static void addBeanInstances(Vector<Object> beanInstances, JComponent container) { // reset(container); if (container != null) { for (int i = 0; i < beanInstances.size(); i++) { Object bean = ((BeanInstance) beanInstances.elementAt(i)).getBean(); if (Beans.isInstanceOf(bean, JComponent.class)) { container.add((JComponent) bean); } } container.revalidate(); container.repaint(); } TABBED_COMPONENTS.add(beanInstances); }
/** * Removes all beans from containing component * * @param container a <code>JComponent</code> value */ public static void removeAllBeansFromContainer(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++) { Object tempInstance = components.elementAt(i); Object tempBean = ((BeanInstance) tempInstance).getBean(); if (Beans.isInstanceOf(tempBean, JComponent.class)) { container.remove((JComponent) tempBean); } } } container.revalidate(); } }
/** * Removes all beans from containing component * * @param container a <code>JComponent</code> value */ public static void removeAllBeansFromContainer(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++) { Object tempInstance = components.elementAt(i); Object tempBean = ((BeanInstance) tempInstance).getBean(); if (Beans.isInstanceOf(tempBean, JComponent.class)) { container.remove((JComponent) tempBean); } } } container.revalidate(); } }
/** * Adds the supplied collection of beans to the end of the list of collections * and to the JComponent container (if not null) * * @param beanInstances the vector of bean instances to add * @param container */ public static void addBeanInstances(Vector<Object> beanInstances, JComponent container) { // reset(container); if (container != null) { for (int i = 0; i < beanInstances.size(); i++) { Object bean = ((BeanInstance) beanInstances.elementAt(i)).getBean(); if (Beans.isInstanceOf(bean, JComponent.class)) { container.add((JComponent) bean); } } container.revalidate(); container.repaint(); } TABBED_COMPONENTS.add(beanInstances); }
if (!Beans.isInstanceOf(m_bean, JComponent.class)) { System.out.println("Component is invisible!"); return;
if (!Beans.isInstanceOf(m_bean, JComponent.class)) { System.out.println("Component is invisible!"); return;
for (int i = 0; i < beanInstances.size(); i++) { Object bean = ((BeanInstance) beanInstances.elementAt(i)).getBean(); if (Beans.isInstanceOf(bean, JComponent.class)) { container.add((JComponent) bean);
for (int i = 0; i < beanInstances.size(); i++) { Object bean = ((BeanInstance) beanInstances.elementAt(i)).getBean(); if (Beans.isInstanceOf(bean, JComponent.class)) { container.add((JComponent) bean);
if (Beans.isInstanceOf(m_Target, Component.class)) { ((Component) (Beans.getInstanceOf(m_Target, Component.class))).repaint();
if (Beans.isInstanceOf(m_Target, Component.class)) { ((Component) (Beans.getInstanceOf(m_Target, Component.class))).repaint();