org.objectweb.jac.aspects.gui
Interface View

All Superinterfaces:
ViewIdentity
All Known Subinterfaces:
CollectionView, CompositeView, CustomizedView, DialogView, FieldEditor, FieldView, MenuView, MethodView, PanelView, ReferenceEditor, StatusView, TableCellViewer, TabsView, WindowView
All Known Implementing Classes:
AbstractCollection, AbstractCollection, AbstractCompositeView, AbstractCompositeView, AbstractFieldEditor, AbstractFieldEditor, AbstractFieldView, AbstractFileEditor, AbstractMenu, AbstractPage, AbstractView, AbstractView, AttachmentViewer, AttachmentViewer, BooleanEditor, BooleanEditor, BooleanViewer, CurrencyViewer, Customized, DesktopView, Dialog, Dialog, EmbeddedMethod, EnumViewer, FileEditor, FilePathEditor, FormatEditor, FormatViewer, ImageURLEditor, ImageURLViewer, ImageViewer, IndicesSelector, Menu, Menu, MenuBar, MenuBar, Method, ObjectChooser, ObjectChooser, Panel, PasswordFieldEditor, PointEditor, PrimitiveFieldEditor, ReferenceView, ReferenceView, RefreshPage, StatusBar, StatusBar, SwingCustomized, SwingEmptyView, SwingFieldView, SwingLabel, SwingMethodView, SwingPanelView, SwingTabbedView, Tabs, TextEditor, TextViewer, ToolBar, ToolBar, Tree, Tree, URLEditor, URLEditor

public interface View
extends ViewIdentity


Method Summary
 void close(boolean validate)
          Close this view.
 DisplayContext getContext()
           
 String getDescription()
          Gets the description of this view.
 ViewFactory getFactory()
          Gets the factory.
 String getLabel()
          Gets the view's label (identifier).
 MethodItem getMessage()
          Gets the dynamic message.
 View getParentView()
          Gets the parent view of this view.
 View getRootView()
          Gets the ancestor view whose parent is null
 String getStyle()
          Gets the user-defined style for this view.
 Border getViewBorder()
          Gets the border for this view.
 boolean isClosed()
          Tells if this view has been closed by the GUI or the user.
 boolean isDescendantOf(View ancestor)
          Tells wether this view has a given view in its ancestors
 void setContext(DisplayContext context)
          Sets the display context for this view.
 void setDescription(String description)
          Sets a static message to be display by the view when opened.
 void setFactory(ViewFactory factory)
          Sets the factory for this view (WEB, SWING or other supported factory).
 void setFocus(FieldItem field, Object option)
          Focus a field of an object's view.
 void setLabel(String label)
          Sets the label (the identifier) of the view.
 void setMessage(MethodItem method)
          Sets a dynamic message to be displayed by the view when opened.
 void setParentView(View view)
          Sets the parent view of this view (a composite view).
 void setSize(Length width, Length height)
          Sets the preferred size for this view.
 void setStyle(String style)
          Sets the view style.
 void setViewBorder(Border border)
          Sets a border for this view.
 
Methods inherited from interface org.objectweb.jac.aspects.gui.ViewIdentity
equalsView, equalsView, getParameters, getType, setParameters, setType
 

Method Detail

setLabel

public void setLabel(String label)
Sets the label (the identifier) of the view.

Parameters:
label - a string that identifies the view

getLabel

public String getLabel()
Gets the view's label (identifier).

Returns:
the view's label

setMessage

public void setMessage(MethodItem method)
Sets a dynamic message to be displayed by the view when opened.

Parameters:
method - the method that returns a string to be dislayed
See Also:
setDescription(String)

getMessage

public MethodItem getMessage()
Gets the dynamic message.

Returns:
the dynamic message

setDescription

public void setDescription(String description)
Sets a static message to be display by the view when opened.

Parameters:
description - a string to be displayed as is
See Also:
setMessage(MethodItem)

getDescription

public String getDescription()
Gets the description of this view.

Returns:
the description

setContext

public void setContext(DisplayContext context)
Sets the display context for this view.

The display context contains the factory that is used for this view.


getContext

public DisplayContext getContext()
Returns:
the DisplayContext of the view

setFactory

public void setFactory(ViewFactory factory)
Sets the factory for this view (WEB, SWING or other supported factory).


getFactory

public ViewFactory getFactory()
Gets the factory.


setSize

public void setSize(Length width,
                    Length height)
Sets the preferred size for this view.

Parameters:
width - the preferred width. If null, the preferred width is not changed.
height - the preferred height. If null, the preferred height is not changed.

close

public void close(boolean validate)
Close this view. This should be upcalled when the view is closed in order to free resources or close other dependant views.

Parameters:
validate - wether to validate any value contained in editors.

isClosed

public boolean isClosed()
Tells if this view has been closed by the GUI or the user.


setStyle

public void setStyle(String style)
Sets the view style. The style can be exploited in different maners depending on the GUI supports (e.g. with CSS for the WEB). Styles are user-defined.


getStyle

public String getStyle()
Gets the user-defined style for this view.

Returns:
the style, null if undefined

setViewBorder

public void setViewBorder(Border border)
Sets a border for this view.


getViewBorder

public Border getViewBorder()
Gets the border for this view.

Returns:
the border, null if undefined

setParentView

public void setParentView(View view)
Sets the parent view of this view (a composite view).

See Also:
CompositeView

getParentView

public View getParentView()
Gets the parent view of this view.

See Also:
CompositeView

getRootView

public View getRootView()
Gets the ancestor view whose parent is null


isDescendantOf

public boolean isDescendantOf(View ancestor)
Tells wether this view has a given view in its ancestors

Parameters:
ancestor - the ancestor

setFocus

public void setFocus(FieldItem field,
                     Object option)
Focus a field of an object's view.

Parameters:
field - the field to focus
option - an extra option