public Command save() { Command comm = null; if (!myLastSavedNotes.equals(text.getValue())) { comm = new SetPrivateTextCommand( this, new PrivateText(GameModule.getUserId(), (String) text.getValue())); comm.execute(); } return comm; }
public Command getRestoreCommand() { Command comm = null; for (PrivateText privateText : notes) { SetPrivateTextCommand c = new SetPrivateTextCommand(this, privateText); if (comm == null) { comm = c; } else { comm.append(c); } } return comm; }