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


Java PropertyEditorManager.getEditorSearchPath方法代码示例

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


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

示例1: testPackageUnregistering

import java.beans.PropertyEditorManager; //导入方法依赖的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: installCorePropertyEditors

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
protected static final void installCorePropertyEditors() {
    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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ExtTestCase.java

示例3: testDuplicateRegistration

import java.beans.PropertyEditorManager; //导入方法依赖的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: main

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:Test4968709.java

示例5: testFindEditor_DifferentPackage

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void testFindEditor_DifferentPackage() {
    String[] original = PropertyEditorManager.getEditorSearchPath();
    PropertyEditorManager
            .setEditorSearchPath(new String[] { "org.apache.harmony.beans.tests.java.beans" });
    PropertyEditor editor = PropertyEditorManager.findEditor(Fozzz.class);
    assertTrue(editor instanceof FozzzEditor);
    assertEquals(FozzzEditor.class, editor.getClass());

    PropertyEditorManager.setEditorSearchPath(original);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:PropertyEditorManagerTest.java

示例6: testGetEditorSearchPath

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void testGetEditorSearchPath() {
    String[] original = PropertyEditorManager.getEditorSearchPath();

    String[] path = new String[] { "java.beans",
            "org.apache.harmony.beans.tests.java.beans.editor", "", };
    PropertyEditorManager.setEditorSearchPath(path);
    String[] newPath = PropertyEditorManager.getEditorSearchPath();

    assertTrue(Arrays.equals(path, newPath));

    PropertyEditorManager.setEditorSearchPath(original);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:PropertyEditorManagerTest.java

示例7: testSetEditorSearchPath_nullpath

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void testSetEditorSearchPath_nullpath() {
    String[] original = PropertyEditorManager.getEditorSearchPath();
    PropertyEditorManager.setEditorSearchPath(new String[] { null });
    assertEquals(1, PropertyEditorManager.getEditorSearchPath().length);
    assertNull(PropertyEditorManager.getEditorSearchPath()[0]);
    assertNull(PropertyEditorManager.findEditor(PropertyEditorManagerTest.class));
    PropertyEditorManager.setEditorSearchPath(original);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:PropertyEditorManagerTest.java

示例8: testGetSetEditorPath

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void testGetSetEditorPath() throws Exception{
  String[] s = new String[]{"path1", "path2"};
  PropertyEditorManager.setEditorSearchPath(s);
  s[1] = "path3";
  String[] s2 = PropertyEditorManager.getEditorSearchPath();
  assertFalse(s==s2);
  assertEquals("path1", s2[0]);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:PropertyEditorManagerTest.java

示例9: testGetEditorSearchPath_default

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void testGetEditorSearchPath_default() {
    String[] path = PropertyEditorManager.getEditorSearchPath();
    assertEquals(1, path.length);
    assertTrue(path[0].endsWith("beans.editors"));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:6,代码来源:PropertyEditorManagerTest.java

示例10: testSetEditorSearchPath_null

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void testSetEditorSearchPath_null() {
    String[] original = PropertyEditorManager.getEditorSearchPath();
    PropertyEditorManager.setEditorSearchPath(null);
    assertEquals(0, PropertyEditorManager.getEditorSearchPath().length);
    PropertyEditorManager.setEditorSearchPath(original);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:PropertyEditorManagerTest.java

示例11: setUp

import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void setUp(){
    defaultSearchPath = PropertyEditorManager.getEditorSearchPath();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:PropertyEditorManagerTest.java


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