JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core
Interface Display

All Known Subinterfaces:
CustomizedDisplay
All Known Implementing Classes:
SwingDisplay, WebDisplay

public interface Display

This interface is an abstract description of how a display is defined in org.objectweb.jac.

In JAC, a GUI that needs to allow aspects to interfere with itself (with output and input data) must implement this interface. When the GUI invokes a non-gui object, it must then define the "Gui.display" attribute to be itself so that internal component know what display to use. If this display attribute is not defined by the GUI, then the objects that need display operations can use the default textual display (that uses System.out and System.in for output and input).

See Also:
Collaboration.get(), Collaboration

Method Summary
 void applicationStarted()
          Notifies the display that a new application has just started.
 void close()
          Closes this display.
 void fullRefresh()
          Rebuilds all customized GUI windows.
 String getDisplayID()
          Gets the ID (a unique string identifier) of the current display.
 void newObject(Object newObject)
          Notifies the display that a new object has been created.
 void openView(Object object)
          Shows the given object on the display by opening a new core view.
 void refresh()
          Refresh the display.
 void setDisplayID(String displayID)
          Sets the ID (a unique string identifier) of the current display.
 void show(Object object)
          Shows the given object on the display.
 void showCustomized(String id, Object customized)
          Show a customized Gui.
 void showCustomized(String id, Object customized, Map panels)
          Show a customized Gui.
 void showError(String title, String message)
          Show an error message to the user.
 boolean showInput(Object object, AbstractMethodItem method, Object[] parameters)
          Asks the user to fill the parameters to prepare the invocation of the given method.
 void showMessage(String title, String message)
          Show a message to the user.
 boolean showMessage(String message, String title, boolean canValidate, boolean canCancel, boolean canClose)
          Displays a message to the user.
 boolean showModal(Object object, String viewType, String[] viewParams, String title, String header, Object parent, boolean okButton, boolean cancelButton, boolean closeButton)
           
 boolean showModal(Object object, String title, String header, Object parent, boolean canValidate, boolean canCancel, boolean canClose)
          Shows the given object on the display and waits for a user input.
 

Method Detail

getDisplayID

public String getDisplayID()
Gets the ID (a unique string identifier) of the current display.

Returns:
a string

setDisplayID

public void setDisplayID(String displayID)
Sets the ID (a unique string identifier) of the current display.

Parameters:
displayID - a string (should be unique)

show

public void show(Object object)
Shows the given object on the display.

The showed object is considered as a result.

On contrary to showModal, this method does not stop the client thread execution.

Parameters:
object - the object to show

openView

public void openView(Object object)
Shows the given object on the display by opening a new core view.

On contrary to showModal, this method does not stop the client thread execution.

Parameters:
object - the object to show

showModal

public boolean showModal(Object object,
                         String title,
                         String header,
                         Object parent,
                         boolean canValidate,
                         boolean canCancel,
                         boolean canClose)
Shows the given object on the display and waits for a user input.

On contrary to show, this method stops the client thread execution and waits for a user input to continue (as an OK button click or a key pressing).

Parameters:
object - the object to show
title - the window title if a window is opened
header - a header message
parent - the parent window
canValidate - if true, a validation button is added
canCancel - if true, a cancellation button is added
canClose - if true, a closing button is added
Returns:
false if the user canceled

showModal

public boolean showModal(Object object,
                         String viewType,
                         String[] viewParams,
                         String title,
                         String header,
                         Object parent,
                         boolean okButton,
                         boolean cancelButton,
                         boolean closeButton)

showCustomized

public void showCustomized(String id,
                           Object customized)
Show a customized Gui.

Parameters:
id - the id of the customized GUI to show
customized - the CustomizedGUI to show
See Also:
CustomizedGUI

showCustomized

public void showCustomized(String id,
                           Object customized,
                           Map panels)
Show a customized Gui.

Parameters:
id - the id of the customized GUI to show
customized - the CustomizedGUI to show
panels - contents of panels ( panelID -> object)
See Also:
CustomizedGUI

fullRefresh

public void fullRefresh()
Rebuilds all customized GUI windows.


showInput

public boolean showInput(Object object,
                         AbstractMethodItem method,
                         Object[] parameters)
Asks the user to fill the parameters to prepare the invocation of the given method.

This operation stops the client thread.

Parameters:
object - the object that contains the method (null if a constructor)
parameters - the parameters values; as an input, they can be set by the client to fill default values for these parameters; as an output, they must be used by the client as the actual parameter values to call the given method
Returns:
false if the user canceled

refresh

public void refresh()
Refresh the display.

This method is useful for some kind of displays when the refresh operation cannot be done automatically when the displayed objects states change (e.g. a web display).

See Also:
WebDisplay

newObject

public void newObject(Object newObject)
Notifies the display that a new object has been created.

Depending on the display's nature and functionality, this notification can simply be ignored.

Parameters:
newObject - the newly created object

showMessage

public boolean showMessage(String message,
                           String title,
                           boolean canValidate,
                           boolean canCancel,
                           boolean canClose)
Displays a message to the user.

Parameters:
title - the window title if a window is opened
canValidate - if true, a validation button is added
canCancel - if true, a cancellation button is added
canClose - if true, a closing button is added
Returns:
false if the user canceled

showMessage

public void showMessage(String title,
                        String message)
Show a message to the user.

See Also:
showError(String,String)

showError

public void showError(String title,
                      String message)
Show an error message to the user.

See Also:
showMessage(String,String)

applicationStarted

public void applicationStarted()
Notifies the display that a new application has just started.

At this step, all the root objects of the application have been created and it is time to open the main view if any.


close

public void close()
Closes this display.


Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli