public interface GadgetViewFactory
ViewComponents for gadgets. A host
application should use this for embedding individual gadgets in the desired locations by
creating a view and then calling the ViewComponent.writeTo(java.io.Writer) method.| Modifier and Type | Method and Description |
|---|---|
boolean |
canRenderInViewType(GadgetState state,
ViewType viewType,
GadgetRequestContext gadgetRequestContext)
Returns
true if the gadget represented by state can be rendered with the given ViewType for
the locale specified in the GadgetRequestContext. |
ViewComponent |
createGadgetView(GadgetState state,
ModuleId moduleId,
View view,
GadgetRequestContext gadgetRequestContext)
Returns a
ViewComponent that will render the GadgetState, customizing the view based on the
Locale specified in the GadgetRequestContext and the desired ViewType. |
ViewComponent |
createGadgetView(GadgetState state,
View view,
GadgetRequestContext gadgetRequestContext)
|
@Deprecated ViewComponent createGadgetView(GadgetState state, View view, GadgetRequestContext gadgetRequestContext) throws GadgetParsingException, GadgetRenderingException
createGadgetView(com.atlassian.gadgets.GadgetState, ModuleId, View, com.atlassian.gadgets.GadgetRequestContext)Returns a ViewComponent that will render the GadgetState, customizing the view based
on the Locale specified in the GadgetRequestContext and the desired ViewType.
This can be used by host applications to place gadgets anywhere they choose.
state - state of the gadget to be rendered by the ViewComponentview - desired View to use when rendering the gadgetgadgetRequestContext - context info for this request
to make changes to the gadget state; false if the gadget is read-only for the current viewerViewComponent that will render the GadgetStateGadgetParsingException - thrown if there is a problem parsing the gadget specGadgetRenderingException - thrown if the gadget does not define a <Content> section for the
viewViewComponent createGadgetView(GadgetState state, ModuleId moduleId, View view, GadgetRequestContext gadgetRequestContext) throws GadgetParsingException, GadgetRenderingException
ViewComponent that will render the GadgetState, customizing the view based on the
Locale specified in the GadgetRequestContext and the desired ViewType.
state - state of the gadget to be rendered by the ViewComponentmoduleId - the moduleId to use in the gadget view. Should be unique for the HTML page that the
gadget will be rendered inview - desired View to use when rendering the gadgetgadgetRequestContext - context info for this request to make changes to the gadget state; false if
the gadget is read-only for the current viewerViewComponent that will render the GadgetStateGadgetParsingException - thrown if there is a problem parsing the gadget specGadgetRenderingException - thrown if the gadget does not define a <Content> section for the viewboolean canRenderInViewType(GadgetState state, ViewType viewType, GadgetRequestContext gadgetRequestContext) throws GadgetParsingException
true if the gadget represented by state can be rendered with the given ViewType for
the locale specified in the GadgetRequestContext.state - state of the gadget to check if we can renderviewType - view type to check the gadget can be rendered ingadgetRequestContext - the context of this requesttrue if the gadget can be rendered with the view in the locale, false
otherwiseGadgetParsingException - thrown if there is a problem parsing the gadget specCopyright © 2024 Atlassian. All rights reserved.