Examples of Note


Examples of com.example.myproject.client.entities.Note

    // The Objectify service for the entity must be registered before any
    // operations can be executed
    ObjectifyService.register(Note.class);
    Objectify ofy = ObjectifyService.begin();

    Note note = a;
    // Use setters to populate the object
    // the Key will be auto generated and does not need to be set
    ofy.put(note);
  }
View Full Code Here

Examples of com.example.myproject.client.entities.Note

  private void setLblResult(String msg) {
    lblResult.setText(msg);
  }

  private void putNote() {
    Note a = new Note(tfParent.getText().trim(), tfChild1.getText().trim(),
        new Date());

    persistentService.persistNote(a, new AsyncCallback<Void>() {

      @Override
View Full Code Here

Examples of com.google.appengine.demos.sticky.client.model.Note

  private static Note[] toClientNotes(Collection<Store.Note> notes) {
    final Note[] clients = new Note[notes.size()];
    int i = 0;
    for (Store.Note n : notes) {
      clients[i++] = new Note(KeyFactory.keyToString(n.getKey()), n.getX(), n
          .getY(), n.getWidth(), n.getHeight(), n.getContent(), n
          .getLastUpdatedAt(), n.getAuthorName(), n.getAuthorEmail());
    }
    return clients;
  }
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

    this.rtw = mainPanel;
    rtw.addNameChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        String newName = rtw.getName();
        if (noteData.containsKey(newName)) {
          Note n = noteData.get(newName);
          if (!rtw.getHTML().equals(n.getText())) {
            rtw.setHTML(n.getText());
          }
        }
      }
    });
  }
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

    syncFromGears(true);
    syncToServer(true);
   
    // init the dirty-testing code
    localDirty = false;
    Note def = noteData.get("default");
    if (def != null) {
      lastData = def.getText();
    }
  }
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

    if (!gears.gearsEnabled()) {
      return;
    }

    Note[] notes = gears.getNotes();
    Note n = null;
    if (notes != null && notes.length > 0) {
      for (int i = 0; i < notes.length; ++i) {
        n = notes[i];
        if (!noteData.containsKey(n.getName())) {
          n = notes[i];
          noteData.put(n.getName(), n);
        }
      }
    }
    if (isInit) {
      n = noteData.get("default");
      if (n != null) {
        rtw.setHTML(n.getText());
      }
    }
  }
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

          ready = true;
          return;
        }

        // process the results and figure out if we need to update our state
        Note n = null;
        for (int i = 0; i < notes.length; ++i) {
          n = notes[i];

          // server sent us a totally new record -- just store it
          if (!noteData.containsKey(n.getName())) {
            noteData.put(n.getName(), n);
            gears.updateNote(n);
            continue;
          }

          // record exists -- check if server version is more recent & handle it
          Note current = noteData.get(n.getName());
          if (!current.getVersion().equals(n.getVersion())) {
            current.setVersion(n.getVersion());
            if (current.getText().equals(n.getText())) {
              // versions don't match but text is same anyway
              gears.updateNote(current); // to update version...
              localDirty = false;
              lastData = current.getText();
            } else if (current.getName().equals(rtw.getName()) && localDirty
                && Window.confirm(REPLACE_CONF_TEXT)) {
              // if versions don't match, ask user for permission to override
              gears.updateNote(current); // to update version...
              // we are proceeding w/ local data, so don't touch UI
            } else {
              // user rejected override, or else was not current note
              current.setText(n.getText());
              gears.updateNote(current);
             
              localDirty = false;
              lastData = current.getText();

              // don't forget to update UI state...
              if (rtw.getName().equals(current.getName())) {
                rtw.setHTML(current.getText());
              }
            }
            continue;
          }
        }

        // in the special case of startup, check for default value
        if (isInit) {
          Note def = noteData.get("default");
          if (def != null) {
            rtw.setHTML(def.getText());
          }
        }
        ready = true;
      }
    });
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

    // upload our current data
    rpc.setNotes(notes, new AsyncCallback<Void>() {
      public void onFailure(Throwable caught) {
        // next call is also likely to fail, so don't bother to try
        if (isInit) {
          Note def = noteData.get("default");
          if (def != null) {
            rtw.setHeight(def.getText());
          }
        }
        ready = true;
      }
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

      lastData = curData;
    }

    if (noteData.containsKey(curName)) {
      // fetch the latest data for the note the user is trying to look at
      Note n = noteData.get(curName);
      if (!n.getText().equals(curData)) {
        // if the UI doesn't currently show latest data, update it
        n.setText(curData);
        gears.updateNote(n);
      }
    } else {
      // if the user has created a new record (unknown name) just store it
      Note n = new Note(curName, "1", curData);
      noteData.put(curName, n);
      gears.updateNote(n);
    }

    // add all the notes to the options list
View Full Code Here

Examples of com.google.gwt.gears.sample.gwtnote.client.rpc.Note

      return;
    }
    Map<String,Note> data = getDataMap();
    for (int i = 0; i < notes.length; ++i) {
      if (data.containsKey(notes[i].getName())) {
        Note nd = data.get(notes[i].getName());
        int newVer = Integer.parseInt(notes[i].getVersion());
        int oldVer = Integer.parseInt(nd.getVersion());
        if (newVer >= oldVer) {
          if (!nd.getText().equals(notes[i].getText())) {
            nd.setText(notes[i].getText());
            nd.setVersion("" + ((newVer > oldVer ? newVer : oldVer) + 1));
          }
        }
      } else {
        data.put(notes[i].getName(), notes[i]);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.