|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.ContextUtil
public class ContextUtil
A class with utility methods for plug-ins.
Nested Class Summary | |
---|---|
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 Summary | |
---|---|
ContextUtil()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContextUtil()
Method Detail |
---|
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 context
ContextUtil.ContextResult
objectspublic static int countUsuablePlugins(Collection<ContextUtil.ContextResult> results)
results
- A collection of ContextUtil.ContextResult
objects
ContextUtil.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
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |