public void setPlace(Place place) { programName = nullToEmpty(((WorkspacePlace) place).getProgramName()).trim(); final JsonGist program = storage.getProgram(programName); if (program != null) { workspace.getCodeEditor().setText(program.getFile().getContent()); execute(); } }
private void execute() { final List<String> lines = ImmutableList.copyOf(lineSplitter.split(workspace.getCodeEditor().getText())); final List<Iterable<String>> lineTokens = transform(lines, splitTokens); scheduler.execute(interpret(lineTokens)); }
private void save() { final String nameToSave = nullToEmpty(workspace.getNameEditor().getText()).trim(); final String programToSave = nullToEmpty(workspace.getCodeEditor().getText()).trim(); storage.saveProgram(nameToSave, programToSave); }