com.sas.util
Interface ContextCommandsInterface

All Known Implementing Classes:
CommandManager, PopupMenuAdapter, PopupMenuAdapter, TableView, TreeView, TreeView

public interface ContextCommandsInterface

Defines an interface for context command producers. A context command producer is an object that yields a set of commands based on a given context. The nature of the context is defined by the implementation.

Context commands are usually presented via context sensitive, i.e. popup, menus -- menus that vary based on location within a visual component. For example, a table view might have a different menu, or set of commands, depending on whether the current selection is a cell, column, or row.

An example implementation might accept a bar chart component as a context, query the chart for the particular bar identified by the given x-y location, and return commands specific to that bar.

See Also:
CommandsInterface, ContextInterface, ContextCommandsConsumerInterface

Method Summary
 com.sas.util.Command[] getContextCommands(java.lang.Object context, int x, int y)
          Returns a list of commands associated with a given context.
 

Method Detail

getContextCommands

com.sas.util.Command[] getContextCommands(java.lang.Object context,
                                          int x,
                                          int y)
Returns a list of commands associated with a given context. The list may contain sublists by making one of the items a menu command.

Parameters:
context - The context to return commands for. Each implemenation should define the contexts it accepts.
x - The horizontal coordinate of the location within the visual coordinate space of the context for which the caller would like commands. For example, if this method is being called in response to a mouse click, then x would be the x-position of the click. If the caller doesn't have a location in mind, -1 should be specified. Note that some implementations will find that x is not necessary, so are free to ignore it with appropriate documentation.
y - The vertical coordinate of the location within the visual coordinate space of the context for which the caller would like commands. For example, if this method is being called in response to a mouse click, then y would be the y-position of the click. If the caller doesn't have a location in mind, -1 should be specified. Note that some implementations will find that y is not necessary, so are free to ignore it with appropriate documentation.
Returns:
An array of commands.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.