org.objectweb.jac.aspects.gui
Class DisplayContext

java.lang.Object
  extended byorg.objectweb.jac.aspects.gui.DisplayContext
All Implemented Interfaces:
EditorContainer

public class DisplayContext
extends Object
implements EditorContainer

This class implements a display context.

A display context contains a display (i.e. means to interact with the user and to create new view in customized vindows), and a customized view (i.e a root window of a GUI).

A display context is passed in the interaction's flow so that each element of the GUI can construct the right GUI elements using the contextual factory. It is a defined as a collaboration attribute used by aspects needing to interact with the GUI (e.g. authentication, confirmation).

See Also:
Collaboration

Constructor Summary
DisplayContext(CustomizedDisplay display, CustomizedView customizedView)
          Construct a new display context from a display and a customized.
DisplayContext(CustomizedDisplay display, Object window)
          Construct a new display context from a display and an existing window that can be of any type.
 
Method Summary
 void addEditor(Object editor)
          Add an editor to the container.
 CustomizedView getCustomizedView()
          Gets the current customized view.
 CustomizedDisplay getDisplay()
          Returns the display for this context.
 List getEditors()
          Get the list of all editors of this container.
 Object getWindow()
          Gets the window for this display context.
 boolean hasEnabledEditor()
          Returns true if at least one editor is enabled.
 void removeEditor(Object editor)
          Remove an editor from the container.
 void setCustomizedView(CustomizedView customizedView)
          Sets the customized of this display context.
 void setShowButtons(boolean value)
          Sets the showButtons property of the container.
 void setWindow(Object window)
          Sets the window for this display context.
 boolean showButtons()
          Gets the value of showButtons
 String toString()
          A default string representation of the display context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisplayContext

public DisplayContext(CustomizedDisplay display,
                      CustomizedView customizedView)
Construct a new display context from a display and a customized.

Parameters:
display - the display
customizedView - the customized

DisplayContext

public DisplayContext(CustomizedDisplay display,
                      Object window)
Construct a new display context from a display and an existing window that can be of any type.

Parameters:
display - the display
window - a window
Method Detail

getDisplay

public CustomizedDisplay getDisplay()
Returns the display for this context.

A display is an GUI entity that is used by the program to interact with the GUI users.

Returns:
the display

getCustomizedView

public CustomizedView getCustomizedView()
Gets the current customized view.

A customized is a root window for a GUI. A GUI may contain several customized.

Returns:
the current customized

setCustomizedView

public void setCustomizedView(CustomizedView customizedView)
Sets the customized of this display context.

Parameters:
customizedView - the new customized

setWindow

public void setWindow(Object window)
Sets the window for this display context.

Parameters:
window - the window

getWindow

public Object getWindow()
Gets the window for this display context.

Returns:
the window

addEditor

public void addEditor(Object editor)
Description copied from interface: EditorContainer
Add an editor to the container.

Specified by:
addEditor in interface EditorContainer

removeEditor

public void removeEditor(Object editor)
Description copied from interface: EditorContainer
Remove an editor from the container.

Specified by:
removeEditor in interface EditorContainer

getEditors

public List getEditors()
Description copied from interface: EditorContainer
Get the list of all editors of this container.

Specified by:
getEditors in interface EditorContainer

hasEnabledEditor

public boolean hasEnabledEditor()
Description copied from interface: EditorContainer
Returns true if at least one editor is enabled.

Specified by:
hasEnabledEditor in interface EditorContainer

setShowButtons

public void setShowButtons(boolean value)
Description copied from interface: EditorContainer
Sets the showButtons property of the container. If true, it will offer a validation mechanism (typically, some OK/Cancel buttons).

Specified by:
setShowButtons in interface EditorContainer

showButtons

public boolean showButtons()
Description copied from interface: EditorContainer
Gets the value of showButtons

Specified by:
showButtons in interface EditorContainer
See Also:
EditorContainer.setShowButtons(boolean)

toString

public String toString()
A default string representation of the display context.