--- a/openide.loaders/nbproject/project.xml Wed Jun 29 18:46:14 2011 +0200 +++ a/openide.loaders/nbproject/project.xml Thu Jun 30 08:44:05 2011 +0200 @@ -68,6 +68,15 @@ + org.netbeans.core.multiview + + + + 1 + 1.24 + + + org.netbeans.modules.editor.mimelookup --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ 6b637363069c Thu Jun 30 08:44:05 2011 +0200 @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- a/openide.loaders/src/org/netbeans/modules/openide/loaders/layer.xml Wed Jun 29 18:46:14 2011 +0200 +++ a/openide.loaders/src/org/netbeans/modules/openide/loaders/layer.xml Thu Jun 30 08:44:05 2011 +0200 @@ -1,10 +1,17 @@ + + + + + + + - + --- a/openide.loaders/src/org/openide/loaders/Bundle.properties Wed Jun 29 18:46:14 2011 +0200 +++ a/openide.loaders/src/org/openide/loaders/Bundle.properties Thu Jun 30 08:44:05 2011 +0200 @@ -102,6 +102,7 @@ # folder sort mode property PROP_sort=Sort Mode HINT_sort=Determines how objects in the package should be sorted. +Services/MIMEResolver/PlainResolver.xml=Plain Text Files # SortModeEditor VALUE_sort_none=Unsorted VALUE_sort_names=By Name --- a/openide.loaders/src/org/openide/loaders/DefaultDataObject.java Wed Jun 29 18:46:14 2011 +0200 +++ a/openide.loaders/src/org/openide/loaders/DefaultDataObject.java Thu Jun 30 08:44:05 2011 +0200 @@ -45,11 +45,9 @@ package org.openide.loaders; import java.io.IOException; -import java.io.InputStream; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.logging.Level; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.cookies.CloseCookie; @@ -70,6 +68,7 @@ static final long serialVersionUID =-4936309935667095746L; /** editor for default editor support */ private DefaultES support; + private final String mime; /** generated Serialized Version UID */ // static final long serialVersionUID = 6305590675982925167L; @@ -80,6 +79,7 @@ */ DefaultDataObject (FileObject fo, MultiFileLoader loader) throws DataObjectExistsException { super (fo, loader); + mime = getPrimaryFile().getMIMEType(); } /* Creates node delegate. @@ -248,30 +248,15 @@ || c == DefaultES.class ) { - try { - if (!force) { - // try to initialize the editor cookie set if the file - // seems editable - byte[] arr = new byte[2048]; - InputStream is = getPrimaryFile().getInputStream(); - try { - int len = is.read (arr); - for (int i = 0; i < len; i++) { - if (arr[i] >= 0 && arr[i] <= 31 && arr[i] != '\n' && arr[i] != '\r' && arr[i] != '\t') { - return; - } - } - } finally { - is.close (); - } + if (!force) { + if (!mime.startsWith("text/")) { + return; } - support = new DefaultES ( - this, getPrimaryEntry(), getCookieSet () - ); - getCookieSet().assign(DefaultES.class, support); - } catch (IOException ex) { - LOG.log(Level.INFO, "Cannot read " + getPrimaryEntry(), ex); // NOI18N } + support = new DefaultES ( + this, getPrimaryEntry(), getCookieSet () + ); + getCookieSet().assign(DefaultES.class, support); } } }