コード例 #1
0
 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();
   }
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 private void save() {
   final String nameToSave = nullToEmpty(workspace.getNameEditor().getText()).trim();
   final String programToSave = nullToEmpty(workspace.getCodeEditor().getText()).trim();
   storage.saveProgram(nameToSave, programToSave);
 }