Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Links an IlvActionHistory
object to its context.
More...
#include <ilviews/base/action.h>
Public Member Functions | |
IlvActionSelectionHandler () | |
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. Enables, for example, the view to be refreshed after commands have been executed. | |
virtual IlvDisplay * | getDisplay () |
Should be redefined in subclasses to return the current display that could be used by commands that need to access a display. | |
virtual IlvValueInterface *const * | getSelection (IlUInt &count, IlvActionHistory *h) |
Returns the current selection of the document object. More... | |
virtual void | handleError (IlvAction *a) |
Should be redefined in subclasses to define error notification to users or enable error recovery by the document class. More... | |
void | removeFromResult (const IlvValueInterface *r) |
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. Prepares, for example, the view for refresh before commands are executed. | |
void | setResult (IlUInt c, const IlvValueInterface **r) |
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 |
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 |
Should be redefined in subclasses to define error notification to users or enable error recovery by the document class.
a | The action whose execution reports an error. |
void IlvActionSelectionHandler::removeFromResult | ( | const IlvValueInterface * | r | ) |
Removes an object from the result of the execution of a list of commands.
r | The object to be removed from the result. |
void IlvActionSelectionHandler::setResult | ( | IlUInt | c, |
const IlvValueInterface ** | r | ||
) |
Sets 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. |
© Copyright 2012, 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.