/** * Adds and executes the AppendChildCommand to historyBrowser. * * @param parent * The given parent * @param child * The node to be appended */ public void appendChild(Node parent, Node child) { historyBrowser.addCommand(createAppendChildCommand(parent, child)); }
/** * Adds and executes the AppendChildCommand to historyBrowser. * * @param parent * The given parent * @param child * The node to be appended */ public void appendChild(Node parent, Node child) { historyBrowser.addCommand(createAppendChildCommand(parent, child)); }
/** * Creates InsertChildBefore or AppendChild command, depending on the value * of siblingNode. * * @param parent * The parent node * @param sibling * The sibling node * @param child * The child node * @return AppendChild command if sibling node is null, InsertChildBefore * otherwise */ public UndoableCommand createInsertChildCommand(Node parent, Node sibling, Node child) { if (sibling == null) { return createAppendChildCommand(parent, child); } else { return createInsertNodeBeforeCommand(parent, sibling, child); } } /**
/** * Creates InsertChildBefore or AppendChild command, depending on the value * of siblingNode. * * @param parent * The parent node * @param sibling * The sibling node * @param child * The child node * @return AppendChild command if sibling node is null, InsertChildBefore * otherwise */ public UndoableCommand createInsertChildCommand(Node parent, Node sibling, Node child) { if (sibling == null) { return createAppendChildCommand(parent, child); } else { return createInsertNodeBeforeCommand(parent, sibling, child); } } /**
/** * Adds and executes the InsertNodeBeforeCommand to historyBrowser. * * @param parent * The given parent * @param sibling * Points where to be inserted * @param child * The node to insert */ public void insertChildBefore(Node parent, Node sibling, Node child) { if (sibling == null) { historyBrowser.addCommand(createAppendChildCommand(parent, child)); } else { historyBrowser.addCommand (createInsertNodeBeforeCommand(parent, sibling, child)); } }
/** * Adds and executes the InsertNodeBeforeCommand to historyBrowser. * * @param parent * The given parent * @param sibling * Points where to be inserted * @param child * The node to insert */ public void insertChildBefore(Node parent, Node sibling, Node child) { if (sibling == null) { historyBrowser.addCommand(createAppendChildCommand(parent, child)); } else { historyBrowser.addCommand (createInsertNodeBeforeCommand(parent, sibling, child)); } }