org.objectweb.jac.aspects.gui
Class Actions

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.Actions

public class Actions
extends Object

This class is a container of commonly used GUI actions static methods.

Usually, a GUI action takes in parameter the display context. Using the context, is can then know the customized window to use to interact with the users. When an action does not take any display context, it means that it does not need any interaction with the GUI or that the display context is retrieved throught the collaboration.


Constructor Summary
Actions()
           
 
Method Summary
static void exit(DisplayContext context)
          Quit the application by shutting down the server.
static String getFileIcon(File file)
           
static Collection getLoggerNames(Object substance)
          Returns all known logger names
static Collection getLoggers(ClassItem cli)
          Returns all known loggers
static Collection getLogLevels(ClassItem cli)
          Returns all known log levels
static Collection getMimeTypes(MetaItem cli)
           
static String getOpenViewIcon(MethodItem method, Object object, Object[] parameters)
           
static void invoke(Object object, String methodName)
          Invokes a method on an object.
static void logout(DisplayContext context)
          Logout from an application by clearing the current user.
static void openView(DisplayContext context, String objectName)
          Display an object in a new window
static void reloadAspect(String aspect)
          Reloads an aspect for the current application
static void setTrace(String loggerName, org.apache.log4j.Level level)
          Changes a trace for the current application
static void showStatus(String message)
          Shows a message on the status bar of the current customized.
static void showWindow(DisplayContext context, String id)
          Show a customized window that has been declared and configured within the GUI aspect.
static void viewObject(DisplayContext context, String objectName, String panelID)
          Display an object in a panel.
static void viewObject2(DisplayContext context, String objectName, String viewName, String panelID)
          Display an object in a panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Actions

public Actions()
Method Detail

exit

public static void exit(DisplayContext context)
Quit the application by shutting down the server.

Parameters:
context - the display context for this action

logout

public static void logout(DisplayContext context)
Logout from an application by clearing the current user. If an authentication aspect is woven, the user is asked again.

Parameters:
context - the display context for this action

showStatus

public static void showStatus(String message)
Shows a message on the status bar of the current customized. If no display context available, then println is used.

Parameters:
message - the message to show

showWindow

public static void showWindow(DisplayContext context,
                              String id)
Show a customized window that has been declared and configured within the GUI aspect.

Parameters:
context - the display context for this action
id - the customized ID

invoke

public static void invoke(Object object,
                          String methodName)
Invokes a method on an object.


viewObject2

public static void viewObject2(DisplayContext context,
                               String objectName,
                               String viewName,
                               String panelID)
Display an object in a panel.

Parameters:
context - the DisplayContext of the custmoized view
objectName - the name of the object to display
panelID - the panel ID where to display the object
See Also:
viewObject(DisplayContext,String,String), openView(DisplayContext,String)

viewObject

public static void viewObject(DisplayContext context,
                              String objectName,
                              String panelID)
Display an object in a panel.

Parameters:
context - the DisplayContext of the custmoized view
objectName - the name of the object to display
panelID - the panel ID where to display the object
See Also:
viewObject2(DisplayContext,String,String,String), openView(DisplayContext,String)

openView

public static void openView(DisplayContext context,
                            String objectName)
Display an object in a new window

Parameters:
context - the DisplayContext of the custmoized view
objectName - the name of the object to display
See Also:
viewObject2(DisplayContext,String,String,String), viewObject(DisplayContext,String,String)

getOpenViewIcon

public static String getOpenViewIcon(MethodItem method,
                                     Object object,
                                     Object[] parameters)

getFileIcon

public static String getFileIcon(File file)

setTrace

public static void setTrace(String loggerName,
                            org.apache.log4j.Level level)
Changes a trace for the current application

Parameters:
loggerName - category of the trace
level - level of the trace

getLoggerNames

public static Collection getLoggerNames(Object substance)
Returns all known logger names


getLoggers

public static Collection getLoggers(ClassItem cli)
Returns all known loggers


getLogLevels

public static Collection getLogLevels(ClassItem cli)
Returns all known log levels


getMimeTypes

public static Collection getMimeTypes(MetaItem cli)

reloadAspect

public static void reloadAspect(String aspect)
                         throws Exception
Reloads an aspect for the current application

Exception