com.softwareag.cis.plugin.command.context
Class AbstractCommandContext

java.lang.Object
  extended by com.softwareag.cis.plugin.command.context.AbstractCommandContext
All Implemented Interfaces:
CommandContext
Direct Known Subclasses:
GlobalCommandContext

public abstract class AbstractCommandContext
extends java.lang.Object
implements CommandContext

Context for command execution


Field Summary
static java.lang.String rcs_id
           
 
Constructor Summary
AbstractCommandContext(com.softwareag.cis.workplace.MFWorkplaceAdapter mfworkplaceadapter)
           
 
Method Summary
 void execute(Command command)
          Execute given command in this context
 ApplicationContext getApplicationContext()
          Obtain the ApplicationContext
 com.softwareag.cis.server.Adapter getDisplayAdapter()
          Get a living adapter which is used by Application Designer for display processing.
 Item getItem()
          Get selected item
 java.util.Locale getLocale()
          Get Locale to be used in this context
 com.softwareag.cis.workplace.MFWorkplaceAdapter getWorkplaceAdapter()
          Obtain the workplace adapter
static com.softwareag.cis.workplace.MFWorkplaceAdapter getWorkplaceAdapter(com.softwareag.cis.server.Adapter adapter)
          Returns the MFWorkplaceAdapter obtained from the session context
 void openPageInTarget(java.lang.String url, java.lang.String target)
          Open given external URL in given target frame
 void sendError(java.lang.String text)
          Display an error message
 boolean showImageForCommand()
          Command is executed with a CommandContext.
 void showMessage(java.lang.String title, java.lang.String msg)
          Display message in popup dialog
 void showThrowable(java.lang.String title, java.lang.String msg, java.lang.Throwable t)
          Display any Throwable which occured during processing
 void showThrowable(java.lang.Throwable t)
          Display any Throwable which occured during processing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcs_id

public static final java.lang.String rcs_id
See Also:
Constant Field Values
Constructor Detail

AbstractCommandContext

public AbstractCommandContext(com.softwareag.cis.workplace.MFWorkplaceAdapter mfworkplaceadapter)
Method Detail

getWorkplaceAdapter

public static com.softwareag.cis.workplace.MFWorkplaceAdapter getWorkplaceAdapter(com.softwareag.cis.server.Adapter adapter)
Returns the MFWorkplaceAdapter obtained from the session context

Parameters:
adapter - from which the session context is obtained
Returns:
MFWorkplaceAdapter

getApplicationContext

public ApplicationContext getApplicationContext()
Obtain the ApplicationContext

Specified by:
getApplicationContext in interface CommandContext
Returns:
the ApplicationContext (may be null for command line application)

getWorkplaceAdapter

public com.softwareag.cis.workplace.MFWorkplaceAdapter getWorkplaceAdapter()
Obtain the workplace adapter

Returns:
the workplace adapter

getLocale

public java.util.Locale getLocale()
Get Locale to be used in this context

Specified by:
getLocale in interface CommandContext
Returns:
the Locale

getItem

public Item getItem()
Get selected item

Specified by:
getItem in interface CommandContext
Returns:
the selected item or null, if none selected

getDisplayAdapter

public com.softwareag.cis.server.Adapter getDisplayAdapter()
Get a living adapter which is used by Application Designer for display processing. The adapter being returned must e.g. be usable to open a new popup.

Returns:
the adapter

execute

public void execute(Command command)
Execute given command in this context

Specified by:
execute in interface CommandContext
Parameters:
command -

openPageInTarget

public void openPageInTarget(java.lang.String url,
                             java.lang.String target)
Open given external URL in given target frame

Specified by:
openPageInTarget in interface CommandContext
Parameters:
url - the URL to be opend
target - the target frame

sendError

public void sendError(java.lang.String text)
Display an error message

Specified by:
sendError in interface CommandContext
Parameters:
text - Text to display

showThrowable

public void showThrowable(java.lang.Throwable t)
Display any Throwable which occured during processing

Specified by:
showThrowable in interface CommandContext
Parameters:
t - the Throwable

showThrowable

public void showThrowable(java.lang.String title,
                          java.lang.String msg,
                          java.lang.Throwable t)
Display any Throwable which occured during processing

Specified by:
showThrowable in interface CommandContext
Parameters:
title -
msg -
t - the Throwable

showMessage

public void showMessage(java.lang.String title,
                        java.lang.String msg)
Display message in popup dialog

Specified by:
showMessage in interface CommandContext
Parameters:
title -
msg -

showImageForCommand

public boolean showImageForCommand()
Description copied from interface: CommandContext
Command is executed with a CommandContext. Override this method to enable or disable showing of Icons for Commands.

Specified by:
showImageForCommand in interface CommandContext