Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Links an IlvActionHistory
object to its context.
More...
#include <ilviews/base/action.h>
Public Member Functions | |
IlvActionSelectionHandler () | |
virtual | ~IlvActionSelectionHandler () |
Destructor. | |
void | addToResult (IlUInt c, const IlvValueInterface **r) |
Adds an object to the result of the execution of a list of commands. More... | |
virtual void | commit () |
Called after a list of commands has been executed. More... | |
virtual IlvDisplay * | getDisplay () |
Returns the display instance of this handler. More... | |
virtual IlvValueInterface *const * | getSelection (IlUInt &count, IlvActionHistory *h) |
Returns the current selection of the document object. More... | |
virtual void | handleError (IlvAction *action) |
Handles an error returned by an action. More... | |
void | removeFromResult (const IlvValueInterface *result) |
Removes an object from the result of the execution of a list of commands. More... | |
virtual void | reset () |
Called before a list of commands is about to be executed. More... | |
void | setResult (IlUInt n, const IlvValueInterface **result) |
Sets the result of the execution of a list of commands. More... | |
Links an IlvActionHistory
object to its context.
Library: views
IlvActionSelectionHandler
objects handle contextual information related to an action (or command) and its associated document or IlvManager
.
You should not derive the class IlvActionHistory
to implement a history handling mechanism specific to a document class (such as a manager or a container command history). Instead, you should derive for a given document class a customized selection handler that links the action history to its context. The class IlvActionHistory
should be derived only to implement special operations specific to the manipulation of IlvCommand
and IlvAction
objects. Examples of these special commands are smart repeat, log command histories, reading a list of commands, recording macros to perform a series of actions, and so on.
Similarly, you should consider implementing observers for the action history instead of creating a subclass to implement new features. For example, the modified
flag for the manager is handled by an observer rather than by a specialized subclass of command history.
Objects that handle an attached IlvActionHistory
should create a subclass of IlvActionSelectionHandler
that implements the document-specific features of action history handling, and attach it to an IlvActionHistory
with the method IlvActionHistory::setSelectionHandler()
.
IlvActionHistory
, IlvCommand
, IlvCommandHistory
. IlvActionSelectionHandler::IlvActionSelectionHandler | ( | ) |
Constructor
void IlvActionSelectionHandler::addToResult | ( | IlUInt | c, |
const IlvValueInterface ** | r | ||
) |
Adds an object to the result of the execution of a list of commands.
r | An array of objects representing the result of the list of commands. The array is copied. |
c | The number of objects in r. |
|
virtual |
Called after a list of commands has been executed.
Enables, for example, the view to be refreshed after commands have been executed.
|
virtual |
Returns the display instance of this handler.
This method should be redefined in subclasses to return the current display that may be used by commands that need to access a display.
|
virtual |
Returns the current selection of the document object.
For example, the special IlvActionSelectionHandler
attached to an IlvManager
class will return the result of IlvManager::getSelection()
.
Other classes of documents can implement their own selection mechanism, allowing commands that are repeated to retrieve their parameters from the current selection.
count | This parameter is set to the number of returned objects. |
h | The action history associated with this IlvSelectionHandler . |
|
virtual |
Handles an error returned by an action.
This method should be redefined in subclasses to define error notification to users or enable error recovery by the document class.
action | The action whose execution reports an error. |
void IlvActionSelectionHandler::removeFromResult | ( | const IlvValueInterface * | result | ) |
Removes an object from the result of the execution of a list of commands.
result | The object to be removed from the result. |
|
virtual |
Called before a list of commands is about to be executed.
Prepares, for example, the view for refresh before commands are executed.
void IlvActionSelectionHandler::setResult | ( | IlUInt | n, |
const IlvValueInterface ** | result | ||
) |
Sets the result of the execution of a list of commands.
result | An array of objects representing the result of the list of commands. The array is copied. |
n | The number of objects in result. |
© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.