/** * Returns the plugin definition associated with the specified class. * * @param clazz The class whose plugin definition is sought. * @return The associated plugin definition, or null if not found. */ public static PluginDefinition getDefinition(Class<? extends ElementBase> clazz) { return PluginRegistry.getInstance().get(clazz); }
/** * Lookup a plugin definition by its id. Raises a runtime exception if the plugin is not found. * * @param id Plugin id. * @return The plugin definition. */ private PluginDefinition pluginById(String id) { PluginDefinition def = pluginRegistry.get(id); if (def == null) { throw new PluginException(EXC_UNKNOWN_PLUGIN, null, null, id); } return def; }
/** * Returns the plugin definition associated with the specified xml tag (same as plugin id). * * @param tag XML tag (plugin id). * @return The associated plugin definition, or null if not found. */ public static PluginDefinition getDefinition(String tag) { return PluginRegistry.getInstance().get(tag); }
public PluginDefinition unregister(Class<? extends ElementBase> clazz) { return unregister(get(clazz)); }
private LayoutElement() { super("layout", null, PluginRegistry.getInstance().get("_desktop")); }
/** * Sets the plugin definition based on the specified class. Typically this would be the same * class as the element itself, but in certain cases (as in the ElementProxy class) it is not. * * @param clazz The UI element class. */ public void setDefinition(Class<? extends ElementBase> clazz) { setDefinition(PluginRegistry.getInstance().get(clazz)); }
private PluginDefinition getDefinition(String type, Element node) { type = type != null ? type : getRequiredAttribute(node, "_type"); PluginDefinition pluginDefinition = PluginRegistry.getInstance().get(type); if (pluginDefinition == null) { throw new IllegalArgumentException("Unrecognized " + node.getTagName() + " type: " + type); } return pluginDefinition; }