com.ibm.mashups.enabler.widget
Interface WidgetModel

All Superinterfaces:
Commitable, com.ibm.mashups.enabler.DirtyFlagProvider, Discardable, Locator, Model

public WidgetModel
extends Commitable, Model, Locator, Discardable, com.ibm.mashups.enabler.DirtyFlagProvider

This interface provides a model for widgets. It exposes widget definitions, instances, and windows. You may create widget instances based on definitions and remove widget instances.

The widget model supports the following strategies:


Method Summary
 Deferred find(Identifiable id)
           Returns the widget definition specified with the id.
 Deferred findWidgetWindow(String windowID, String pageID)
           Returns the widget window for the specified windowID and pageID.
 Deferred getWidgetDefinitionByWindow(WidgetWindow window)
           Returns the widget definition specified with the widget window
 Deferred getWidgetDefinitionByInstance(WidgetInstance instance)
           Returns the widget definition specified with the widget instance
 Deferred getWidgetWindow(LayoutControl control)
           Returns the widget window of the specified layout control.
 boolean isWidgetWindowCached(String id)
           Returns true in case the WidgetWindow identified by id is cached in this model.
 Deferred getWidgetInstance(WidgetWindow window)
           Returns the widget instance of the specified widget window.
 Deferred getHierarchicalPreferences(PreferencesProvider preferenceProvider)
           Gets hierarchical preferences of the specified PreferenceProvider down to the levels.
 Deferred getHierarchicalEventProvider(EventProvider eventProvider)
           Gets the hierarchical EventProvider for the specified EventProvider down to the levels.
 
Methods inherited from interface com.ibm.mashups.enabler.Commitable
isDirty, commit
 
Methods inherited from interface com.ibm.mashups.enabler.model.Model
setStrategy, getStrategies, getStrategy, addStrategy, removeStrategy
 
Methods inherited from interface com.ibm.mashups.enabler.Locator
find
 
Methods inherited from interface com.ibm.mashups.enabler.Discardable
discard
 

Method Detail

find

Deferred find(Identifiable id)
Returns the widget definition specified with the id.

Parameters:
id - of the widget definition
Returns:
a deferred object used to start this operation, never null. The return value when executed through the deferred object is a WidgetDefinition for the given Identifiable or null if no widget definition is found.
Since:
2.4

findWidgetWindow

Deferred findWidgetWindow(String windowID,
                          String pageID)
Returns the widget window for the specified windowID and pageID.

Parameters:
windowID - the ID of the window to lookup
pageID - the page ID of the window to lookup
Returns:
a deferred object used to start this operation, never null. The return value when executed through the deferred object is a WidgetWindow for the given IDs or null if no widget window is found.
Since:
3.0

getWidgetDefinitionByWindow

Deferred getWidgetDefinitionByWindow(WidgetWindow window)
Returns the widget definition specified with the widget window

Parameters:
window - the widget window
Returns:
a deferred object used to start this operation, never null. The return value when executed through the deferred object is a WidgetDefinition for the given WidgetWindow or null if no widget definition is found.
Since:
2.4

getWidgetDefinitionByInstance

Deferred getWidgetDefinitionByInstance(WidgetInstance instance)
Returns the widget definition specified with the widget instance

Parameters:
instance - the widget instance
Returns:
a deferred object used to start this operation, never null. The return value when executed through the deferred object is a WidgetDefinition for the given WidgetInstance or null if no widget definition is found.
Since:
2.4

getWidgetWindow

Deferred getWidgetWindow(LayoutControl control)
Returns the widget window of the specified layout control.

Parameters:
control - the layout control
Returns:
a deferred object used to start this operation, never null. The return value when executed through the deferred object is a WidgetWindow for the given LayoutControl or null if no widget window is found.
Since:
2.4

isWidgetWindowCached

boolean isWidgetWindowCached(String id)
Returns true in case the WidgetWindow identified by id is cached in this model. false otherwise.

Parameters:
id - the identifier of the window
Returns:
true in case the window is cached false otherwise.
Since:
3.0, 3.0

getWidgetInstance

Deferred getWidgetInstance(WidgetWindow window)
Returns the widget instance of the specified widget window.

Parameters:
window - the widget window
Returns:
a deferred object used to start this operation, never null. The return value when executed through the deferred object is a WidgetInstance for the given WidgetWindow or null if no widget instance is found.
Since:
2.4

getHierarchicalPreferences

Deferred getHierarchicalPreferences(PreferencesProvider preferenceProvider)
Gets hierarchical preferences of the specified PreferenceProvider down to the levels. This means, that the preferences of each level (definition, instance and window) will be aggregated, depending on which preference provider you provided as argument.

Parameters:
preferenceProvider - the preference provider from which to aggregate preferences down.
Returns:
returns an MModifiablePreferences object, that represents the aggregated preferences down to the lowest level, starting on the preference level of the given PreferenceProvider
Since:
2.4

getHierarchicalEventProvider

Deferred getHierarchicalEventProvider(EventProvider eventProvider)
Gets the hierarchical EventProvider for the specified EventProvider down to the levels. This means, that the events of each level (definition, instance and window) will be aggregated, depending on which event provider you provided as argument and then be accessible through the retuned eventprovider.

Parameters:
eventProvider - the event provider from which to aggregate events down.
Returns:
returns an ModifiableEventProvider providing the aggregated events down to the lowest level, starting on the event level of the given EventProvider
Since:
2.4


Copyright IBM Corp. 2010 All Rights Reserved.