use of org.freeplane.features.text.NodeContainsCondition in project freeplane by freeplane.
the class ScriptApiTest method test_Controller_undo_redo_stuff.
@SuppressWarnings("deprecation")
public void test_Controller_undo_redo_stuff() {
map = c.newMap();
map.getRoot().createChild("child 1");
assertFalse("node should be there before undo", c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 1", false)).isEmpty());
c.undo();
assertTrue("node should be away after undo", c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 1", false)).isEmpty());
c.redo();
assertFalse("node should be there after redo", c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 1", false)).isEmpty());
c.deactivateUndo();
c.undo();
assertTrue("node should still be there after undo since undo is deactivated", c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 1", false)).isEmpty());
}
use of org.freeplane.features.text.NodeContainsCondition in project freeplane by freeplane.
the class ScriptApiTest method test_ControllerRO_find_ICondition_condition.
@SuppressWarnings("deprecation")
public void test_ControllerRO_find_ICondition_condition() {
map = c.newMap();
@SuppressWarnings("unused") final Node firstChild = map.getRoot().createChild("child 1");
final Node secondChild = map.getRoot().createChild("child 2");
final List<Node> found = c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 2", false));
assertEquals("one matching node should be found", list(secondChild), found);
}
use of org.freeplane.features.text.NodeContainsCondition in project freeplane by freeplane.
the class ScriptApiTest method test_NodeRO_isVisible.
public void test_NodeRO_isVisible() {
map = c.newMap();
map.getRoot().createChild("first node");
map.getRoot().createChild("second node");
assertTrue("initially all nodes should be visible", firstChild().isVisible());
new Filter(new NodeContainsCondition(TextController.FILTER_NODE, "first", false), true, true, true).applyFilter(this, Controller.getCurrentController().getMap(), true);
assertTrue("first node should be matched by the filter", firstChild().isVisible());
assertFalse("second node should not be matched by the filter", map.getRoot().getChildren().get(1).isVisible());
c.setStatusInfo("filter", (String) null);
}
use of org.freeplane.features.text.NodeContainsCondition in project freeplane by freeplane.
the class ScriptApiTest method test_NodeRO_find_ICondition_condition.
/**
* copy of {@link #test_ControllerRO_find_ICondition_condition()}.
*/
@SuppressWarnings("deprecation")
public void test_NodeRO_find_ICondition_condition() {
map = c.newMap();
@SuppressWarnings("unused") final Node firstChild = map.getRoot().createChild("child 1");
final Node secondChild = map.getRoot().createChild("child 2");
final List<Node> found = c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 2", false));
assertEquals("one matching node should be found", list(secondChild), found);
}
Aggregations