当前位置: 首页>>代码示例>>Java>>正文


Java NodeOp.registerPropertyEditors方法代码示例

本文整理汇总了Java中org.openide.nodes.NodeOp.registerPropertyEditors方法的典型用法代码示例。如果您正苦于以下问题:Java NodeOp.registerPropertyEditors方法的具体用法?Java NodeOp.registerPropertyEditors怎么用?Java NodeOp.registerPropertyEditors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.nodes.NodeOp的用法示例。


在下文中一共展示了NodeOp.registerPropertyEditors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPackageUnregistering

import org.openide.nodes.NodeOp; //导入方法依赖的package包/类
public void testPackageUnregistering() {
    MockLookup.setInstances(new NodesRegistrationSupport.PEPackageRegistration("test1.pkg"));
    NodeOp.registerPropertyEditors();
    MockLookup.setInstances(new NodesRegistrationSupport.PEPackageRegistration("test2.pkg"));
    
    String[] editorSearchPath = PropertyEditorManager.getEditorSearchPath();
    int count = 0;
    for (int i = 0; i < editorSearchPath.length; i++) {
        assertNotSame("test1.pkg", editorSearchPath[i]);
        if ("test2.pkg".equals(editorSearchPath[i])) {
            count++;
        }
    }
    assertEquals(1, count);
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:PELookupTest.java

示例2: doRegisterPropertyEditors

import org.openide.nodes.NodeOp; //导入方法依赖的package包/类
/** Register NB specific property editors.
     *  Allows property editor unit tests to work correctly without 
     *  initializing full NetBeans environment.
     *  @since 1.98 */
    private static final void doRegisterPropertyEditors() {
        //issue 31879
//        if (editorsRegistered) return;
//        String[] syspesp = PropertyEditorManager.getEditorSearchPath();
//        String[] nbpesp = new String[] {
//            "org.netbeans.beaninfo.editors", // NOI18N
//            "org.openide.explorer.propertysheet.editors", // NOI18N
//        };
//        String[] allpesp = new String[syspesp.length + nbpesp.length];
//        System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length);
//        System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length);
//        PropertyEditorManager.setEditorSearchPath(allpesp);
//        PropertyEditorManager.registerEditor (java.lang.Character.TYPE, org.netbeans.beaninfo.editors.CharEditor.class);
//        PropertyEditorManager.registerEditor(String[].class, org.netbeans.beaninfo.editors.StringArrayEditor.class); 
//        // use replacement hintable/internationalizable primitive editors - issues 20376, 5278
//        PropertyEditorManager.registerEditor (Integer.TYPE, org.netbeans.beaninfo.editors.IntEditor.class);
//        PropertyEditorManager.registerEditor (Boolean.TYPE, org.netbeans.beaninfo.editors.BoolEditor.class);
        
        NodeOp.registerPropertyEditors();
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                NodeOp.registerPropertyEditors();
            }
        });

        ProxySelector selector = Lookup.getDefault().lookup(ProxySelector.class);
        if (selector != null) {
            // install java.net.ProxySelector
            ProxySelector.setDefault(selector);
        }

        editorsRegistered = true;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:CoreBridgeImpl.java

示例3: testDuplicateRegistration

import org.openide.nodes.NodeOp; //导入方法依赖的package包/类
public void testDuplicateRegistration() {
    NodeOp.registerPropertyEditors();
    NodeOp.registerPropertyEditors();
    
    int count = 0;
    String[] editorSearchPath = PropertyEditorManager.getEditorSearchPath();
    for (int i = 0; i < editorSearchPath.length; i++) {
        if ("org.netbeans.modules.openide.nodes".equals(editorSearchPath[i])) {
            count++;
        }
    }
    assertFalse("Package path is registered multiple times", count > 1);
    assertFalse("Package path is not registered", count == 0);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:PEAnnotationProcessorTest.java

示例4: testPERegistered

import org.openide.nodes.NodeOp; //导入方法依赖的package包/类
public void testPERegistered() {
    NodeOp.registerPropertyEditors();
    PropertyEditor pEditor = PropertyEditorManager.findEditor(Double[].class);
    assertEquals("org.netbeans.modules.openide.nodes.TestPropertyEditor", pEditor.getClass().getName());
    pEditor = PropertyEditorManager.findEditor(Integer.class);
    assertEquals("org.netbeans.modules.openide.nodes.TestPropertyEditor", pEditor.getClass().getName());
    pEditor = PropertyEditorManager.findEditor(char[][].class);
    assertEquals("org.netbeans.modules.openide.nodes.TestPropertyEditor", pEditor.getClass().getName());
    pEditor = PropertyEditorManager.findEditor(short.class);
    assertEquals("org.netbeans.modules.openide.nodes.TestPropertyEditor", pEditor.getClass().getName());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:PEAnnotationProcessorTest.java

示例5: testBeanInfoRegistration

import org.openide.nodes.NodeOp; //导入方法依赖的package包/类
public void testBeanInfoRegistration() {
    NodeOp.registerPropertyEditors();
    NodeOp.registerPropertyEditors();
    
    int count = 0;
    String[] path = Introspector.getBeanInfoSearchPath();
    for (int i = 0; i < path.length; i++) {
        if ("org.netbeans.modules.openide.nodes".equals(path[i])) {
            count++;
        }
    }
    assertFalse("Package path is registered multiple times", count > 1);
    assertFalse("Package path is not registered", count == 0);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:PEAnnotationProcessorTest.java


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