當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。