Examples of TCNote


Examples of org.tei.comparator.web.client.db.TCNote

      String id = note.getAttribute("id");
      String text = note.getTextContent();
     
      System.out.println("processing note " + id);
     
      TCNote n = new TCNote();
      n.setId(Long.valueOf(id));
      n.setType(type);
      n.setText(text);
      n.setRefersTo(ref);
     
      session.save(n);
    }

View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

    commitAndStartTransaction();
 
 
  public void removeNote(TCNote note){
    if(null != note.getId()){
      TCNote theNote = (TCNote) session.get(TCNote.class, note.getId());
      if(null != theNote){
        session.delete(theNote);
        commitAndStartTransaction();
      }
    }
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

      }
    }
  }
 
  public void storeNote(TCNote note){
    TCNote theNote = null;
    if(null != note.getId()){
      try{
        theNote = (TCNote) session.get(TCNote.class, note.getId());
        theNote.setText(note.getText());
        theNote.setType(note.getType());
        theNote.setCreated(note.getCreated());
        theNote.setRefersTo(note.getRefersTo());
      }catch(Exception e){
        e.printStackTrace();
      }
    }
    if(null == theNote)
      theNote = note;
   
    //
    theNote.setText(StringEscapeUtils.escapeHtml(StringEscapeUtils.escapeSql(theNote.getText())));
   
    session.save(theNote);
    commitAndStartTransaction();
  }
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

 
  public NotesPanel(){
  }
 
  public NotesPanel(String id, String type, NotePanelCallback<TCNote, Integer> callback){
    TCNote note = new TCNote();
    note.setCreated(new Date());
      note.setType(type);
      note.setRefersTo(id);
     
      show(note, callback);
  }
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

      Element target;
      switch (DOM.eventGetType(event)) {
      case Event.ONMOUSEOVER:
        target = event.getTarget();
        if(target.getClassName().equals("tc-notes-note")){
          TCNote note = noteLookup.get(target);
          if(null != note)
            Info.display("Paragraph Note", note.getText());
        }
        break;
      case Event.ONCLICK:
        target = event.getTarget();
        if(target.getClassName().equals("tc-notes-note")){
          TCNote note = noteLookup.get(target);
          if(null != note){
            new NotesPanel(note, new NotePanelCallback<TCNote, Integer>(){
            public void callback(TCNote note, Integer type) {
              if(type == NotesPanel.NOTE_REMOVED)
                removeNote(note);
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

    if(null != el){
      Element con = noteSpanLookup.get(el);
      NodeList<Node> nl = con.getChildNodes();
      for(int i = 0; i < nl.getLength(); i++){
        Element item = (Element)nl.getItem(i);
        TCNote compNote = noteLookup.get(item);
        if(null != compNote && compNote.getId().equals(note.getId())){
          con.removeChild(item);
          break;
        }
      }
    }
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

      Element target;
      switch (DOM.eventGetType(event)) {
      case Event.ONMOUSEOVER:
        target = event.getTarget();
        if(target.getClassName().equals("tc-notes-note") ||target.getClassName().equals("tc-notes-linknote")){
          TCNote note = noteLookup.get(target);
          if(null != note)
            Info.display( (note.getType() == TCNote.TYPE_PARAGRAPH ? "Paragraph" : "Link")+ " Note", note.getText());
        }
        break;
      case Event.ONCLICK:
        target = event.getTarget();
        if(target.getClassName().equals("tc-notes-note") ||target.getClassName().equals("tc-notes-linknote")){
          TCNote note = noteLookup.get(target);
          if(null != note){
            new NotesPanel(note, new NotePanelCallback<TCNote, Integer>(){
            public void callback(TCNote note, Integer type) {
              if(type == NotesPanel.NOTE_REMOVED)
                removeNote(note);
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

    Element el = getElement();
    if(null != el){
      NodeList<Node> nl = innerCon.getChildNodes();
      for(int i = 0; i < nl.getLength(); i++){
        Element item = (Element)nl.getItem(i);
        TCNote compNote = noteLookup.get(item);
        if(null != compNote && compNote.getId().equals(note.getId())){
          innerCon.removeChild(item);
          break;
        }
      }
    }
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

      Element target, propEl;
      switch (DOM.eventGetType(event)) {
      case Event.ONMOUSEOVER:
        target = event.getTarget();
        if(target.getClassName().equals("tc-notes-note")){
          TCNote note = noteLookup.get(target);
          if(null != note)
            Info.display("Paragraph Note", note.getText());
        }
        break;
      case Event.ONCLICK:
        target = event.getTarget();
        if(target.getClassName().equals("tc-notes-note")){
          TCNote note = noteLookup.get(target);
          if(null != note){
            new NotesPanel(note, new NotePanelCallback<TCNote, Integer>(){
            public void callback(TCNote note, Integer type) {
              if(type == NotesPanel.NOTE_REMOVED)
                removeNote(note);
View Full Code Here

Examples of org.tei.comparator.web.client.db.TCNote

    if(null != el){
      Element con = noteSpanLookup.get(el);
      NodeList<Node> nl = con.getChildNodes();
      for(int i = 0; i < nl.getLength(); i++){
        Element item = (Element)nl.getItem(i);
        TCNote compNote = noteLookup.get(item);
        if(null != compNote && compNote.getId().equals(note.getId())){
          con.removeChild(item);
          break;
        }
      }
    }
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.