java.beans.beancontext.BeanContext Java Examples

The following examples show how to use java.beans.beancontext.BeanContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SerialDataNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void init() {
    try {
        InstanceCookie ic = (InstanceCookie) dobj.getCookie(InstanceCookie.class);
        if (ic == null) {
            bean = null;
            return;
        }
        Class<?> clazz = ic.instanceClass();
        if (BeanContext.class.isAssignableFrom(clazz)) {
            bean = ic.instanceCreate();
        } else if (BeanContextProxy.class.isAssignableFrom(clazz)) {
            bean = ((BeanContextProxy) ic.instanceCreate()).getBeanContextProxy();
        } else {
            bean = null;
        }
    } catch (Exception ex) {
        bean = null;
        Exceptions.printStackTrace(ex);
    }
    if (bean != null) {
        // attaches a listener to the bean
        ((BeanContext) bean).addBeanContextMembershipListener (contextL);
    }
    updateKeys();
}
 
Example #2
Source File: SerialDataNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Create nodes for a given key.
 * @param key the key
 * @return child nodes for this key or null if there should be no
 *   nodes for this key
 */
protected Node[] createNodes(Object key) {
    Object ctx = bean;
    if (bean == null) return new Node[0];
    
    try {
        if (key instanceof BeanContextSupport) {
            BeanContextSupport bcs = (BeanContextSupport)key;

            if (((BeanContext) ctx).contains (bcs.getBeanContextPeer())) {
                // sometimes a BeanContextSupport occures in the list of
                // beans children even there is its peer. we think that
                // it is desirable to hide the context if the peer is
                // also present
                return new Node[0];
            }
        }

        return new Node[] { new BeanContextNode (key, task) };
    } catch (IntrospectionException ex) {
        // ignore the exception
        return new Node[0];
    }
}
 
Example #3
Source File: BeanContextMembershipEvent.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Contruct a BeanContextMembershipEvent
 *
 * @param bc        The BeanContext source
 * @param changes   The Children affected
 * @throws NullPointerException if {@code changes} is {@code null}
 */

@SuppressWarnings("rawtypes")
public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
    super(bc);

    if (changes == null) throw new NullPointerException(
        "BeanContextMembershipEvent constructor:  changes is null.");

    children = changes;
}
 
Example #4
Source File: Test4652928.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static BeanContext fill(BeanContext context) {
    context.add(new JLabel("label"));
    context.add(new JButton("button"));

    JButton button = new JButton();
    button.setText("another button");
    context.add(button);

    return context;
}
 
Example #5
Source File: Test4652928.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static BeanContext fill(BeanContext context) {
    context.add(new JLabel("label"));
    context.add(new JButton("button"));

    JButton button = new JButton();
    button.setText("another button");
    context.add(button);

    return context;
}
 
Example #6
Source File: Test4652928.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static BeanContext fill(BeanContext context) {
    context.add(new JLabel("label"));
    context.add(new JButton("button"));

    JButton button = new JButton();
    button.setText("another button");
    context.add(button);

    return context;
}
 
Example #7
Source File: BeanContextMembershipEvent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Contruct a BeanContextMembershipEvent
 *
 * @param bc        The BeanContext source
 * @param changes   The Children affected
 * @throws NullPointerException if <CODE>changes</CODE> is <CODE>null</CODE>
 */

@SuppressWarnings("rawtypes")
public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
    super(bc);

    if (changes == null) throw new NullPointerException(
        "BeanContextMembershipEvent constructor:  changes is null.");

    children = changes;
}
 
Example #8
Source File: Test4652928.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static BeanContext fill(BeanContext context) {
    context.add(new JLabel("label"));
    context.add(new JButton("button"));

    JButton button = new JButton();
    button.setText("another button");
    context.add(button);

    return context;
}
 
Example #9
Source File: BeanContextMembershipEvent.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Contruct a BeanContextMembershipEvent
 *
 * @param bc        The BeanContext source
 * @param changes   The Children affected
 * @throws NullPointerException if {@code changes} is {@code null}
 */

@SuppressWarnings("rawtypes")
public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
    super(bc);

    if (changes == null) throw new NullPointerException(
        "BeanContextMembershipEvent constructor:  changes is null.");

    children = changes;
}
 
Example #10
Source File: ControlWsdlLocator.java    From hop with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new wsdl locator for the wsdl file with the specified name.
 *
 * @param wsdlName    Name of the WSDL file to try to load. Name may include file path elements.
 * @param beanContext The ControlBeanContext of the control which wants to load a WSDL file.
 */
