Jive API (3.0.13) Core Javadocs

com.jivesoftware.community.widget
Interface Widget

All Known Implementing Classes:
BaseWidget

public interface Widget

All Widgets must implement this interface, which exposes the render(WidgetContext , com.jivesoftware.community.widget.Widget.ContainerSize) method. A widget is responsible for rendering a portable chunk of code that can be installed and executed within any separate HTML-based web page by an end user without requiring additional compilation.

See Also:
WidgetFrame, WidgetManager

Nested Class Summary
static class Widget.ContainerSize
          Enumeration of the size of the parent container.
 
Method Summary
 String getCssClass()
          Returns a custom css class for the widget, or null if a custom css class does not exist.
 String getCustomTitle()
          Returns a custom title that will override the default title when the widget is rendered, or null if a custom title does not exist.
 String getDescription(WidgetContext widgetContext)
          Returns the default description of the widget
 String getFeedURL()
          Returns the location of a feed for this widget or null if no feed exists.
 long getID()
          Gets the internal id of the widget
 String getTitle(WidgetContext widgetContext)
          Returns the default title of the widget
 boolean isEnabled(WidgetContext widgetContext)
          Gives widgets the ability to determine whether or not the widget should be available for end users / administrators to add in a specific widget context.
 boolean isPropertyEnabled(WidgetContext widgetContext, String propertyName)
          Gives widgets the ability to determine whether or not a specific property should be available during editing of the widget by end users / administrators.
 boolean isRefreshable()
          Gives widgets the ability to determine whether or not they can be reloaded via an asynchrounous refresh.
 String render(WidgetContext widgetContext, Widget.ContainerSize size)
          Renders the HTML content of the widget.
 void setCustomTitle(String customTitle)
          Sets a custom title that will override the default title when the widget is rendered.
 void setID(long ID)
          Sets the internal id of the widget
 

Method Detail

getID

long getID()
Gets the internal id of the widget

Returns:
the internal id of the widget

setID

void setID(long ID)
Sets the internal id of the widget

Parameters:
ID - the internal id of the widget

getTitle

String getTitle(WidgetContext widgetContext)
Returns the default title of the widget

Parameters:
widgetContext - the widget context that will be used to get the title
Returns:
the default title of the widget

getCustomTitle

String getCustomTitle()
Returns a custom title that will override the default title when the widget is rendered, or null if a custom title does not exist.

Returns:
a custom title that will override the default title when the widget is rendered, or null if a custom title does not exist.

setCustomTitle

void setCustomTitle(String customTitle)
Sets a custom title that will override the default title when the widget is rendered.

Parameters:
customTitle - a custom title that will override the default title when the widget is rendered.

getDescription

String getDescription(WidgetContext widgetContext)
Returns the default description of the widget

Parameters:
widgetContext - the widget context that will be used to get the description
Returns:
the description of the widget

getCssClass

String getCssClass()
Returns a custom css class for the widget, or null if a custom css class does not exist.

Returns:
a custom css class for the widget, or null if a custom css class does not exist.

getFeedURL

String getFeedURL()
Returns the location of a feed for this widget or null if no feed exists.

Returns:
the location of a feed for this widget or null if no feed exists.

render

String render(WidgetContext widgetContext,
              Widget.ContainerSize size)
Renders the HTML content of the widget.

Parameters:
widgetContext - the widget context that will be used to render this widget
size - the container size to render the widget
Returns:
the HTML content of the widget.

isEnabled

boolean isEnabled(WidgetContext widgetContext)
Gives widgets the ability to determine whether or not the widget should be available for end users / administrators to add in a specific widget context.

Parameters:
widgetContext - the context the widget would be rendered in
Returns:
true if the widget should be available to choose, false otherwise.

isPropertyEnabled

boolean isPropertyEnabled(WidgetContext widgetContext,
                          String propertyName)
Gives widgets the ability to determine whether or not a specific property should be available during editing of the widget by end users / administrators.

Parameters:
widgetContext - the context the widget would be rendered in
propertyName - the property to enable for editing
Returns:
true it the property should be editable, false otherwise.

isRefreshable

boolean isRefreshable()
Gives widgets the ability to determine whether or not they can be reloaded via an asynchrounous refresh. This would be used for widgets where content changes frequently enough that the user could reload the widget individually, rather than do a full page refresh.


Jive Product Page

Copyright © 1999-2007 Jive Software.