@Override protected void execute() throws CommandPreconditionsException { Document d = document.val(); d.rename(newTitle.val()); } @Override public boolean checkInputPinsCoverage() { if (document.val() == null) { throw new CommandPreconditionsException("Please, select document."); } if (newTitle.val() == null || (newTitle.val() != null && newTitle.val().isEmpty())) { throw new CommandPreconditionsException("Please, select new title."); } return true; }