OSDN Git Service

Add the ability to add & remove notebook stacks.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / utilities / ListManager.java
index 1e964ed..6e0696b 100644 (file)
@@ -797,6 +797,15 @@ public class ListManager  {
                }\r
                conn.getNotebookTable().expungeNotebook(guid, true);            \r
        }\r
+       // Rename a stack\r
+       public void renameStack(String oldName, String newName) {\r
+               for (int i=0; i<getNotebookIndex().size(); i++) {\r
+                       if (getNotebookIndex().get(i).getStack() != null && \r
+                                       getNotebookIndex().get(i).getStack().equalsIgnoreCase(oldName)) {\r
+                               getNotebookIndex().get(i).setStack(newName);\r
+                       }\r
+               }       \r
+       }\r
        // Update a notebook sequence number\r
        public void updateNotebookSequence(String guid, int sequence) {\r
                logger.log(logger.HIGH, "Entering ListManager.updateNotebookSequence");\r
@@ -827,6 +836,21 @@ public class ListManager  {
                logger.log(logger.HIGH, "Leaving ListManager.updateNotebookGuid");\r
 \r
        }\r
+       // Update a notebook Guid number\r
+       public void updateNotebookStack(String oldGuid, String stack) {\r
+               logger.log(logger.HIGH, "Entering ListManager.updateNotebookGuid");\r
+\r
+               conn.getNotebookTable().setStack(oldGuid, stack);\r
+               \r
+               for (int i=0; i<notebookIndex.size(); i++) {\r
+                       if (notebookIndex.get(i).getGuid().equals(oldGuid)) {\r
+                               notebookIndex.get(i).setStack(stack);\r
+                               i=notebookIndex.size()+1;\r
+                       }\r
+               }\r
+               logger.log(logger.HIGH, "Leaving ListManager.updateNotebookGuid");\r
+\r
+       }\r
        \r
        \r
        //************************************************************************************\r