Package de.chris_soft.nanodoa.gui.tree.path

Examples of de.chris_soft.nanodoa.gui.tree.path.LabelPath


      @Override
      public void run() {
        try {
          List<Long> labels = God.archive.getAllLabels();
          for (long labelID : labels) {
            LabelPath labelPath = new LabelPath(labelID);
            God.labelTree.addNode(null, labelPath);
            List<Long> docs = God.archive.db.getDocumentsFromLabel(labelID);
            for (long docID : docs) {
              DocumentPath docPath = new DocumentPath(docID);
              God.labelTree.addNode(labelPath, docPath);
View Full Code Here


    }
    labelList.refresh();
  }

  private void setDocumentLabel(long documentID, long labelID) {
    LabelPath labelPath = new LabelPath(labelID);
    List<Object> children = God.labelTree.getChildUserObjects(labelPath);
    DocumentPath docPath = new DocumentPath(documentID);
    if (!children.contains(docPath)) {
      God.labelTree.addNode(labelPath, docPath);
    }
View Full Code Here

    }
    labelList.refresh();
  }

  private void unsetDocumentLabel(long documentID, long labelID) {
    LabelPath labelPath = new LabelPath(labelID);
    if (God.labelTree.hasNode(labelPath)) {
      List<Object> children = God.labelTree.getChildUserObjects(labelPath);
      for (Object oChild : children) {
        DocumentPath child = (DocumentPath) oChild;
        if (child.docID == documentID) {
View Full Code Here

  /**
   * @see de.chris_soft.utilities.swing.labellist.LabelListListener#labelDeleted(long)
   */
  @Override
  public void labelDeleted(long labelID) {
    LabelPath labelPath = new LabelPath(labelID);
    God.labelTree.removeNode(labelPath);
    labelList.refresh();
  }
View Full Code Here

  /**
   * @see de.chris_soft.utilities.swing.labellist.LabelListListener#labelAdded(long)
   */
  @Override
  public void labelAdded(long labelID) {
    LabelPath labelPath = new LabelPath(labelID);
    if (!God.labelTree.hasNode(labelPath)) {
      God.labelTree.addNode(null, labelPath);
    }
    labelList.refresh();
  }
View Full Code Here

   * @param newLabelName
   */
  public void labelRenamed(long labelID, String newLabelName) {
    List<Object> children = getChildUserObjects(rootObject);
    for (Object userObject : children) {
      LabelPath labelPath = (LabelPath) userObject;
      if (labelPath.getID() == labelID) {
        labelPath.rename(newLabelName);
        refreshNode(userObject);
      }
    }
  }
View Full Code Here

  private void rightClickedOnDocumentPath(MouseEvent e, DefaultMutableTreeNode node, JPopupMenu menu) {
    final DocumentPath documentPath = (DocumentPath) node.getUserObject();
    Object parent = ((DefaultMutableTreeNode) node.getParent()).getUserObject();
    if (parent instanceof LabelPath) {
      final LabelPath labelPath = (LabelPath) parent;
      JMenuItem menuItem = new JMenuItem("Remove label '" + labelPath.toString() + "' from this document");
      menuItem.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          try {
            God.archive.db.removeLabelFromDocument(documentPath.getID(), labelPath.getID());
            God.appWindow.refreshLabelList();
          }
          catch (SQLException exception) {
            SwingUtils.showError(God.appWindow.frame, "Couldn't remove label from document!");
          }
View Full Code Here

TOP

Related Classes of de.chris_soft.nanodoa.gui.tree.path.LabelPath

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.