public void deleteElement(Object obj) {
   if (obj instanceof Scenario) {
     Scenario s = (Scenario) obj;
     s.getParent().remove(s);
   }
   if (obj instanceof Test) {
     Test t = (Test) obj;
     t.getParent().remove(t);
   }
 }
 public void executeTest() {
   Object selected = form.getSelection();
   Test test = selected instanceof Scenario ? ((Scenario) selected).getParent() : (Test) selected;
   if (test == null) {
     form.displayErrorMessage(L.get("ui.error.no_test_selected"));
   } else if (!test.isValid()) {
     form.displayErrorMessage(L.get("ui.error.test_not_valid"));
   } else {
     executor.execute(test);
   }
 }
 public void createAction(Schema action) {
   Object selected = form.getSelection();
   Test test = selected instanceof Scenario ? ((Scenario) selected).getParent() : (Test) selected;
   if (test == null) form.displayErrorMessage(L.get("ui.error.no_test_selected"));
   else form.editElementName(test.add(new Scenario(action)));
 }