EditorsBuilder patch

Jeff Cantin <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Message-ID <[email protected]>
Lets the editors command return multiple EditorsFileInfoContainers
for multiple editors of a file. 



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
edbuild.patch (application/octet-stream, 2.1 KB)
Index: org/netbeans/lib/cvsclient/command/editors/EditorsBuilder.java
===================================================================
RCS file: /cvs/javacvs/libsrc/org/netbeans/lib/cvsclient/command/editors/EditorsBuilder.java,v
retrieving revision 1.2
diff -u -r1.2 EditorsBuilder.java
--- org/netbeans/lib/cvsclient/command/editors/EditorsBuilder.java	15 Jan 2002 13:04:08 -0000	1.2
+++ org/netbeans/lib/cvsclient/command/editors/EditorsBuilder.java	6 Jun 2002 18:02:50 -0000
@@ -33,10 +33,13 @@
     // Fields =================================================================
 
     private final EventManager eventManager;
+    
+    private String editorsFileName;
 
     // Setup ==================================================================
 
     EditorsBuilder(EventManager eventManager) {
+	this.editorsFileName=null;
         this.eventManager = eventManager;
     }
 
@@ -62,10 +65,19 @@
             return false;
         }
 
-        final String fileName = tokenizer.nextToken();
-        if (!tokenizer.hasMoreTokens()) {
-            return false;
-        }
+	//check whether line is the first editors line for this file. 
+	//persist for later lines. 
+	if(!line.startsWith("\t")) {
+	    editorsFileName = tokenizer.nextToken();
+	    if (!tokenizer.hasMoreTokens()) {
+		return false;
+	    }
+	} 
+	//must have a filename associated with the line, 
+	// either from this line or a previous one
+	else if(editorsFileName==null) {
+	    return false;
+	}
 
         final String user = tokenizer.nextToken();
         if (!tokenizer.hasMoreTokens()) {
@@ -86,7 +98,7 @@
 
         try {
             FileInfoContainer fileInfoContainer = parseEntries(localDirectory,
-                                                               fileName,
+                                                               editorsFileName,
                                                                user,
                                                                dateString,
                                                                clientName);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.