public ControlWsdlLocator( String wsdlName, BeanContext beanContext ) {

  if ( wsdlName == null ) {
    throw new IllegalArgumentException( "ERROR: WSDL path is null!" );
  }

  _wsdlName = wsdlName;
  _beanContext = beanContext;
}
 
Example #11
Source File: BeanContextMembershipEvent.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Contruct a BeanContextMembershipEvent
 *
 * @param bc        The BeanContext source
 * @param changes   The Children affected
 * @throws NullPointerException if <CODE>changes</CODE> is <CODE>null</CODE>
 */

@SuppressWarnings("rawtypes")
public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
    super(bc);

    if (changes == null) throw new NullPointerException(
        "BeanContextMembershipEvent constructor:  changes is null.");

    children = changes;
}
 
Example #12
Source File: Test4652928.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static BeanContext fill(BeanContext context) {
    context.add(new JLabel("label"));
    context.add(new JButton("button"));

    JButton button = new JButton();
    button.setText("another button");
    context.add(button);

    return context;
}
 
Example #13
Source File: SerialDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static Children getChildren (Object bean, SerialDataNode task) {
    if (bean instanceof BeanContext)
        return new BeanChildren ((BeanContext)bean, new BeanFactoryImpl(task));
    if (bean instanceof BeanContextProxy) {
        java.beans.beancontext.BeanContextChild bch = ((BeanContextProxy)bean).getBeanContextProxy();
        if (bch instanceof BeanContext)
            return new BeanChildren ((BeanContext)bch, new BeanFactoryImpl(task));
    }
    return Children.LEAF;
}
 
Example #14
Source File: BeanNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static Children getChildren(Object bean) {
    if (bean instanceof BeanContext) {
        return new BeanChildren((BeanContext) bean);
    }

    if (bean instanceof BeanContextProxy) {
        BeanContextChild bch = ((BeanContextProxy) bean).getBeanContextProxy();

        if (bch instanceof BeanContext) {
            return new BeanChildren((BeanContext) bch);
        }
    }

    return Children.LEAF;
}
 
Example #15
Source File: Test4652928.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected List getObject() {
    List<BeanContext> list = new ArrayList<BeanContext>();
    list.add(fill(new BeanContextSupport()));
    list.add(fill(new BeanContextServicesSupport()));
    return list;
}
 
Example #16
Source File: Beans.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
    beanContext.add(res);
}
 
Example #17
Source File: Beans.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
    beanContext.add(res);
}
 
Example #18
Source File: Test4132698.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public Test4132698(BeanContext bc, Object[] objects) {
    super(bc, objects);
}
 
Example #19
Source File: Test4132698.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Test4132698(BeanContext bc, Object[] objects) {
    super(bc, objects);
}
 
Example #20
Source File: Test4652928.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected List getObject() {
    List<BeanContext> list = new ArrayList<BeanContext>();
    list.add(fill(new BeanContextSupport()));
    list.add(fill(new BeanContextServicesSupport()));
    return list;
}
 
Example #21
Source File: Test4132698.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Test4132698(BeanContext bc, Object[] objects) {
    super(bc, objects);
}
 
Example #22
Source File: Beans.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
    beanContext.add(res);
}
 
Example #23
Source File: Beans.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
    beanContext.add(res);
}
 
Example #24
Source File: Beans.java    From Java8CN with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
    beanContext.add(res);
}
 
Example #25
Source File: Beans.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
    beanContext.add(res);
}
 
Example #26
Source File: Test4652928.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected List getObject() {
    List<BeanContext> list = new ArrayList<BeanContext>();
    list.add(fill(new BeanContextSupport()));
    list.add(fill(new BeanContextServicesSupport()));
    return list;
}
 
Example #27
Source File: Test4652928.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected List getObject() {
    List<BeanContext> list = new ArrayList<BeanContext>();
    list.add(fill(new BeanContextSupport()));
    list.add(fill(new BeanContextServicesSupport()));
    return list;
}
 
Example #28
Source File: Test4132698.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Test4132698(BeanContext bc, Object[] objects) {
    super(bc, objects);
}
 
Example #29
Source File: Test4132698.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Test4132698(BeanContext bc, Object[] objects) {
    super(bc, objects);
}
 
Example #30
Source File: JPDAThreadImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void setBeanContext(BeanContext bc) throws PropertyVetoException {
    throw new UnsupportedOperationException("Not supported, do not call. Implementing BeanContextChild interface just because of add/remove PropertyChangeListener.");
}