BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Command to copy an item. More...
Classes | |
struct | CopyItemCommandImpl |
Public Member Functions | |
CopyItemCommand (const SessionItem *item, SessionItem *parent, TagRow tagrow) | |
~CopyItemCommand () override | |
std::string | description () const |
Returns command description. More... | |
void | execute () |
Execute command. More... | |
bool | isObsolete () const |
Returns whether the command is obsolete (which means that it shouldn't be kept in the stack). More... | |
CommandResult | result () const |
void | undo () |
Undo command as it was before execution. More... | |
Protected Member Functions | |
SessionItem * | itemFromPath (const Path &path) const |
SessionModel * | model () const |
Path | pathFromItem (SessionItem *item) const |
void | setDescription (const std::string &text) |
Sets command description. More... | |
void | setObsolete (bool flag) |
Sets command obsolete flag. More... | |
void | setResult (const CommandResult &command_result) |
Private Member Functions | |
void | execute_command () override |
void | undo_command () override |
Private Attributes | |
std::unique_ptr< CopyItemCommandImpl > | p_impl |
Command to copy an item.
Definition at line 27 of file copyitemcommand.h.
CopyItemCommand::CopyItemCommand | ( | const SessionItem * | item, |
SessionItem * | parent, | ||
TagRow | tagrow | ||
) |
Definition at line 37 of file copyitemcommand.cpp.
References ModelView::CreateItemBackupStrategy(), ModelView::CreateItemCopyStrategy(), ModelView::SessionItem::model(), ModelView::SessionItem::modelType(), p_impl, ModelView::AbstractItemCommand::pathFromItem(), ModelView::AbstractItemCommand::setDescription(), and ModelView::AbstractItemCommand::setResult().
|
overridedefault |
|
inherited |
Returns command description.
Definition at line 87 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
|
inherited |
Execute command.
Definition at line 56 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::execute_command(), and ModelView::AbstractItemCommand::p_impl.
Referenced by TEST_F().
|
overrideprivatevirtual |
Implements ModelView::AbstractItemCommand.
Definition at line 61 of file copyitemcommand.cpp.
References ModelView::AbstractItemCommand::itemFromPath(), p_impl, ModelView::AbstractItemCommand::result(), ModelView::AbstractItemCommand::setObsolete(), and ModelView::AbstractItemCommand::setResult().
|
inherited |
Returns whether the command is obsolete (which means that it shouldn't be kept in the stack).
Definition at line 80 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
Referenced by ModelView::AbstractItemCommand::AbstractItemCommandImpl::can_undo(), and TEST_F().
|
protectedinherited |
Definition at line 116 of file abstractitemcommand.cpp.
References ModelView::Utils::ItemFromPath(), and ModelView::AbstractItemCommand::p_impl.
Referenced by execute_command(), ModelView::InsertNewItemCommand::execute_command(), ModelView::MoveItemCommand::execute_command(), ModelView::RemoveItemCommand::execute_command(), ModelView::SetValueCommand::swap_values(), undo_command(), ModelView::InsertNewItemCommand::undo_command(), ModelView::MoveItemCommand::undo_command(), and ModelView::RemoveItemCommand::undo_command().
|
protectedinherited |
Definition at line 121 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
|
protectedinherited |
Definition at line 111 of file abstractitemcommand.cpp.
References ModelView::Utils::PathFromItem().
Referenced by CopyItemCommand(), ModelView::InsertNewItemCommand::InsertNewItemCommand(), ModelView::MoveItemCommand::MoveItemCommand(), ModelView::RemoveItemCommand::RemoveItemCommand(), ModelView::SetValueCommand::SetValueCommand(), ModelView::MoveItemCommand::execute_command(), and ModelView::MoveItemCommand::undo_command().
|
inherited |
Definition at line 92 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
Referenced by execute_command(), ModelView::SetValueCommand::swap_values(), and TEST_F().
|
protectedinherited |
Sets command description.
Definition at line 106 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
Referenced by CopyItemCommand(), ModelView::MoveItemCommand::MoveItemCommand(), ModelView::RemoveItemCommand::RemoveItemCommand(), ModelView::SetValueCommand::SetValueCommand(), and ModelView::InsertNewItemCommand::execute_command().
|
protectedinherited |
Sets command obsolete flag.
Definition at line 99 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
Referenced by execute_command(), ModelView::InsertNewItemCommand::execute_command(), ModelView::RemoveItemCommand::execute_command(), and ModelView::SetValueCommand::swap_values().
|
protectedinherited |
Definition at line 126 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
Referenced by CopyItemCommand(), ModelView::InsertNewItemCommand::InsertNewItemCommand(), ModelView::MoveItemCommand::MoveItemCommand(), ModelView::RemoveItemCommand::RemoveItemCommand(), ModelView::SetValueCommand::SetValueCommand(), execute_command(), ModelView::InsertNewItemCommand::execute_command(), ModelView::RemoveItemCommand::execute_command(), ModelView::SetValueCommand::swap_values(), undo_command(), and ModelView::InsertNewItemCommand::undo_command().
|
inherited |
Undo command as it was before execution.
Definition at line 68 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl, and ModelView::AbstractItemCommand::undo_command().
Referenced by TEST_F().
|
overrideprivatevirtual |
Implements ModelView::AbstractItemCommand.
Definition at line 54 of file copyitemcommand.cpp.
References ModelView::AbstractItemCommand::itemFromPath(), p_impl, and ModelView::AbstractItemCommand::setResult().
|
private |
Definition at line 37 of file copyitemcommand.h.
Referenced by CopyItemCommand(), execute_command(), and undo_command().