public final class Contexts extends Object
browser context
. Start with Contexts.newBuilder()
and then assign technologies with Contexts.Builder.register(java.lang.Class, java.lang.Object, int)
method.Modifier and Type | Class and Description |
---|---|
static class |
Contexts.Builder
Support for providers of new
BrwsrCtx . |
static interface |
Contexts.Id
Identifies the technologies passed to
context builder
by a name. |
static interface |
Contexts.Provider
Implementors of various HTML technologies should
register their implementation via
org.openide.util.lookup.ServiceProvider , so
ServiceLoader can find them, when their JARs are included
on the classpath of the running application. |
Modifier and Type | Method and Description |
---|---|
static boolean |
fillInByProviders(Class<?> requestor,
Contexts.Builder cb)
Seeks
ServiceLoader for all registered instances of
Contexts.Provider and asks them to fill
the builder . |
static <Tech> Tech |
find(BrwsrCtx context,
Class<Tech> technology)
Seeks for the specified technology in the provided context.
|
static Contexts.Builder |
newBuilder()
Creates new, empty builder for creation of
BrwsrCtx . |
static Contexts.Builder |
newBuilder(Object... context)
Creates new, empty builder for creation of
BrwsrCtx . |
public static Contexts.Builder newBuilder(Object... context)
BrwsrCtx
. At the
end call the Contexts.Builder.build()
method to generate the context.context
- instances of various classes or names of technologies
to be preferred and used in the built context
.public static Contexts.Builder newBuilder()
BrwsrCtx
. At the
end call the Contexts.Builder.build()
method to generate the context.
Simply calls newBuilder(new Object[0])
.public static <Tech> Tech find(BrwsrCtx context, Class<Tech> technology)
Tech
- type of the technologycontext
- the context to seek in
(previously filled with (Contexts.Builder.register(java.lang.Class, java.lang.Object, int)
)technology
- class that identifies the technologynull
public static boolean fillInByProviders(Class<?> requestor, Contexts.Builder cb)
ServiceLoader
for all registered instances of
Contexts.Provider
and asks them to fill
the builder
.requestor
- the application class for which to find the contextcb
- the context builder to register technologies intotrue
, if some instances of the provider were
found, false
otherwiseCopyright © 2018 NetBeans. All rights reserved.