public class ContextUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ContextUtil.ContextResult
Class for holding the result of a call to the
InteractivePlugin.isInContext(GuiContext, Object)
method. |
static class |
ContextUtil.IsInContextFilter
Filter implementation that works on collections
of
ContextUtil.ContextResult :s and return only those
that return true from ContextUtil.ContextResult.isInContext() . |
Constructor and Description |
---|
ContextUtil() |
Modifier and Type | Method and Description |
---|---|
static List<ContextUtil.ContextResult> |
checkContext(DbControl dc,
ItemQuery<PluginDefinition> pluginQuery,
ItemQuery<PluginConfiguration> configQuery,
GuiContext context,
Object currentItem)
Call the
InteractivePlugin.isInContext(GuiContext, Object) method
for all plug-ins returned by the queries. |
static int |
countUsuablePlugins(Collection<ContextUtil.ContextResult> results)
Count all plug-in / configuration combinations that can be used.
|
static Set<String> |
getContextMessages(Collection<ContextUtil.ContextResult> results,
boolean includeMessage,
boolean includeError)
Get all messages from plug-in / configurations combinations that can't be used.
|
public static List<ContextUtil.ContextResult> checkContext(DbControl dc, ItemQuery<PluginDefinition> pluginQuery, ItemQuery<PluginConfiguration> configQuery, GuiContext context, Object currentItem)
InteractivePlugin.isInContext(GuiContext, Object)
method
for all plug-ins returned by the queries.dc
- The DbControl to use for database accesspluginQuery
- A query returning plugin definition itemsconfigQuery
- A query returning plugin configuration items. The query must
have defined a parameter plugin
which restricts the query
to only return configurations for a particular plugin definitioncontext
- The current contextcurrentItem
- The current item, or null if used from a list contextContextUtil.ContextResult
objectspublic static int countUsuablePlugins(Collection<ContextUtil.ContextResult> results)
results
- A collection of ContextUtil.ContextResult
objectsContextUtil.ContextResult.isInContext()
returns truepublic static Set<String> getContextMessages(Collection<ContextUtil.ContextResult> results, boolean includeMessage, boolean includeError)
results
- A collection of ContextUtil.ContextResult
objectsincludeMessage
- If warning messages should be included or notincludeError
- If error messages should be include or not