This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 199641
Collapse All | Expand All

(-)a/openide.loaders/nbproject/project.xml (+9 lines)
Lines 68-73 Link Here
68
                    </run-dependency>
68
                    </run-dependency>
69
                </dependency>
69
                </dependency>
70
                <dependency>
70
                <dependency>
71
                    <code-name-base>org.netbeans.core.multiview</code-name-base>
72
                    <build-prerequisite/>
73
                    <compile-dependency/>
74
                    <run-dependency>
75
                        <release-version>1</release-version>
76
                        <specification-version>1.24</specification-version>
77
                    </run-dependency>
78
                </dependency>
79
                <dependency>
71
                    <code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base>
80
                    <code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base>
72
                    <build-prerequisite/>
81
                    <build-prerequisite/>
73
                    <compile-dependency/>
82
                    <compile-dependency/>
(-)6b637363069c (+45 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
To change this template, choose Tools | Templates
4
and open the template in the editor.
5
-->
6
<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.1//EN" "http://www.netbeans.org/dtds/mime-resolver-1_1.dtd">
7
<MIME-resolver>
8
    <file>
9
        <ext name="txt"/>
10
        <resolver mime="text/plain"/>
11
    </file>
12
    <file><pattern range="2048" value="&#00;"/><exit></file>
13
    <file><pattern range="2048" value="&#01;"/><exit></file>
14
    <file><pattern range="2048" value="&#02;"/><exit></file>
15
    <file><pattern range="2048" value="&#03;"/><exit></file>
16
    <file><pattern range="2048" value="&#04;"/><exit></file>
17
    <file><pattern range="2048" value="&#05;"/><exit></file>
18
    <file><pattern range="2048" value="&#06;"/><exit></file>
19
    <file><pattern range="2048" value="&#07;"/><exit></file>
20
    <file><pattern range="2048" value="&#08;"/><exit></file>
21
    <file><pattern range="2048" value="&#11;"/><exit></file>
22
    <file><pattern range="2048" value="&#12;"/><exit></file>
23
    <file><pattern range="2048" value="&#14;"/><exit></file>
24
    <file><pattern range="2048" value="&#15;"/><exit></file>
25
    <file><pattern range="2048" value="&#16;"/><exit></file>
26
    <file><pattern range="2048" value="&#17;"/><exit></file>
27
    <file><pattern range="2048" value="&#18;"/><exit></file>
28
    <file><pattern range="2048" value="&#19;"/><exit></file>
29
    <file><pattern range="2048" value="&#20;"/><exit></file>
30
    <file><pattern range="2048" value="&#21;"/><exit></file>
31
    <file><pattern range="2048" value="&#22;"/><exit></file>
32
    <file><pattern range="2048" value="&#23;"/><exit></file>
33
    <file><pattern range="2048" value="&#24;"/><exit></file>
34
    <file><pattern range="2048" value="&#25;"/><exit></file>
35
    <file><pattern range="2048" value="&#26;"/><exit></file>
36
    <file><pattern range="2048" value="&#27;"/><exit></file>
37
    <file><pattern range="2048" value="&#28;"/><exit></file>
38
    <file><pattern range="2048" value="&#29;"/><exit></file>
39
    <file><pattern range="2048" value="&#30;"/><exit></file>
40
    <file><pattern range="2048" value="&#31;"/><exit></file>
41
    <file>
42
        <magic hex="00" mask="00"/>
43
        <resolver mime="text/plain"/>
44
    </file>
45
</MIME-resolver>
(-)a/openide.loaders/src/org/netbeans/modules/openide/loaders/layer.xml (-1 / +8 lines)
Lines 1-10 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
2
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
3
<filesystem>
3
<filesystem>
4
    <folder name="Services">
5
        <folder name="MIMEResolver">
6
            <file name="PlainTextResolver.xml" url="PlainTextResolver.xml">
7
                <attr name="displayName" bundlevalue="org.openide.loaders.Bundle#Services/MIMEResolver/PlainResolver.xml"/>
8
            </file>
9
        </folder>
10
    </folder>
4
    <folder name="xml">
11
    <folder name="xml">
5
        <folder name="entities">
12
        <folder name="entities">
6
            <folder name="NetBeans">
13
            <folder name="NetBeans">
7
                <file name="Entity_Mapping_Registration_1_0" url="EntityCatalog.dtd" >
14
                <file name="Entity_Mapping_Registration_1_0" url="EntityCatalog.dtd">
8
                    <attr name="hint.originalPublicID" stringvalue="-//NetBeans//Entity Mapping Registration 1.0//EN"/>
15
                    <attr name="hint.originalPublicID" stringvalue="-//NetBeans//Entity Mapping Registration 1.0//EN"/>
9
                </file>
16
                </file>
10
            </folder>
17
            </folder>
(-)a/openide.loaders/src/org/openide/loaders/Bundle.properties (+1 lines)
Lines 102-107 Link Here
102
# folder sort mode property
102
# folder sort mode property
103
PROP_sort=Sort Mode
103
PROP_sort=Sort Mode
104
HINT_sort=Determines how objects in the package should be sorted.
104
HINT_sort=Determines how objects in the package should be sorted.
105
Services/MIMEResolver/PlainResolver.xml=Plain Text Files
105
# SortModeEditor
106
# SortModeEditor
106
VALUE_sort_none=Unsorted
107
VALUE_sort_none=Unsorted
107
VALUE_sort_names=By Name
108
VALUE_sort_names=By Name
(-)a/openide.loaders/src/org/openide/loaders/DefaultDataObject.java (-24 / +9 lines)
Lines 45-55 Link Here
45
package org.openide.loaders;
45
package org.openide.loaders;
46
46
47
import java.io.IOException;
47
import java.io.IOException;
48
import java.io.InputStream;
49
import java.util.ArrayList;
48
import java.util.ArrayList;
50
import java.util.HashSet;
49
import java.util.HashSet;
51
import java.util.List;
50
import java.util.List;
52
import java.util.logging.Level;
53
import org.openide.DialogDisplayer;
51
import org.openide.DialogDisplayer;
54
import org.openide.NotifyDescriptor;
52
import org.openide.NotifyDescriptor;
55
import org.openide.cookies.CloseCookie;
53
import org.openide.cookies.CloseCookie;
Lines 70-75 Link Here
70
    static final long serialVersionUID =-4936309935667095746L;
68
    static final long serialVersionUID =-4936309935667095746L;
71
    /** editor for default editor support */
69
    /** editor for default editor support */
72
    private DefaultES support;
70
    private DefaultES support;
71
    private final String mime;
73
    
72
    
74
    /** generated Serialized Version UID */
73
    /** generated Serialized Version UID */
75
    //  static final long serialVersionUID = 6305590675982925167L;
74
    //  static final long serialVersionUID = 6305590675982925167L;
Lines 80-85 Link Here
80
    */
79
    */
81
    DefaultDataObject (FileObject fo, MultiFileLoader loader) throws DataObjectExistsException {
80
    DefaultDataObject (FileObject fo, MultiFileLoader loader) throws DataObjectExistsException {
82
        super (fo, loader);
81
        super (fo, loader);
82
        mime = getPrimaryFile().getMIMEType();
83
    }
83
    }
84
 
84
 
85
    /* Creates node delegate.
85
    /* Creates node delegate.
Lines 248-277 Link Here
248
            ||
248
            ||
249
            c == DefaultES.class
249
            c == DefaultES.class
250
        ) {
250
        ) {
251
            try {
251
            if (!force) {
252
                if (!force) {
252
                if (!mime.startsWith("text/")) {
253
                    // try to initialize the editor cookie set if the file 
253
                    return;
254
                    // seems editable
255
                    byte[] arr = new byte[2048];
256
                    InputStream is = getPrimaryFile().getInputStream();
257
                    try {
258
                        int len = is.read (arr);
259
                        for (int i = 0; i < len; i++) {
260
                            if (arr[i] >= 0 && arr[i] <= 31 && arr[i] != '\n' && arr[i] != '\r' && arr[i] != '\t') {
261
                                return;
262
                            }
263
                        }
264
                    } finally {
265
                        is.close ();
266
                    }
267
                }
254
                }
268
                support = new DefaultES (
269
                    this, getPrimaryEntry(), getCookieSet ()
270
                );
271
                getCookieSet().assign(DefaultES.class, support);
272
            } catch (IOException ex) {
273
                LOG.log(Level.INFO, "Cannot read " + getPrimaryEntry(), ex); // NOI18N
274
            }
255
            }
256
            support = new DefaultES (
257
                this, getPrimaryEntry(), getCookieSet ()
258
            );
259
            getCookieSet().assign(DefaultES.class, support);
275
        }
260
        }
276
    }
261
    }
277
}
262
}

Return to bug 199641