本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}