• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BeanContextChild类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中java.beans.beancontext.BeanContextChild的典型用法代码示例。如果您正苦于以下问题:Java BeanContextChild类的具体用法?Java BeanContextChild怎么用?Java BeanContextChild使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BeanContextChild类属于java.beans.beancontext包,在下文中一共展示了BeanContextChild类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addComponent

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
private void addComponent(int x, int y) {
  if (m_toolBarBean instanceof MetaBean) {
    // need to add the MetaBean's internal connections
    // to BeanConnection's vector
    Vector<BeanConnection> associatedConnections = ((MetaBean) m_toolBarBean)
      .getAssociatedConnections();
    BeanConnection.getConnections(m_mainKFPerspective.getCurrentTabIndex())
      .addAll(associatedConnections);

    // ((MetaBean)m_toolBarBean).setXDrop(x);
    // ((MetaBean)m_toolBarBean).setYDrop(y);
    ((MetaBean) m_toolBarBean)
      .addPropertyChangeListenersSubFlow(KnowledgeFlowApp.this);
  }

  if (m_toolBarBean instanceof BeanContextChild) {
    m_bcSupport.add(m_toolBarBean);
  }
  BeanInstance bi = new BeanInstance(m_beanLayout, m_toolBarBean, x, y,
    m_mainKFPerspective.getCurrentTabIndex());
  // addBean((JComponent)bi.getBean());
  m_toolBarBean = null;
  addComponent(bi, true);
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:25,代码来源:KnowledgeFlowApp.java


示例2: addComponent

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
private void addComponent(int x, int y) {
  if (m_toolBarBean instanceof MetaBean) {
    // need to add the MetaBean's internal connections
    // to BeanConnection's vector
    Vector associatedConnections = 
      ((MetaBean)m_toolBarBean).getAssociatedConnections();
    BeanConnection.getConnections(m_mainKFPerspective.getCurrentTabIndex()).
    addAll(associatedConnections);

    //((MetaBean)m_toolBarBean).setXDrop(x);
    //((MetaBean)m_toolBarBean).setYDrop(y);
    ((MetaBean)m_toolBarBean).addPropertyChangeListenersSubFlow(KnowledgeFlowApp.this);
  }

  if (m_toolBarBean instanceof BeanContextChild) {
    m_bcSupport.add(m_toolBarBean);
  }
  BeanInstance bi = new BeanInstance(m_beanLayout, m_toolBarBean, x, y, 
      m_mainKFPerspective.getCurrentTabIndex());
  //    addBean((JComponent)bi.getBean());
  m_toolBarBean = null;
  addComponent(bi, true);
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:24,代码来源:KnowledgeFlowApp.java


示例3: getAddToBeanContext

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
/**
 * Layer method, enhanced to check if the PlugIn is interested in being
 * added to the BeanContext.
 */
public boolean getAddToBeanContext() {
    boolean ret = false;
    if (plugin != null
            &&

            (plugin instanceof BeanContextChild || plugin instanceof BeanContextMembershipListener)) {

        if (plugin instanceof AbstractPlugIn) {
            ret = ((AbstractPlugIn) plugin).getAddToBeanContext();
        } else {
            ret = true;
        }

    } else {
        ret = super.getAddToBeanContext();
    }

    if (Debug.debugging("plugin")) {
        Debug.output(getName() + ".addToBeanContext is " + ret);
    }

    return ret;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:28,代码来源:PlugInLayer.java


示例4: removePlugInFromBeanContext

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
/**
 * Gets the current BeanContext from itself, if it's been set and the
 * provided PlugIn wants/can be added to the BeanContext, it assumes it was
 * and removes it from the BeanContext.
 */
public void removePlugInFromBeanContext(PlugIn pi) {
    BeanContext bc = getBeanContext();

    if (bc != null
            && pi != null
            &&

            (pi instanceof BeanContextChild || (pi instanceof AbstractPlugIn && ((AbstractPlugIn) pi).getAddToBeanContext()))) {

        // Of course, we don't need all these conditions met to
        // order the removal, but they are the ones in place that would
        // cause it to be added, so we don't waste the effort
        // unless the same conditions are met.
        bc.remove(pi);
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:22,代码来源:PlugInLayer.java


示例5: testAdd_BCC

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testAdd_BCC() {
    MockBeanContextSupport support = new MockBeanContextSupport();
    MockBeanContextMembershipListener l1 = new MockBeanContextMembershipListener();
    MockPropertyChangeListener l2 = new MockPropertyChangeListener();
    MockVetoableChangeListener l3 = new MockVetoableChangeListener();
    support.addBeanContextMembershipListener(l1);
    support.addPropertyChangeListener("children", l2);
    support.addVetoableChangeListener("children", l3);

    BeanContextChild child = new MockBeanContextChild();
    support.add(child);
    support.records.assertRecord("initialize", null);
    support.records.assertRecord("validatePendingAdd", child, Boolean.TRUE);
    support.records.assertRecord("createBCSChild", child, null, support
            .children().get(child));
    support.records.assertRecord("childJustAddedHook", child, support
            .children().get(child), null);
    support.records.assertEndOfRecords();
    assertTrue(l1.lastEventAdd);
    assertMembershipEvent(l1.lastEvent, support, null, child);
    assertNull(l2.lastEvent);
    assertNull(l3.lastEvent);

    assertSame(support, child.getBeanContext());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:BeanContextSupportTest.java


示例6: testGetChildBeanContextChild_BeanContextChild

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testGetChildBeanContextChild_BeanContextChild() {
    MockBeanContextChild child = new MockBeanContextChild();
    BeanContextChild result = MockBeanContextSupport
            .publicGetChildBeanContextChild(child);
    assertSame(child, result);

    // Regression for HARMONY-1393
    class TestBeanException extends BeanContextChildSupport implements
            BeanContextProxy {
        private static final long serialVersionUID = -8544245159647566063L;
        private final BeanContextChildSupport childSupport = new BeanContextChildSupport();

        public BeanContextChild getBeanContextProxy() {
            return childSupport;
        }
    }
    TestBeanException bean = new TestBeanException();
    try {
        MockBeanContextSupport.publicGetChildBeanContextChild(bean);
        fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
        // expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:25,代码来源:BeanContextSupportTest.java


示例7: addComponent

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
private void addComponent(int x, int y) {
  if (m_toolBarBean instanceof MetaBean) {
    // need to add the MetaBean's internal connections
    // to BeanConnection's vector
    Vector associatedConnections = ((MetaBean) m_toolBarBean)
        .getAssociatedConnections();
    BeanConnection.getConnections().addAll(associatedConnections);
  }

  if (m_toolBarBean instanceof BeanContextChild) {
    m_bcSupport.add(m_toolBarBean);
  }
  BeanInstance bi = new BeanInstance(m_beanLayout, m_toolBarBean, x, y);
  // addBean((JComponent)bi.getBean());
  m_toolBarBean = null;
  addComponent(bi, true);
}
 
开发者ID:williamClanton,项目名称:jbossBA,代码行数:18,代码来源:KnowledgeFlowApp.java


示例8: testIsDelegated

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testIsDelegated() throws Exception {
    BeanContextChildSupport support = new MockBeanContextChildSupport();
    assertFalse(support.isDelegated());

    BeanContextChild mockChild = new MockBeanContextChild();
    support = new MockBeanContextChildSupport(mockChild);
    assertTrue(support.isDelegated());

    support.beanContextChildPeer = support;
    assertFalse(support.isDelegated());

    BeanContextChildSupport sup = new BeanContextChildSupport();

    assertFalse("Child is not supposed to be delegated",
            sup.isDelegated());
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:BeanContextChildSupportTest.java


示例9: testGetServiceException

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
/**
 * @see java.beans.beancontext.BeanContextServicesSupport#getService()
 */
public Result testGetServiceException()    throws Exception {

    BeanContextChild child = null;
    Object requestor = null;
    Class serviceClass = null;
    Object serviceSelector = null;
    BeanContextServiceRevokedListener bcsrl = null;
    BeanContextServicesSupport context = new BeanContextServicesSupport();
    serviceBean = null;

    try {
        context.getService(child, requestor ,serviceClass,serviceSelector,bcsrl);
    } catch (NullPointerException e) {

        return passed();
    }
    return failed("testGetServiceException");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:22,代码来源:TestBeanContextServicesSupportException.java


示例10: testReleaseServiceException

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
/**
 * @see java.beans.beancontext.BeanContextServicesSupport#releaseService()
 */
public Result testReleaseServiceException()    throws Exception {

    BeanContextChild child = null;
    Object requestor = null;
    Object service = null;
    BeanContextServicesSupport context = new BeanContextServicesSupport();
    serviceBean = null;

    try {
        context.releaseService(child, requestor ,service);
    } catch (NullPointerException e) {
    
        return passed();
    }
    return failed("testGetServiceException");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:20,代码来源:TestBeanContextServicesSupportException.java


示例11: annotateCurrentPosition

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
private void annotateCurrentPosition(final JPDAThread currentThread,
                                     final SourcePath sourcePath,
                                     final CallStackFrame csf, final String language,
                                     final String url, final int lineNumber) {
    final Runnable updateCurrentAnnotation = new Runnable () {
        @Override
        public void run () {
            // show current line
            synchronized (currentPCLock) {
                if (currentPC != null)
                    EditorContextBridge.getContext().removeAnnotation (currentPC);
                if (csf != null && sourcePath != null && currentThread != null && url != null && lineNumber >= 0) {
                    // annotate current line
                    currentPC = sourcePath.annotate (currentThread, language, url, lineNumber);
                } else {
                    currentPC = null;
                }
            }
        }
    };
    PropertyChangeListener operationsUpdateListener = new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            String name = evt.getPropertyName();
            if (PROP_OPERATIONS_UPDATE.equals(name)) {
                SwingUtilities.invokeLater (updateCurrentAnnotation);
            }
            if (PROP_OPERATIONS_SET.equals(name)) {
                ((BeanContextChild) currentThread).removePropertyChangeListener(PROP_OPERATIONS_UPDATE, this);
                ((BeanContextChild) currentThread).removePropertyChangeListener(PROP_OPERATIONS_SET, this);
            }
        }
    };
    ((BeanContextChild) currentThread).addPropertyChangeListener(PROP_OPERATIONS_UPDATE, operationsUpdateListener);
    ((BeanContextChild) currentThread).addPropertyChangeListener(PROP_OPERATIONS_SET, operationsUpdateListener);
    SwingUtilities.invokeLater (updateCurrentAnnotation);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:CurrentThreadAnnotationListener.java


示例12: getChildren

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:BeanNode.java


示例13: main

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public static void main(String[] args) {
    for (int i = 0; i < 10; i++) {
        BeanContextServices container = new BeanContextServicesSupport();
        BeanContextChild ms1 = new MyService1();
        BeanContextServices ms2 = new MyService2();
        BeanContextChild mb = new MyBean();

        container.add(ms1);
        container.add(ms2);
        ms2.add(mb);

        // exception thrown here
        container.remove(ms2);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:Test4328406.java


示例14: addPlugInToBeanContext

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
/**
 * Gets the current BeanContext from itself, if it's been set and the
 * provided PlugIn wants/can be added to the BeanContext, it will be added..
 */
public void addPlugInToBeanContext(PlugIn pi) {
    BeanContext bc = getBeanContext();

    if (bc != null
            && pi != null
            &&

            (pi instanceof BeanContextChild || (pi instanceof AbstractPlugIn && ((AbstractPlugIn) pi).getAddToBeanContext()))) {

        bc.add(pi);
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:17,代码来源:PlugInLayer.java


示例15: MockBeanContextChildSupport

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
/**
 * @param bcc
 */
public MockBeanContextChildSupport(BeanContextChild bcc) {
    super(bcc);
    assertNull(this.beanContext);
    assertSame(bcc, this.beanContextChildPeer);
    assertFalse(this.rejectedSetBCOnce);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:BeanContextChildSupportTest.java


示例16: testGetBeanContextChildPeer

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testGetBeanContextChildPeer() throws Exception {
    BeanContextChildSupport support = new MockBeanContextChildSupport();
    assertSame(support, support.beanContextChildPeer);
    assertSame(support, support.getBeanContextChildPeer());

    BeanContextChild mockChild = new MockBeanContextChild();
    support = new MockBeanContextChildSupport(mockChild);
    assertSame(mockChild, support.beanContextChildPeer);
    assertSame(mockChild, support.getBeanContextChildPeer());

    BeanContextChildSupport sup = new BeanContextChildSupport();

    assertEquals(sup, sup.getBeanContextChildPeer());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:BeanContextChildSupportTest.java


示例17: testIsDelegated

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testIsDelegated() throws Exception {
    BeanContextChildSupport support = new MockBeanContextChildSupport();
    assertFalse(support.isDelegated());

    BeanContextChild mockChild = new MockBeanContextChild();
    support = new MockBeanContextChildSupport(mockChild);
    assertTrue(support.isDelegated());

    support.beanContextChildPeer = support;
    assertFalse(support.isDelegated());

    BeanContextChildSupport sup = new BeanContextChildSupport();

    assertFalse("Child is not supposed to be delegated", sup.isDelegated());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:BeanContextChildSupportTest.java


示例18: testAdd_BCP

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testAdd_BCP() {
    MockBeanContextSupport support = new MockBeanContextSupport();
    support.waitOnChildInHooks = false;
    MockBeanContextMembershipListener l1 = new MockBeanContextMembershipListener();
    MockPropertyChangeListener l2 = new MockPropertyChangeListener();
    MockVetoableChangeListener l3 = new MockVetoableChangeListener();
    support.addBeanContextMembershipListener(l1);
    support.addPropertyChangeListener("children", l2);
    support.addVetoableChangeListener("children", l3);

    BeanContextChild childPeer = new MockBeanContextChild();
    BeanContextProxy child = new MockBeanContextProxy(childPeer);
    support.add(child);
    support.records.assertRecord("initialize", null);
    support.records.assertRecord("validatePendingAdd", child, Boolean.TRUE);
    support.records.assertRecord("createBCSChild", child, childPeer,
            support.children().get(child));
    support.records.assertRecord("createBCSChild", childPeer, child,
            support.children().get(childPeer));
    support.records.assertRecord("childJustAddedHook", child, support
            .children().get(child), null);
    support.records.assertRecord("childJustAddedHook", childPeer, support
            .children().get(childPeer), null);
    support.records.assertEndOfRecords();
    assertTrue(l1.lastEventAdd);
    assertMembershipEvent(l1.lastEvent, support, null, Arrays
            .asList(new Object[] { child, childPeer }));
    assertNull(l2.lastEvent);
    assertNull(l3.lastEvent);

    assertSame(support, childPeer.getBeanContext());
    assertEquals(2, support.size());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:34,代码来源:BeanContextSupportTest.java


示例19: testAdd_Veto

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testAdd_Veto() {
    MockBeanContextSupport support = new MockBeanContextSupport();
    MockBeanContextMembershipListener l1 = new MockBeanContextMembershipListener();
    MockPropertyChangeListener l2 = new MockPropertyChangeListener();
    MockVetoableChangeListener l3 = new MockVetoableChangeListener();
    support.addBeanContextMembershipListener(l1);
    support.addPropertyChangeListener("children", l2);
    support.addVetoableChangeListener("children", l3);

    support.vetoAddRemove = true;
    BeanContextChild child = new MockBeanContextChild();
    try {
        support.add(child);
        fail();
    } catch (IllegalStateException e) {
        // expected
    }
    support.records.assertRecord("initialize", null);
    support.records
            .assertRecord("validatePendingAdd", child, Boolean.FALSE);
    support.records.assertEndOfRecords();
    assertNull(l1.lastEvent);
    assertNull(l2.lastEvent);
    assertNull(l3.lastEvent);

    assertNull(child.getBeanContext());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:28,代码来源:BeanContextSupportTest.java


示例20: testGetChildBeanContextChild_BeanContextProxy

import java.beans.beancontext.BeanContextChild; //导入依赖的package包/类
public void testGetChildBeanContextChild_BeanContextProxy() {
    MockBeanContextChild child = new MockBeanContextChild();
    MockBeanContextProxy proxy = new MockBeanContextProxy(child);
    BeanContextChild result = MockBeanContextSupport
            .publicGetChildBeanContextChild(proxy);
    assertSame(child, result);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:BeanContextSupportTest.java



注:本文中的java.beans.beancontext.BeanContextChild类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MultilayerPerceptron类代码示例发布时间:2022-05-21
下一篇:
Java InputStreamImageInputStreamSpi类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap