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 199534
Collapse All | Expand All

(-)a/dlight.remote.impl/nbproject/project.xml (-1 / +1 lines)
Lines 85-91 Link Here
85
                    <build-prerequisite/>
85
                    <build-prerequisite/>
86
                    <compile-dependency/>
86
                    <compile-dependency/>
87
                    <run-dependency>
87
                    <run-dependency>
88
                        <specification-version>7.36</specification-version>
88
                        <specification-version>7.56</specification-version>
89
                    </run-dependency>
89
                    </run-dependency>
90
                </dependency>
90
                </dependency>
91
                <dependency>
91
                <dependency>
(-)a/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemoteFileObjectBase.java (+3 lines)
Lines 554-559 Link Here
554
    
554
    
555
    @Override
555
    @Override
556
    public Object getAttribute(String attrName) {
556
    public Object getAttribute(String attrName) {
557
        if (attrName.equals("default-line-separator")) {
558
            return "\n"; // NOI18N
559
        }
557
        if (attrName.equals("isRemoteAndSlow")) { // NOI18N
560
        if (attrName.equals("isRemoteAndSlow")) { // NOI18N
558
            return Boolean.TRUE;
561
            return Boolean.TRUE;
559
        }
562
        }
(-)a/editor.lib/apichanges.xml (+16 lines)
Lines 107-112 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
    <changes>
109
    <changes>
110
         <change id="default-line-separator">
111
            <summary>Provides default line separator</summary>
112
            <version major="3" minor="18.1"/>
113
            <date day="23" month="12" year="2011"/>
114
            <author login="alexvsimon"/>
115
            <compatibility addition="yes" binary="compatible" source="compatible" semantic="compatible" deprecation="no" deletion="no" modification="no"/>
116
            <description>
117
                <p>
118
                    Defines name of default line separator property 
119
                    <code>DEFAULT_LINE_SEPARATOR_PROP</code>.
120
                    If property <code>getProperty(DEFAULT_LINE_SEPARATOR_PROP)</code>, it will be used instead <code>System.getProperty("line.separator")</code>.
121
                </p>
122
            </description>
123
            <class package="org.netbeans.editor" name="BaseDocument"/>
124
            <issue number="199534"/>
125
        </change>
110
126
111
        <change id="deprecating-formatting">
127
        <change id="deprecating-formatting">
112
            <summary>Deprecating old formatting API</summary>
128
            <summary>Deprecating old formatting API</summary>
(-)a/editor.lib/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
javac.compilerargs=-Xlint:unchecked
43
javac.compilerargs=-Xlint:unchecked
44
javac.source=1.6
44
javac.source=1.6
45
spec.version.base=3.18.0
45
spec.version.base=3.18.1
46
is.autoload=true
46
is.autoload=true
47
47
48
javadoc.arch=${basedir}/arch.xml
48
javadoc.arch=${basedir}/arch.xml
(-)a/editor.lib/nbproject/project.xml (-1 / +1 lines)
Lines 141-147 Link Here
141
                    <build-prerequisite/>
141
                    <build-prerequisite/>
142
                    <compile-dependency/>
142
                    <compile-dependency/>
143
                    <run-dependency>
143
                    <run-dependency>
144
                        <specification-version>7.13</specification-version>
144
                        <specification-version>7.56</specification-version>
145
                    </run-dependency>
145
                    </run-dependency>
146
                </dependency>
146
                </dependency>
147
                <dependency>
147
                <dependency>
(-)a/editor.lib/src/org/netbeans/editor/BaseDocument.java (-3 / +11 lines)
Lines 165-170 Link Here
165
     */
165
     */
166
    public static final String WRITE_LINE_SEPARATOR_PROP = "write-line-separator"; // NOI18N
166
    public static final String WRITE_LINE_SEPARATOR_PROP = "write-line-separator"; // NOI18N
167
167
168
    /** Default line separator property for writing content into files. If not set
169
     * the platform default line separator is used.
170
     */
171
    public static final String DEFAULT_LINE_SEPARATOR_PROP = "default-line-separator"; // NOI18N
172
168
    /** File name property */
173
    /** File name property */
169
    public static final String FILE_NAME_PROP = "file-name"; // NOI18N
174
    public static final String FILE_NAME_PROP = "file-name"; // NOI18N
170
175
Lines 1383-1392 Link Here
1383
                throw new BadLocationException("BaseDocument.read()", pos); // NOI18N
1388
                throw new BadLocationException("BaseDocument.read()", pos); // NOI18N
1384
            }
1389
            }
1385
            ReadWriteBuffer buffer = ReadWriteUtils.read(reader);
1390
            ReadWriteBuffer buffer = ReadWriteUtils.read(reader);
1386
            if (!inited) { // Fill line-separator properties
1391
            if (!inited) { // Fill line-separator properties               
1387
                String lineSeparator = ReadWriteUtils.findFirstLineSeparator(buffer);
1392
                String lineSeparator = ReadWriteUtils.findFirstLineSeparator(buffer);
1388
                if (lineSeparator == null) {
1393
                if (lineSeparator == null) {
1389
                    lineSeparator = ReadWriteUtils.getSystemLineSeparator();
1394
                    lineSeparator = (String) getProperty(BaseDocument.DEFAULT_LINE_SEPARATOR_PROP);
1395
                    if (lineSeparator == null) {
1396
                        lineSeparator = ReadWriteUtils.getSystemLineSeparator();
1397
                    }
1390
                }
1398
                }
1391
                putProperty(BaseDocument.READ_LINE_SEPARATOR_PROP, lineSeparator);
1399
                putProperty(BaseDocument.READ_LINE_SEPARATOR_PROP, lineSeparator);
1392
            }
1400
            }
Lines 1428-1434 Link Here
1428
            }
1436
            }
1429
            String lineSeparator = (String) getProperty(BaseDocument.WRITE_LINE_SEPARATOR_PROP);
1437
            String lineSeparator = (String) getProperty(BaseDocument.WRITE_LINE_SEPARATOR_PROP);
1430
            if (lineSeparator == null) {
1438
            if (lineSeparator == null) {
1431
                lineSeparator = (String) getProperty(BaseDocument.READ_LINE_SEPARATOR_PROP);
1439
                lineSeparator = (String) getProperty(BaseDocument.DEFAULT_LINE_SEPARATOR_PROP);
1432
                if (lineSeparator == null) {
1440
                if (lineSeparator == null) {
1433
                    lineSeparator = ReadWriteUtils.getSystemLineSeparator();
1441
                    lineSeparator = ReadWriteUtils.getSystemLineSeparator();
1434
                }
1442
                }
(-)a/editor/nbproject/project.xml (-1 / +1 lines)
Lines 167-173 Link Here
167
                    <build-prerequisite/>
167
                    <build-prerequisite/>
168
                    <compile-dependency/>
168
                    <compile-dependency/>
169
                    <run-dependency>
169
                    <run-dependency>
170
                        <specification-version>7.55</specification-version>
170
                        <specification-version>7.56</specification-version>
171
                    </run-dependency>
171
                    </run-dependency>
172
                </dependency>
172
                </dependency>
173
                <dependency>
173
                <dependency>
(-)a/editor/src/org/netbeans/modules/editor/EditorModule.java (-1 / +10 lines)
Lines 637-642 Link Here
637
            
637
            
638
            final StyledDocument doc = ec.openDocument();
638
            final StyledDocument doc = ec.openDocument();
639
            final Reformat reformat = Reformat.get(doc);
639
            final Reformat reformat = Reformat.get(doc);
640
            String defaultLineSeparator = (String) file.getPrimaryFile().getAttribute(BaseDocument.DEFAULT_LINE_SEPARATOR_PROP);
641
            if (defaultLineSeparator != null) {
642
                doc.putProperty(BaseDocument.DEFAULT_LINE_SEPARATOR_PROP, defaultLineSeparator);
643
            }
640
            
644
            
641
            reformat.lock();
645
            reformat.lock();
642
            
646
            
Lines 658-664 Link Here
658
                
662
                
659
            } finally {
663
            } finally {
660
                reformat.unlock();
664
                reformat.unlock();
661
                doc.putProperty(BaseDocument.READ_LINE_SEPARATOR_PROP, ReadWriteUtils.getSystemLineSeparator());
665
                defaultLineSeparator = (String) doc.getProperty(BaseDocument.DEFAULT_LINE_SEPARATOR_PROP);
666
                if (defaultLineSeparator != null) {
667
                    doc.putProperty(BaseDocument.READ_LINE_SEPARATOR_PROP, defaultLineSeparator);
668
                } else {
669
                    doc.putProperty(BaseDocument.READ_LINE_SEPARATOR_PROP, ReadWriteUtils.getSystemLineSeparator());
670
                }
662
                ec.saveDocument();
671
                ec.saveDocument();
663
            }
672
            }
664
            
673
            
(-)a/openide.filesystems/apichanges.xml (+18 lines)
Lines 49-54 Link Here
49
        <apidef name="filesystems">Filesystems API</apidef>
49
        <apidef name="filesystems">Filesystems API</apidef>
50
    </apidefs>
50
    </apidefs>
51
    <changes>
51
    <changes>
52
         <change id="default-line-separator">
53
            <api name="filesystems"/>
54
            <summary>Provides default line separator</summary>
55
            <version major="7" minor="7.56"/>
56
            <date day="23" month="12" year="2011"/>
57
            <author login="alexvsimon"/>
58
            <compatibility addition="yes" binary="compatible" source="compatible" semantic="compatible" deprecation="no" deletion="no" modification="no"/>
59
            <description>
60
                <p>
61
                    File object can provide default line separator if it differs from <code>System.getProperty("line.separator")</code>.
62
                    <a href="@TOP@/architecture-summary.html#answer-arch-usecases">content of system filesystem</a> by
63
                    Call <code>fo.getAttribute("default-line-separator")</code> return string with default line separator.
64
                    Default line separator will be used for new files.
65
                </p>
66
            </description>
67
            <class package="org.openide.filesystems" name="Repository"/>
68
            <issue number="199534"/>
69
        </change>
52
        <change id="FileObject.revert">
70
        <change id="FileObject.revert">
53
            <api name="filesystems"/>
71
            <api name="filesystems"/>
54
            <summary>Introduced <code>FileObject.revert</code></summary>
72
            <summary>Introduced <code>FileObject.revert</code></summary>
(-)a/openide.filesystems/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.openide.filesystems
2
OpenIDE-Module: org.openide.filesystems
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
5
OpenIDE-Module-Specification-Version: 7.55
5
OpenIDE-Module-Specification-Version: 7.56
6
6
(-)a/openide.loaders/nbproject/project.xml (-1 / +1 lines)
Lines 122-128 Link Here
122
                    <build-prerequisite/>
122
                    <build-prerequisite/>
123
                    <compile-dependency/>
123
                    <compile-dependency/>
124
                    <run-dependency>
124
                    <run-dependency>
125
                        <specification-version>7.55</specification-version>
125
                        <specification-version>7.56</specification-version>
126
                    </run-dependency>
126
                    </run-dependency>
127
                </dependency>
127
                </dependency>
128
                <dependency>
128
                <dependency>
(-)a/openide.loaders/src/org/openide/text/DataEditorSupport.java (-1 / +7 lines)
Lines 125-130 Link Here
125
    /** error manager for CloneableEditorSupport logging and error reporting */
125
    /** error manager for CloneableEditorSupport logging and error reporting */
126
    static final Logger ERR = Logger.getLogger("org.openide.text.DataEditorSupport"); // NOI18N
126
    static final Logger ERR = Logger.getLogger("org.openide.text.DataEditorSupport"); // NOI18N
127
127
128
    /** Default line separator property for writing content into files. If not set
129
     * the platform default line separator is used.
130
     */
131
    private static final String DEFAULT_LINE_SEPARATOR_PROP = "default-line-separator"; // NOI18N
132
128
    /** Which data object we are associated with */
133
    /** Which data object we are associated with */
129
    private final DataObject obj;
134
    private final DataObject obj;
130
    /** listener to associated node's events */
135
    /** listener to associated node's events */
Lines 433-439 Link Here
433
    @Override
438
    @Override
434
    protected StyledDocument createStyledDocument (EditorKit kit) {
439
    protected StyledDocument createStyledDocument (EditorKit kit) {
435
        StyledDocument doc = super.createStyledDocument (kit);
440
        StyledDocument doc = super.createStyledDocument (kit);
436
            
441
  
437
        // set document name property
442
        // set document name property
438
        doc.putProperty(Document.TitleProperty,
443
        doc.putProperty(Document.TitleProperty,
439
            FileUtil.getFileDisplayName(obj.getPrimaryFile())
444
            FileUtil.getFileDisplayName(obj.getPrimaryFile())
Lines 480-485 Link Here
480
            c = FileEncodingQuery.getEncoding(this.getDataObject().getPrimaryFile());
485
            c = FileEncodingQuery.getEncoding(this.getDataObject().getPrimaryFile());
481
        }
486
        }
482
        final FileObject fo = this.getDataObject().getPrimaryFile();
487
        final FileObject fo = this.getDataObject().getPrimaryFile();
488
        doc.putProperty(DEFAULT_LINE_SEPARATOR_PROP, fo.getAttribute(DEFAULT_LINE_SEPARATOR_PROP));
483
        final Reader r;
489
        final Reader r;
484
        if (warnedEncodingFiles.contains(fo)) {
490
        if (warnedEncodingFiles.contains(fo)) {
485
            r = new InputStreamReader (stream, c);
491
            r = new InputStreamReader (stream, c);

Return to bug 199534