本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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]);
}
示例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"));
}
示例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);
}
示例11: setUp
import java.beans.PropertyEditorManager; //导入方法依赖的package包/类
public void setUp(){
defaultSearchPath = PropertyEditorManager.getEditorSearchPath();
}