Refine search
/** Lazy create default NB classloader for use during deserialization. */ private static ClassLoader getNBClassLoader() { ClassLoader c = Lookup.getDefault().lookup(ClassLoader.class); return (c != null) ? c : ClassLoader.getSystemClassLoader(); }
/** * Displays the help page in a supported viewer, if any. * @return true if this help was displayed successfully * @since 8.21 * @see org.openide.util.HelpCtx.Displayer#display */ public boolean display() { for (Displayer d : Lookup.getDefault().lookupAll(Displayer.class)) { if (d.display(this)) { return true; } } return false; }
/** @return default class loader which is used, when we don't have * any other class loader. (in function getBundle(String), getLocalizedFile(String), * and so on... */ private static ClassLoader getLoader() { ClassLoader c = Lookup.getDefault().lookup(ClassLoader.class); return (c != null) ? c : ClassLoader.getSystemClassLoader(); }
layerUrls.add(generatedLayer); for (LayerProvider p : Lookup.getDefault().lookupAll(LayerProvider.class)) { List<URL> newURLs = new ArrayList<URL>(); p.registerLayers(newURLs);
private static ClassLoader loader() { ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class); if (l == null) { l = FOItem.class.getClassLoader(); } return l; }
public @Override ModuleInfo ownerOf(Class<?> clazz) { for (ModuleInfo module : Lookup.getDefault().lookupAll(ModuleInfo.class)) { if (module.owns(clazz)) { return module; } } return null; }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { ois.defaultReadObject(); if (l == null) { l = Lookup.getDefault().lookup(ClassLoader.class); } clazz = Class.forName(clazzName, false, l); }
/** * Displays the help page in a supported viewer, if any. * @return true if this help was displayed successfully * @since 8.21 * @see org.openide.util.HelpCtx.Displayer#display */ public boolean display() { for (Displayer d : Lookup.getDefault().lookupAll(Displayer.class)) { if (d.display(this)) { return true; } } return false; }
/** Loads a class of given name * @param name name of the class * @return the class * @exception ClassNotFoundException if class was not found */ public static Class findClass(String name) throws ClassNotFoundException { ClassLoader c = Lookup.getDefault().lookup(ClassLoader.class); if (c == null) { return Class.forName(name); } else { return Class.forName(name, true, c); } }
private static Collection<? extends CndFileExistSensitiveCache> getCaches() { if (listeners == null) { listeners = Lookup.getDefault().lookupAll(CndFileExistSensitiveCache.class); } return listeners; } }
/** Returns the <code>hostname</code> part of network proxy address * based on given URI to access the resource at. * Returns <code>null</code> for direct connection. * * @param u The URI that a connection is required to * @return the hostname part of the Proxy address or <code>null</code> */ public static String getProxyHost(URI u) { ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); if (provider == null) { LOGGER.warning("No ProxyCredentialsProvider found in lookup " + Lookup.getDefault() + " thus no proxy information will provide!"); } return provider == null ? null : provider.getProxyHost(u); }
/** Returns enumeration of all registered indentation engines. * @return enumeration of IndentEngine */ public static Enumeration<? extends IndentEngine> indentEngines() { return Collections.enumeration(Lookup.getDefault().lookupAll(IndentEngine.class)); }
/** Returns the <code>port</code> part of network proxy address * based on given URI to access the resource at. * Returns <code>null</code> for direct connection. * * @param u The URI that a connection is required to * @return the port part of the Proxy address or <code>null</code> */ public static String getProxyPort(URI u) { ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); if (provider == null) { LOGGER.warning("No ProxyCredentialsProvider found in lookup " + Lookup.getDefault() + " thus no proxy information will provide!"); } return provider == null ? null : provider.getProxyPort(u); }
public static ProjectTypeInfo getProjectTypeInfoFor (String projectType) { for (ProjectTypeInfo info : Lookup.getDefault ().lookupAll (ProjectTypeInfo.class)) if (info.projectType.equals (projectType)) return info; return null; }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { object = (Node) ois.readObject(); interfaces = new WeakHashMap<Class,Object>(); String clazz; ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class); while ((clazz = (String) ois.readObject()) != null) { Object o = ois.readObject(); if (!(o instanceof Collection) && !(o instanceof AbstractLookup.Pair)) { throw new ClassCastException(String.valueOf(o)); } Class c = Class.forName(clazz, false, l); interfaces.put(c, o); } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public Set<GeoCoder> findAllGeoCoders() { return new HashSet<GeoCoder>(Lookup.getDefault().lookupAll(GeoCoder.class)); }
/** Returns the <code>key</code> for reading password for Proxy Authentication. * Use <a href="@org-netbeans-modules-keyring@/org/netbeans/api/keyring/Keyring.html"><code>org.netbeans.api.keyring.Keyring</code></a> for reading the password from the ring. * Returns <code>null</code> if no authentication required. * * @param u The URI that a connection is required to * @return the key for reading password for Proxy Authentication from the ring or <code>null</code> */ public static String getKeyForAuthenticationPassword(URI u) { ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); if (provider == null) { LOGGER.warning("No ProxyCredentialsProvider found in lookup " + Lookup.getDefault() + " thus no proxy information will provide!"); } if (provider != null && provider.isProxyAuthentication(u)) { return PROXY_AUTHENTICATION_PASSWORD; } return null; }
private synchronized PackageRenameHandler getRenameHandler() { Collection<? extends PackageRenameHandler> handlers = Lookup.getDefault().lookupAll(PackageRenameHandler.class); if (handlers.size()==0) return null; if (handlers.size()>1) LOG.warning("Multiple instances of PackageRenameHandler found in Lookup; only using first one: " + handlers); //NOI18N return handlers.iterator().next(); }
/** Gets the default implementation from lookup. * @return the presenter */ public static ActionPresenterProvider getDefault () { ActionPresenterProvider ap = Lookup.getDefault().lookup(ActionPresenterProvider.class); return ap == null ? new Default () : ap; }
private static synchronized RenameHandler getRenameHandler() { Collection<? extends RenameHandler> handlers = (Lookup.getDefault().lookupAll(RenameHandler.class)); if (handlers.isEmpty()) { return null; } if (handlers.size() > 1) { LOG.log(Level.WARNING, "Multiple instances of RenameHandler found in Lookup; only using first one: {0}", handlers); //NOI18N } return handlers.iterator().next(); } private static final Logger LOG = Logger.getLogger(SourceDataNode.class.getName());