BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Command for unddo/redo framework to move item from one parent to another. More...
Classes | |
struct | MoveItemCommandImpl |
Public Member Functions | |
MoveItemCommand (SessionItem *item, SessionItem *new_parent, TagRow tagrow) | |
~MoveItemCommand () 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< MoveItemCommandImpl > | p_impl |
Command for unddo/redo framework to move item from one parent to another.
Definition at line 28 of file moveitemcommand.h.
MoveItemCommand::MoveItemCommand | ( | SessionItem * | item, |
SessionItem * | new_parent, | ||
TagRow | tagrow | ||
) |
Definition at line 41 of file moveitemcommand.cpp.
References ModelView::Utils::IsSinglePropertyTag(), ModelView::SessionItem::itemCount(), p_impl, ModelView::SessionItem::parent(), ModelView::AbstractItemCommand::pathFromItem(), ModelView::AbstractItemCommand::setDescription(), ModelView::AbstractItemCommand::setResult(), and ModelView::SessionItem::tagRow().
|
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 83 of file moveitemcommand.cpp.
References ModelView::AbstractItemCommand::itemFromPath(), p_impl, and ModelView::AbstractItemCommand::pathFromItem().
|
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 ModelView::CopyItemCommand::execute_command(), ModelView::InsertNewItemCommand::execute_command(), execute_command(), ModelView::RemoveItemCommand::execute_command(), ModelView::SetValueCommand::swap_values(), ModelView::CopyItemCommand::undo_command(), ModelView::InsertNewItemCommand::undo_command(), 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 ModelView::CopyItemCommand::CopyItemCommand(), ModelView::InsertNewItemCommand::InsertNewItemCommand(), MoveItemCommand(), ModelView::RemoveItemCommand::RemoveItemCommand(), ModelView::SetValueCommand::SetValueCommand(), execute_command(), and undo_command().
|
inherited |
Definition at line 92 of file abstractitemcommand.cpp.
References ModelView::AbstractItemCommand::p_impl.
Referenced by ModelView::CopyItemCommand::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 ModelView::CopyItemCommand::CopyItemCommand(), 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 ModelView::CopyItemCommand::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 ModelView::CopyItemCommand::CopyItemCommand(), ModelView::InsertNewItemCommand::InsertNewItemCommand(), MoveItemCommand(), ModelView::RemoveItemCommand::RemoveItemCommand(), ModelView::SetValueCommand::SetValueCommand(), ModelView::CopyItemCommand::execute_command(), ModelView::InsertNewItemCommand::execute_command(), ModelView::RemoveItemCommand::execute_command(), ModelView::SetValueCommand::swap_values(), ModelView::CopyItemCommand::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 68 of file moveitemcommand.cpp.
References ModelView::AbstractItemCommand::itemFromPath(), p_impl, and ModelView::AbstractItemCommand::pathFromItem().
|
private |
Definition at line 38 of file moveitemcommand.h.
Referenced by MoveItemCommand(), execute_command(), and undo_command().