本文整理匯總了Java中java.beans.Beans.isInstanceOf方法的典型用法代碼示例。如果您正苦於以下問題:Java Beans.isInstanceOf方法的具體用法?Java Beans.isInstanceOf怎麽用?Java Beans.isInstanceOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.Beans
的用法示例。
在下文中一共展示了Beans.isInstanceOf方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addAllBeansToContainer
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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();
}
}
示例2: addBeanInstances
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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);
}
示例3: appendBeans
import java.beans.Beans; //導入方法依賴的package包/類
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();
}
}
}
示例4: addAllBeansToContainer
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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 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();
}
}
示例5: addBeanInstances
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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 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);
}
示例6: appendBeans
import java.beans.Beans; //導入方法依賴的package包/類
public static void appendBeans(JComponent container, Vector beans, int tab) {
if (TABBED_COMPONENTS.size() > 0 && tab < TABBED_COMPONENTS.size()) {
Vector 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();
}
}
}
示例7: setBeanInstances
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Describe <code>setBeanInstances</code> method here.
*
* @param beanInstances a <code>Vector</code> value
* @param container a <code>JComponent</code> value
*/
public static void setBeanInstances(Vector 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();
}
COMPONENTS = beanInstances;
}
示例8: removeAllBeansFromContainer
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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();
}
}
示例9: setBeanInstances
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Adds the supplied collection of beans at the supplied index in the list of
* collections. If the index is not supplied then the primary collection is
* set (i.e. index 0). Also adds the beans to the supplied JComponent
* container (if not null)
*
* @param beanInstances a <code>Vector</code> value
* @param container a <code>JComponent</code> value
*/
public static void setBeanInstances(Vector<Object> beanInstances,
JComponent container, Integer... tab) {
removeAllBeansFromContainer(container, tab);
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();
}
int index = 0;
if (tab.length > 0) {
index = tab[0].intValue();
}
if (index < TABBED_COMPONENTS.size()) {
TABBED_COMPONENTS.set(index, beanInstances);
}
// COMPONENTS = beanInstances;
}
示例10: removeAllBeansFromContainer
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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 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.remove((JComponent)tempBean);
}
}
}
container.revalidate();
}
}
示例11: setBeanInstances
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Adds the supplied collection of beans at the supplied index in
* the list of collections. If the index is not supplied then
* the primary collection is set (i.e. index 0). Also adds
* the beans to the supplied JComponent container (if not null)
*
* @param beanInstances a <code>Vector</code> value
* @param container a <code>JComponent</code> value
*/
public static void setBeanInstances(Vector beanInstances,
JComponent container,
Integer... tab) {
removeAllBeansFromContainer(container, tab);
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();
}
int index = 0;
if (tab.length > 0) {
index = tab[0].intValue();
}
if (index < TABBED_COMPONENTS.size()) {
TABBED_COMPONENTS.set(index, beanInstances);
}
// COMPONENTS = beanInstances;
}
示例12: checkType
import java.beans.Beans; //導入方法依賴的package包/類
/**
* 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.");
}
}
}
示例13: testIsInstanceOf_BeanNull
import java.beans.Beans; //導入方法依賴的package包/類
public void testIsInstanceOf_BeanNull() {
try {
Beans.isInstanceOf(null, Serializable.class);
fail("Should throw NullPointerException.");
} catch (NullPointerException e) {
}
}
示例14: removeAllBeansFromContainer
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Removes all beans from containing component
*
* @param container a <code>JComponent</code> value
*/
public static void removeAllBeansFromContainer(JComponent container) {
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.remove((JComponent)tempBean);
}
}
}
container.revalidate();
}
}
示例15: addAllBeansToContainer
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Adds all beans to the supplied component
*
* @param container a <code>JComponent</code> value
*/
public static void addAllBeansToContainer(JComponent container) {
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();
}
}