net.sf.doolin.gui.action.support
Class DelegateDataActionContext

java.lang.Object
  extended by net.sf.doolin.gui.action.support.DelegateDataActionContext
All Implemented Interfaces:
ActionContext

public class DelegateDataActionContext
extends Object
implements ActionContext

This action context wraps another action context but provides its own data.

Author:
Damien Coraboeuf

Constructor Summary
DelegateDataActionContext(ActionContext delegate, Object data)
          Constructor
 
Method Summary
 GUIApplication getApplication()
          Gets the running application
 JComponent getComponent()
          Gets the component associated with this context.
 Object getContext()
          Gets any contextual information linked to this context.
 Object getData()
          Gets the data associated with this context.
 SubscriberValidator getSubscriberValidator()
          Gets the validator to use for any subscription managed by this context.
<V> ValidationSupport<V>
getValidationSupport()
          Gets the validation support for this action context
<T> GUIView<T>
getView()
          Gets the view associated to this content
<T> GUIWindow<T>
getWindow()
          Gets the window associated to this content
 void setContext(Object value)
          Sets the contextual value of this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegateDataActionContext

public DelegateDataActionContext(ActionContext delegate,
                                 Object data)
Constructor

Parameters:
delegate - Delegate action context
data - Data to provide
Method Detail

getApplication

public GUIApplication getApplication()
Description copied from interface: ActionContext
Gets the running application

Specified by:
getApplication in interface ActionContext
Returns:
Application (never null)

getComponent

public JComponent getComponent()
Description copied from interface: ActionContext
Gets the component associated with this context.

Specified by:
getComponent in interface ActionContext
Returns:
Component

getContext

public Object getContext()
Description copied from interface: ActionContext
Gets any contextual information linked to this context. While the context data cannot change (only its content), the contextual data can change at any time.

Specified by:
getContext in interface ActionContext
Returns:
Contextual information or null if none has been defined.

getData

public Object getData()
Description copied from interface: ActionContext
Gets the data associated with this context.

Specified by:
getData in interface ActionContext
Returns:
Model

getSubscriberValidator

public SubscriberValidator getSubscriberValidator()
Description copied from interface: ActionContext
Gets the validator to use for any subscription managed by this context. The returned validator will return false as soon as this ActionContext is no longer valid.

Specified by:
getSubscriberValidator in interface ActionContext
Returns:
Validator

getValidationSupport

public <V> ValidationSupport<V> getValidationSupport()
Description copied from interface: ActionContext
Gets the validation support for this action context

Specified by:
getValidationSupport in interface ActionContext
Type Parameters:
V - Type of the bean that is managed by the validation support. It should be the same than the one associated with the window or the view.
Returns:
Validation support

getView

public <T> GUIView<T> getView()
Description copied from interface: ActionContext
Gets the view associated to this content

Specified by:
getView in interface ActionContext
Type Parameters:
T - Type of model for the view
Returns:
View or null if no view is associated to this context

getWindow

public <T> GUIWindow<T> getWindow()
Description copied from interface: ActionContext
Gets the window associated to this content

Specified by:
getWindow in interface ActionContext
Type Parameters:
T - Type of model for the window
Returns:
Window or null is no window can be associated with this context.

setContext

public void setContext(Object value)
Description copied from interface: ActionContext
Sets the contextual value of this context.

Specified by:
setContext in interface ActionContext
Parameters:
value - New contextual value


Copyright © 2011. All Rights Reserved.