Package cx.fbn.nevernote.dialog

Examples of cx.fbn.nevernote.dialog.TagEdit


    //***************************************************************
  // Add a new notebook
  @SuppressWarnings("unused")
  private void addTag() {
    logger.log(logger.HIGH, "Inside NeverNote.addTag");
    TagEdit edit = new TagEdit();
    edit.setTagList(listManager.getTagIndex());

    List<QTreeWidgetItem> selections = tagTree.selectedItems();
    QTreeWidgetItem currentSelection = null;
    if (selections.size() > 0) {
      currentSelection = selections.get(0);
      edit.setParentTag(currentSelection.text(0));
    }

    edit.exec();
 
    if (!edit.okPressed())
      return;
       
    Calendar currentTime = new GregorianCalendar();
    Long l = new Long(currentTime.getTimeInMillis());
    String randint = new String(Long.toString(l));
 
    Tag newTag = new Tag();
    newTag.setUpdateSequenceNum(0);
    newTag.setGuid(randint);
    newTag.setName(edit.getTag());
    if (edit.getParentTag().isChecked()) {
      newTag.setParentGuid(currentSelection.text(2));
      newTag.setParentGuidIsSet(true);
      currentSelection.setExpanded(true);
    }
    conn.getTagTable().addTag(newTag, true);
View Full Code Here


  }
  // Edit an existing tag
  @SuppressWarnings("unused")
  private void editTag() {
    logger.log(logger.HIGH, "Entering NeverNote.editTag");
    TagEdit edit = new TagEdit();
    edit.setTitle("Edit Tag");
    List<QTreeWidgetItem> selections = tagTree.selectedItems();
    QTreeWidgetItem currentSelection;
    currentSelection = selections.get(0);
    edit.setTag(currentSelection.text(0));
    edit.setTagList(listManager.getTagIndex());
    edit.exec();
 
    if (!edit.okPressed())
      return;
       
    String guid = currentSelection.text(2);
    currentSelection.setText(0,edit.getTag());
   
    for (int i=0; i<listManager.getTagIndex().size(); i++) {
      if (listManager.getTagIndex().get(i).getGuid().equals(guid)) {
        listManager.getTagIndex().get(i).setName(edit.getTag());
        conn.getTagTable().updateTag(listManager.getTagIndex().get(i), true);
        updateListTagName(guid);
        if (currentNote != null && currentNote.getTagGuids().contains(guid))
          browserWindow.setTag(getTagNamesForNote(currentNote));
        logger.log(logger.HIGH, "Leaving NeverNote.editTag");
        //return;
      }
    }
    listManager.reloadNoteTagNames(guid, edit.getTag());
    noteIndexUpdated(true);
    refreshEvernoteNote(true);
    browserWindow.setTag(getTagNamesForNote(currentNote));
    logger.log(logger.HIGH, "Leaving NeverNote.editTag...");
  }
View Full Code Here

TOP

Related Classes of cx.fbn.nevernote.dialog.TagEdit

Copyright © 2018 www.massapicom. 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.